Skip to main content

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 PatternPayload SchemaDescription
market:orderbook:{venue}:{symbol}orderBookOrder book snapshots / diffs / deltas
market:ticker:{venue}:{symbol}tickerPer-instrument ticker updates
market:ticker:{venue}tickerVenue-wide ticker fanout (live screening)
market:kline:{venue}:{symbol}:{interval}klineLive and closed kline updates
market:trade:{venue}:{symbol}Trade dataReal-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:

FieldTypeDescription
updateTypestring enumSNAPSHOT | DIFF | DELTA — how the client should apply the payload
instrumentIdstringFormat: VENUE:SYMBOL
venuestringTrading venue
symbolstringTrading pair
orderBookTypestring enumL2 | L2_COUNTED | L3 | L3_COUNTED | L2_EXCHANGE | VWAP
columnsstring arrayPositional layout of each entry in bids / asks
bidsarray of arraysBid rows (sorted by price descending), tuple matches columns
asksarray of arraysAsk rows (sorted by price ascending), tuple matches columns
timestampint (ms)Order book timestamp in milliseconds

Update type semantics:

  • SNAPSHOT — full state of the book; client replaces its local view
  • DIFF — incremental change; per-level zero quantity removes, non-zero upserts
  • DELTA — 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

FieldTypeDescription
instrumentIdstringFormat: VENUE:SYMBOL
venuestringTrading venue
symbolstringTrading pair
lastPricestring (decimal)Price of the last trade
lastQuantitystring (decimal)Quantity of the last trade
bidPricestring (decimal)Best bid price
bidQuantitystring (decimal)Quantity at best bid
askPricestring (decimal)Best ask price
askQuantitystring (decimal)Quantity at best ask
timestampint (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

FieldTypeDescription
instrumentIdstringFormat: VENUE:SYMBOL
venuestringTrading venue
symbolstringTrading pair
intervalstringKline interval (e.g. 1m, 5m, 1h, 1d)
candlesarray of tuplesOHLCV tuples ordered ascending by openTime
isClosedbooleanWhether the last candle in candles is finalized
timestampint (ms)Server timestamp of the message

Each candle is a fixed-position OHLCV tuple — no columns field:

PositionFieldTypeRequired
0openTimeint (ms)Yes
1openstring (decimal)Yes
2highstring (decimal)Yes
3lowstring (decimal)Yes
4closestring (decimal)Yes
5volumestring (decimal) | nullOptional — 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()