GET.
Authenticating the handshake
The upgrade request carries the same threeDX-ACCESS-* headers as REST. The
canonical string is fixed:
401. There is no
anonymous WebSocket access.
Commands
Client to server:cmd is subscribe, unsubscribe, list_subscriptions, or
update_subscription. id is yours and is echoed back. Per-market public
channels need market_ids on subscribe; one subscription can span markets from
different assets. The two global channels (oracle, rounds) and the private
user channel have no market set — in a mixed subscribe the market_ids you
send apply to the per-market channels and are ignored for these three.
market_ids is only required when the request includes a per-market channel;
omitting it otherwise is fine, and omitting it when one is present is
wscode 9.
The reply assigns a subscription id, one per channel:
get_snapshot, add_markets, delete_markets. The ack is
type: "updated" with the resulting market set, then any snapshots.
Data envelope
seq is per subscription and contiguous from 1.
Command errors
Live channels
Six channels are implemented:orderbook_snapshot, orderbook_delta, trades, user,
oracle, and rounds. The ticker display feed is deferred, subscribing returns
wscode 4. See Channels for what each one carries.
Next
- WebSocket quickstart, complete runnable script
- Channels, what each feed carries
- Orderbook responses, interpreting L2 levels