Market Data Channels
Public channels for real-time market data. All authenticated users can subscribe to market data channels.
Channel publications carry the same orderBook / ticker / kline payload schemas used by the REST API (GET /api/v3/market/...) and WebSocket RPC (query.{type}.get / query.{type}.list). One canonical schema per data type, used identically across all surfaces.
Channel Patterns
| Channel Pattern | Payload Schema | Description |
|---|---|---|
market:orderbook:{venue}:{symbol} | orderBook | Order book snapshots / diffs / deltas |
market:ticker:{venue}:{symbol} | ticker | Per-instrument ticker updates |
market:ticker:{venue} | ticker | Venue-wide ticker fanout (live screening) |
market:kline:{venue}:{symbol}:{interval} | kline | Live and closed kline updates |
market:trade:{venue}:{symbol} | Trade data | Real-time trades |
Order Book Subscriptions
Subscribe to real-time order book updates.
Step 1: Create Server-Side Subscription (Admin only)
await client.rpc("command.subscription.create", {
"venue": "BINANCE",
"instruments": ["BTC/USDT"],
"subscriptionType": "MARKET.SUBSCRIPTION.ORDERBOOK"
})
Step 2: Subscribe to Channel
channel = "market:orderbook:BINANCE:BTC/USDT"
sub = client.new_subscription(channel, events=handler)
await sub.subscribe()
Order Book Data Format
Publications carry the unified orderBook schema:
| Field | Type | Description |
|---|---|---|
updateType | string enum | SNAPSHOT | DIFF | DELTA — how the client should apply the payload |
instrumentId | string | Format: VENUE:SYMBOL |
venue | string | Trading venue |
symbol | string | Trading pair |
orderBookType | string enum | L2 | L2_COUNTED | L3 | L3_COUNTED | L2_EXCHANGE | VWAP |
columns | string array | Positional layout of each entry in bids / asks |
bids | array of arrays | Bid rows (sorted by price descending), tuple matches columns |
asks | array of arrays | Ask rows (sorted by price ascending), tuple matches columns |
timestamp | int (ms) | Order book timestamp in milliseconds |
Update type semantics:
SNAPSHOT— full state of the book; client replaces its local viewDIFF— incremental change; per-level zero quantity removes, non-zero upsertsDELTA— reconciliation delta against a known reference state (venue-specific)
Example (L2_COUNTED snapshot):
{
"updateType": "SNAPSHOT",
"instrumentId": "BINANCE:BTC/USDT",
"venue": "BINANCE",
"symbol": "BTC/USDT",
"orderBookType": "L2_COUNTED",
"columns": ["price", "quantity", "orderCount"],
"bids": [["50000.00", "1.5", "3"], ["49999.50", "2.3", "7"]],
"asks": [["50000.50", "1.2", "2"]],
"timestamp": 1703052635110
}
Ticker Subscriptions
Subscribe to real-time ticker updates per instrument or venue-wide.
Channel Formats
market:ticker:{venue}:{symbol} # Per-instrument
market:ticker:{venue} # Venue-wide fanout
Example
# Per-instrument
sub = client.new_subscription("market:ticker:BINANCE:BTC/USDT", events=handler)
await sub.subscribe()
# Venue-wide screening
sub = client.new_subscription("market:ticker:BINANCE", events=handler)
await sub.subscribe()
Ticker Data Format
| Field | Type | Description |
|---|---|---|
instrumentId | string | Format: VENUE:SYMBOL |
venue | string | Trading venue |
symbol | string | Trading pair |
lastPrice | string (decimal) | Price of the last trade |
lastQuantity | string (decimal) | Quantity of the last trade |
bidPrice | string (decimal) | Best bid price |
bidQuantity | string (decimal) | Quantity at best bid |
askPrice | string (decimal) | Best ask price |
askQuantity | string (decimal) | Quantity at best ask |
timestamp | int (ms) | Ticker timestamp in milliseconds |
Kline Subscriptions
Subscribe to live and closed candles for an instrument and interval.
Channel Format
market:kline:{venue}:{symbol}:{interval}
Example
channel = "market:kline:BINANCE:BTC/USDT:1m"
sub = client.new_subscription(channel, events=handler)
await sub.subscribe()
Kline Data Format
| Field | Type | Description |
|---|---|---|
instrumentId | string | Format: VENUE:SYMBOL |
venue | string | Trading venue |
symbol | string | Trading pair |
interval | string | Kline interval (e.g. 1m, 5m, 1h, 1d) |
candles | array of tuples | OHLCV tuples ordered ascending by openTime |
isClosed | boolean | Whether the last candle in candles is finalized |
timestamp | int (ms) | Server timestamp of the message |
Each candle is a fixed-position OHLCV tuple — no columns field:
| Position | Field | Type | Required |
|---|---|---|---|
| 0 | openTime | int (ms) | Yes |
| 1 | open | string (decimal) | Yes |
| 2 | high | string (decimal) | Yes |
| 3 | low | string (decimal) | Yes |
| 4 | close | string (decimal) | Yes |
| 5 | volume | string (decimal) | null | Optional — venues without volume (e.g. CFD) emit null |
Streaming surfaces emit isClosed: false while the current bar is forming and isClosed: true when it closes.
Example:
{
"instrumentId": "BINANCE:BTC/USDT",
"venue": "BINANCE",
"symbol": "BTC/USDT",
"interval": "1m",
"candles": [
[1703052540000, "50000", "50050", "49990", "50010", "12.34"],
[1703052600000, "50010", "50080", "50000", "50045", null]
],
"isClosed": false,
"timestamp": 1703052635110
}
Trade Subscriptions
Subscribe to real-time trade updates.
Channel Format
market:trade:{venue}:{symbol}
Example
channel = "market:trade:BINANCE:BTC/USDT"
sub = client.new_subscription(channel, events=handler)
await sub.subscribe()