Subscribe to per-market channels
Subscribe to per-wallet channels
subscribe request is
allowed, the server partitions them by keying, but each group needs its matching field:
market-keyed channels require market, wallet-keyed channels require user.
Recommended: send oneFor each newly-subscribed channel that has a snapshot semanticsubscribeper keying. If you mix groups and a required field is missing, the server emits theINVALID_MESSAGEerror for the first offending group and stops processing the rest of that request — the other groups in the same frame are silently skipped. To avoid this, send market channels (withmarket), wallet channels (withuser), and global channels in separatesubscribeframes. It’s cheap and unambiguous.
orderbook, trades,
ticker), the server immediately pushes a snapshot frame on the same connection.
Subsequent frames for that channel are incremental updates limit_orders / user_orders
user_fills have no snapshot, they’re event-driven only.
If you’re already subscribed to a channel, you get an ALREADY_SUBSCRIBED error
for that channel (channel-by-channel partially-new subscriptions still proceed
for the new ones). Unknown channel names return INVALID_MESSAGE.
Subscribe to kline / mid_kline
Kline subscriptions take aresolution instead of a channels list, because
only one resolution per market per connection is active at a time. Re-subscribing
to a different resolution replaces the current one.
"1", "5", "15", "30", "60", "240", "D", "W", "M". Anything
else returns INVALID_RESOLUTION.
Confirmation:
Subscribe to global channels
market field, if present, is ignored
for these channels (harmless to send for parity with your other subscribe calls).
The subscribed confirmation for a global channel echoes a market field. Because global
channels are routed through the market-subscribe path internally, the confirmation for e.g.
mini_tickers comes back as
{"op":"subscribed","channels":["mini_tickers"],"market":"11111111111111111111111111111111"}
(a placeholder all-ones address, or the market you passed if you passed one).
Ignore the market field on global-channel confirmations, it carries no meaning.
Match the confirmation on the channels array instead.
Unsubscribing
NOT_SUBSCRIBED.
(The resolution in unsubscribe_kline / unsubscribe_mid_kline is required
by the message shape but ignored — there’s only one active resolution per market
to remove.)