Messages
{
"type": "orderbook_snapshot",
"sending_ts_ms": 1669149841234,
"sid": 2,
"seq": 2,
"msg": {
"market_ticker": "FED-23DEC-T3.00",
"market_id": "9b0f6b43-5b68-4f9f-9f02-9a2d1b8ac1a1",
"clock": 4182057,
"yes_dollars_fp": [
[
"0.0800",
"300.00"
],
[
"0.2200",
"333.00"
]
],
"no_dollars_fp": [
[
"0.5400",
"20.00"
],
[
"0.5600",
"146.00"
]
]
}
}{
"type": "orderbook_delta",
"sending_ts_ms": 1669149841123,
"sid": 2,
"seq": 3,
"msg": {
"market_ticker": "FED-23DEC-T3.00",
"market_id": "9b0f6b43-5b68-4f9f-9f02-9a2d1b8ac1a1",
"clock": 4182061,
"price_dollars": "0.9600",
"delta_fp": "-54.00",
"side": "yes",
"ts": "2022-11-22T20:44:01Z",
"ts_ms": 1669149841000
}
}WebSockets
Orderbook Updates
Real-time orderbook price level changes. Provides incremental updates to maintain a live orderbook.
Requirements:
- Authentication required
- Market specification required:
- Use
market_ticker(string) for a single market - Use
market_tickers(array of strings) for multiple markets market_id/market_idsare not supported for this channel
- Use
- Sends
orderbook_snapshotfirst, then incrementalorderbook_deltaupdates - Supports
update_subscriptionwithadd_markets/delete_markets/get_snapshotactions get_snapshotreturns anorderbook_snapshotfor the requestedmarket_tickerswithout modifying the subscription
Matching updates across connections:
clockis the exchange clock. It is the same on every connection, so it can match a market’s updates across redundant connections;seqcounts messages on one subscription only- One exchange action can make several deltas, so several deltas can share a
clock. Every connection sends them in the same order, before any delta for that market with a higherclock - A snapshot includes every change with a
clockat or below its own; the deltas that follow it on that connection have higher clocks - While you are subscribed to a market, its clocks never go down outside exchange maintenance, but they skip values. They are not comparable across markets. Keep checking
seqon each connection for missed messages - A market’s clock may decrease during exchange maintenance, so don’t compare clocks from before a maintenance period with clocks after it
Use case: Building and maintaining a real-time orderbook
WSS
orderbook_delta
Messages
{
"type": "orderbook_snapshot",
"sending_ts_ms": 1669149841234,
"sid": 2,
"seq": 2,
"msg": {
"market_ticker": "FED-23DEC-T3.00",
"market_id": "9b0f6b43-5b68-4f9f-9f02-9a2d1b8ac1a1",
"clock": 4182057,
"yes_dollars_fp": [
[
"0.0800",
"300.00"
],
[
"0.2200",
"333.00"
]
],
"no_dollars_fp": [
[
"0.5400",
"20.00"
],
[
"0.5600",
"146.00"
]
]
}
}{
"type": "orderbook_delta",
"sending_ts_ms": 1669149841123,
"sid": 2,
"seq": 3,
"msg": {
"market_ticker": "FED-23DEC-T3.00",
"market_id": "9b0f6b43-5b68-4f9f-9f02-9a2d1b8ac1a1",
"clock": 4182061,
"price_dollars": "0.9600",
"delta_fp": "-54.00",
"side": "yes",
"ts": "2022-11-22T20:44:01Z",
"ts_ms": 1669149841000
}
}apiKey
type:apiKey
API key authentication required for WebSocket connections. The API key should be provided during the WebSocket handshake.
Orderbook Snapshot
type:object
Complete view of the order book's aggregated price levels
Orderbook Delta
type:object
Update to be applied to the current order book view