subscribe
Endpoint
WebSocket /ws
Selector: method: "subscribe"
Purpose
Starts a private account subscription and delivers its initial data message followed by updates.
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 | One of the supported private subscription objects below. |
| Subscription type | Fields | Reference |
|---|---|---|
clearinghouseState | type, user, optional dex. | Account state |
openOrders | type, user, optional dex. | Open orders |
userFills | type, user, optional aggregateByTime. | Customer fills |
Request example
Test fixture. Generate a fresh proof before use. Fixture inputs.
{
"method": "subscribe",
"subscription": {
"type": "openOrders",
"user": "0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf"
},
"auth": {
"timestamp": 1796250000000,
"nonce": "0x0303030303030303030303030303030303030303030303030303030303030303",
"signature": "0xca60c8cb82aa8b58b8283a3a2c324a0cba31c4162b0c942523f7c53f2f54ce455b072a9f2bdca857ae08d5b27bf01f746d011a30bdce4b8b5ea72dad34b55f4b1c"
}
}Response fields
| Field | Meaning |
|---|---|
channel | "subscriptionResponse" for the acknowledgement. |
data | Acknowledgement object containing the logical request. |
data.method | "subscribe". |
data.subscription | Echoed subscription object. |
A new subscription then receives its initial data message. Its wrapper and payload are documented on the page for the selected subscription type.
Response example
{
"channel": "subscriptionResponse",
"data": {
"method": "subscribe",
"subscription": {
"type": "openOrders",
"user": "0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf"
}
}
}Constraints
- Unknown subscription fields are rejected. Unsupported subscriptions, unauthorized targets or exhausted subscription capacity can close the connection.
- Across all types, a connection supports eight active subscriptions.
dexmust be omitted or""for the default DEX.aggregateByTimemust be omitted orfalse;trueis unsupported.- Duplicates acknowledge the existing subscription without duplicate delivery or another snapshot.
- A new connection requires fresh signed subscriptions and signed
/inforeconciliation. A complete replay of every disconnected update is not assumed.
unsubscribe removes an active subscription. WebSocket overview covers connection behavior and the supported message surface.