batchClearinghouseStates
Get clearinghouse states for multiple users in a single request.
Get clearinghouse states for multiple users in a single request.
POST Request
type
string
Must be "batchClearinghouseStates"
users
array
Array of Ethereum addresses
dex
string
Perp DEX name. Defaults to empty string (native DEX). Use "ALL_DEXES" to fetch clearinghouse state across all dexes (native + all HIP-3 dexes) in one request.
Limits
You can query 1000 users at once. Note that with the ALL_DEXES field passed that limit is 100 users.
curl -X POST https://api.hydromancer.xyz/info \
-H "Authorization: Bearer $HYDROMANCER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "batchClearinghouseStates",
"users": [
"0x0000000000000000000000000000000000000001",
"0x0000000000000000000000000000000000000002"
]
}'import requests
import os
response = requests.post(
'https://api.hydromancer.xyz/info',
json={
'type': 'batchClearinghouseStates',
'users': [
'0x0000000000000000000000000000000000000001',
'0x0000000000000000000000000000000000000002'
]
},
headers={
'Authorization': f'Bearer {os.environ.get("HYDROMANCER_API_KEY")}',
'Content-Type': 'application/json'
}
)
print(response.json())Response Fields
successful_states
array
Array of [address, clearinghouseState] tuples
successful_states[n][0]
string
User address
successful_states[n][1].marginSummary
object
Margin summary (accountValue, totalMarginUsed, totalNtlPos, totalRawUsd, withdrawable)
successful_states[n][1].crossMarginSummary
object
Cross margin summary (same fields as marginSummary)
successful_states[n][1].assetPositions
array
Array of position objects
successful_states[n][1].time
int
Timestamp in milliseconds
failed_wallets
array
Array of addresses that failed to fetch
Last updated