method field set to "subscribe" or "unsubscribe", and a subscription object that specifies the channel type and any required parameters. The server acknowledges each request and begins (or stops) pushing messages on that channel.
Subscribing to a channel
Send the following JSON frame to start receiving messages on a channel:subscriptionResponse acknowledgement:
data field mirrors your original request so you can match acknowledgements to subscriptions in async code.
Unsubscribing from a channel
Send the samesubscription object with "method": "unsubscribe" to stop receiving messages:
subscriptionResponse with "method": "unsubscribe" to confirm.
Error messages
If a subscription request is invalid, the server responds on theerror channel:
data.subscription echoes the subscription object of the refused request, mirroring the subscriptionResponse acknowledgement, so you can tell which of several concurrent subscriptions was refused.
All subscription types and parameters
The table below lists every channel type and its parameters. No channel requires an authentication step.
Parameter formats:
asset— the contract ID as a string, for example"1". Read contract IDs fromconfigs.user— the account address in lowercase,0xfollowed by 40 hex characters. The address must belong to a registered account; otherwise the server returns anerrorframe.group— optional forl2Book: a price-grouping level from the contract’sdigitMergelist inconfigs. See L2 Book.
Quick examples by channel type
- l2Book
- bbo
- trades
- ticker
- allMarkets
- candle
- orderUpdates
- openOrders
- userFills
- config
