Messages
No examples found{
"type": "<string>",
"sid": 123,
"seq": 123,
"msg": {
"market_ticker": "<string>",
"price": "<string>",
"delta": "<string>",
"side": "<string>",
"last_update_reason": "<string>",
"client_order_id": "<string>",
"ts_ms": 123,
"subaccount": 123,
"subaccount_type": "<string>"
},
"sending_ts_ms": 123
}WebSockets
Orderbook Updates
Real-time margin orderbook price-level changes.
Requirements:
- authenticated connection
- market specification required via
market_tickerormarket_tickers - sends
orderbook_snapshotfirst, then incrementalorderbook_deltaupdates - supports
get_snapshotonupdate_subscriptionto request a fresh snapshot without changing the subscribed markets. Apply every returned snapshot as a replacement for that market’s local book - each connection has one
orderbook_deltasubscription. A repeatedsubscribeadds new markets to its existingsidand sends no snapshot for markets already subscribed - a repeated
subscribemust use the existingupdate_interval_ms(omitting it means0); a different valid interval returns error code 11 without adding markets. Useupdate_subscriptionwithadd_marketsto add markets without respecifying the interval. To change it,unsubscribe, wait forunsubscribed, thensubscribeagain - optional conflated updates: set
update_interval_msto100or1000on the initialsubscribeto receive one netorderbook_deltaper changed price level per window. A window starts with its first held change; processing and transport can delay delivery. Updates to your own orders within any subaccount restriction and snapshots bypass the interval. A snapshot replaces any unsent held changes for its market, andseqstays contiguous. Omit it or set it to0for real-time updates, the default - levels whose held changes cancel out are skipped.
ts_msis the timestamp of the latest change included in each delta; it can decrease between deltas and is not a completeness watermark. Follow the subscription’sseqfor delivery order - changes to other participants’ orders, including liquidity your trades consume, remain held. Between flushes, public levels can lag your own orders and the book can appear locked or crossed. A flush has separate delta messages and no end-of-flush message
- apply every delta in
seqorder within its subscription. Recover a gap withget_snapshotfor all subscribed markets, orunsubscribe, wait forunsubscribed, thensubscribeagain. Replace each book with its new snapshot before applying later deltas; a repeatedsubscribealone does not resynchronize existing markets - conflation windows are independent across subscriptions. When switching connections, rebuild from that
connection’s snapshot and follow its own
seq; do not combine deltas from different connections
WSS
orderbook_delta
Messages
No examples found{
"type": "<string>",
"sid": 123,
"seq": 123,
"msg": {
"market_ticker": "<string>",
"price": "<string>",
"delta": "<string>",
"side": "<string>",
"last_update_reason": "<string>",
"client_order_id": "<string>",
"ts_ms": 123,
"subaccount": 123,
"subaccount_type": "<string>"
},
"sending_ts_ms": 123
}apiKey
type:apiKey
API key authentication required for margin WebSocket connections.
Orderbook Snapshot
type:object
Complete view of the margin order book's aggregated price levels
Orderbook Delta
type:object
Update to be applied to the current margin order book view