clearinghouseState
Endpoint
WebSocket /ws
Selector: subscription.type: "clearinghouseState"
Purpose
Streams the selected customer's private account state and perpetual positions. It reflects the customer's allocation inside Hyperjutsu, not the pooled venue account's aggregate exposure.
Authorization
Owner or approved reader for subscription.user. The SDK signs requests. Current permissions are checked before delivery; expiry or revocation stops access.
Request fields
| Field | Type | Required | Meaning |
|---|---|---|---|
method | String | Yes | "subscribe". |
auth | Object | Yes | Request proof with timestamp, nonce and signature; see authorization. |
subscription | Object | Yes | Subscription definition. |
subscription.type | String | Yes | "clearinghouseState". |
subscription.user | Address | Yes | Customer account authorized by the request signer. |
subscription.dex | String | No | Omit or use "" for the default DEX. Other values are unsupported. |
Request example
Test fixture. Generate a fresh proof before use. Fixture inputs.
{
"method": "subscribe",
"subscription": {
"type": "clearinghouseState",
"user": "0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf"
},
"auth": {
"timestamp": 1796250000000,
"nonce": "0x0202020202020202020202020202020202020202020202020202020202020202",
"signature": "0x9d3926e264f33056c287d31b1378daf634671f3c6388660725f802ccff09dbc30a3c4702271559a6a9df3a0f3025a81bee7b279883aa74c4b8d483d5ee503be41c"
}
}Response fields
First receive a subscribe acknowledgement, then data:
| Field | Meaning |
|---|---|
channel | "clearinghouseState". |
data | Customer account-state message. |
data.dex | "" for the default DEX. |
data.user | Selected customer account address. |
data.clearinghouseState | Account-state object with the same logical shape as the corresponding /info query. |
data.clearinghouseState.assetPositions | Customer position entries, including account-specific leverage, PnL and funding fields. |
data.clearinghouseState.crossMaintenanceMarginUsed | Cross-maintenance margin used, as a decimal string. |
data.clearinghouseState.crossMarginSummary | Cross-margin summary, including decimal-string account value, margin used, notional position value and raw USD balance. |
data.clearinghouseState.marginSummary | Margin summary with the same summary fields. |
data.clearinghouseState.time | Account-state time in Unix milliseconds. |
data.clearinghouseState.withdrawable | Withdrawable amount as a decimal string. |
Response example
Illustrative data message:
{
"channel": "clearinghouseState",
"data": {
"dex": "",
"user": "0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf",
"clearinghouseState": {
"assetPositions": [],
"crossMaintenanceMarginUsed": "0",
"crossMarginSummary": {
"accountValue": "1000",
"totalMarginUsed": "0",
"totalNtlPos": "0",
"totalRawUsd": "1000"
},
"marginSummary": {
"accountValue": "1000",
"totalMarginUsed": "0",
"totalNtlPos": "0",
"totalRawUsd": "1000"
},
"time": 1796000000000,
"withdrawable": "1000"
}
}
}Constraints
- The initial state is followed by changed states. A timestamp-only change does not produce a new message.
- Monetary and position quantities use decimal strings. Unverified cross-margin liquidation prices remain
null; they are not replaced with guessed estimates. - Duplicate requests acknowledge the existing subscription without another snapshot.
unsubscribe stops this subscription. WebSocket overview covers connection limits and reconnect behavior.