Real-time market data stream with dynamic topic subscription (order book snapshots/diffs, trades).
Subscription Model (no query parameters):
- Connection starts with zero markets subscribed
- Client sends a subscribe frame (MDClientSubscribe) listing market_id values
- Server replies with exactly one MDBookSnapshot per NEW market, then streams MDBookDiff / MDTrade
- Client may send unsubscribe (MDClientUnsubscribe) to stop updates for specific markets
- Repeated subscription for already active market without force_snapshot is idempotent (no extra snapshot)
Ordering / Monotonicity:
- md_seq is dense and strictly increasing per market_id ONLY on data frames (book_snapshot, book_diff, trade)
- heartbeat does not advance md_seq
- Gaps in md_seq per market indicate operational incident; client SHOULD resync (fresh snapshot + re-subscribe)
Initial Snapshots:
- Snapshot sent only upon successful subscription (or re-subscription with force_snapshot=true)
Snapshots Cadence:
- Periodic server-initiated book_snapshot frames limit diff chain length
- Clients MUST apply snapshot then contiguous diffs/trades with md_seq = snapshot.md_seq+1 … without gaps
Operation WebSockets-specific information
-
Hide headers attributes Show headers attributes object
-
Broker access key identifier
Format should match the following pattern:
^[A-Za-z0-9._~-]{1,64}$. -
RFC3339 timestamp with milliseconds
-
Keyed BLAKE2b-256 signature hex lowercase
Format should match the following pattern:
^[0-9a-f]{64}$.
-
Payload examples
{
"type": "book_snapshot",
"market_id": "string",
"md_seq": 42,
"ts_ns": 42,
"bids": [
{
"price": {
"units": 42,
"nanos": 42
},
"qty": {
"units": 42,
"nanos": 42
}
}
],
"asks": [
{
"price": {
"units": 42,
"nanos": 42
},
"qty": {
"units": 42,
"nanos": 42
}
}
]
}
Payload examples
{
"type": "book_diff",
"market_id": "string",
"md_seq": 42,
"ts_ns": 42,
"bids": [
{
"price": {
"units": 42,
"nanos": 42
},
"qty": {
"units": 42,
"nanos": 42
}
}
],
"asks": [
{
"price": {
"units": 42,
"nanos": 42
},
"qty": {
"units": 42,
"nanos": 42
}
}
]
}
Payload examples
{
"type": "trade",
"market_id": "string",
"md_seq": 42,
"ts_ns": 42,
"trade_id": "string",
"price": {
"units": 42,
"nanos": 42
},
"qty": {
"units": 42,
"nanos": 42
},
"taker_side": "BUY"
}
Payload examples
{
"type": "heartbeat",
"ts_ns": 42,
"market_id": "string",
"md_seq": 42
}