Exchange Wire Formats

Binance Spot wire format

How Binance Spot messages become rows in our Parquet files. Each data type below shows a real message next to the rows we publish for it, with the source and the rule for every column. Hover a line or a column to see how they connect.

Checked against our pipeline

These messages were captured from Binance Spot on 2026-10-05. Our test suite replays each one through the production collector parser and postprocessor, and fails if the published rows differ from the rows on this page. Files written before a change to the pipeline can differ; see Known Gaps & Corrections.

  • Trades WebSocket: wss://stream.binance.com:9443/stream?streams=<symbol>@trade/…
  • Depth WebSocket: wss://stream.binance.com:9443/stream?streams=<symbol>@depth@100ms/…
  • Ticker WebSocket: wss://stream.binance.com:9443/stream?streams=<symbol>@ticker/…
  • REST: https://api.binance.com

Exchange API reference: developers.binance.com. Conventions shared by every exchange are on the wire formats overview.

Trades

One row per trade from the <symbol>@trade stream.

  • WebSocket <symbol>@trade
WebSocket message · <symbol>@tradereceived 2026-10-05 19:15:46.969645 UTC
{
"stream": "btcusdt@trade",
"data": {
"e": "trade",
"E": 1791227746836,
"s": "BTCUSDT",
"t": 6738013629,
"p": "85667.22000000",
"q": "0.00018000",
"T": 1791227746835,
"m": true,
"M": true
}
}

Published row

received_time1791227746969645000—Our collector's clock when the message arrived, in nanoseconds since the Unix epoch. Not sent by Binance.
event_time1791227746836data.ECopied. Milliseconds.
symbolBTCUSDTdata.sCopied.
trade_id6738013629data.tCopied.
price85667.22000000data.pCopied as the exact decimal string Binance sent.
quantity0.00018000data.qCopied as the exact decimal string. Base asset units.
trade_time1791227746835data.TCopied. Milliseconds.
is_buyer_makertruedata.mCopied. true means the seller was the aggressor.
order_typeMARKET—Always MARKET. A placeholder: the spot trade stream has no order type field.

Notes

  • order_type is always MARKET as a placeholder. Use is_buyer_maker for the aggressor side.
  • The M field is not published; Binance documents it as ignorable.

Column types and descriptions: Trades schema.

Order Book

One row per price level. Updates come from the <symbol>@depth@100ms stream; REST snapshots anchor the book.

  • WebSocket <symbol>@depth@100ms
  • REST GET /api/v3/depth

Depth update

Binance sends at most one depthUpdate per symbol every 100 ms, with the levels that changed in that interval.

WebSocket message · <symbol>@depth@100msreceived 2026-10-05 19:16:56.142210 UTC
{
"stream": "btcusdt@depth@100ms",
"data": {
"e": "depthUpdate",
"E": 1791227816014,
"s": "BTCUSDT",
"U": 101075721603,
"u": 101075721609,
"b": [
["85517.96000000", "0.00000000"],
["68521.58000000", "0.00261000"]
],
"a": [
["85774.91000000", "0.00000000"]
]
}
}

Published rows · 3

received_time1791227816142210000—Our collector's clock when the message arrived, in nanoseconds since the Unix epoch. Not sent by Binance.
event_time1791227816014data.ECopied. Milliseconds.
transaction_timenull—Null. Spot depth updates carry no transaction time.
symbolBTCUSDTdata.sCopied.
event_typeupdatedata.eupdate for every depthUpdate message.
first_update_id101075721603data.UCopied.
final_update_id101075721609data.uCopied.
prev_final_update_idnull—Null. Spot depth updates carry no pu; the next message's U is this message's u + 1, and a larger U is a gap.
last_update_idnull—Null. Depth updates carry no separate last update ID.
sideaskdata.bdata.abid for levels in b, ask for levels in a. One row per level.
price85774.91000000data.b[][0]data.a[][0]Copied as the exact decimal string.
quantity0.00000000data.b[][1]data.a[][1]Copied as the exact decimal string: the new total at that price. 0.00000000 removes the level.
order_countnull—Null. Binance does not report order counts.

REST depth snapshot

The collector fetches a REST snapshot when it connects and when it has to re-anchor the book after a sequence gap. Only snapshots the collector applied to its book are published, as one snapshot row per level.

Abridged: Requested with limit=5 to keep the example short; the collector requests limit=100.

REST responsereceived 2026-10-05 19:15:44.966619 UTC
GET https://api.binance.com/api/v3/depth?symbol=BTCUSDT&limit=5
{
"lastUpdateId": 101075699690,
"bids": [
["85667.22000000", "3.87307000"],
["85667.21000000", "0.00030000"],
["85666.80000000", "0.00008000"],
["85666.66000000", "0.00341000"],
["85665.76000000", "0.00014000"]
],
"asks": [
["85667.23000000", "5.95855000"],
["85667.24000000", "0.00042000"],
["85667.30000000", "0.00351000"],
["85667.92000000", "0.00006000"],
["85668.04000000", "0.00008000"]
]
}

Published rows · 10

received_time1791227744966619918—Our collector's clock when the REST response arrived, in nanoseconds since the Unix epoch.
event_time1791227744966—Our collector's clock when the response was decoded, in milliseconds. The spot depth endpoint returns no event time.
transaction_timenull—Null. The spot depth endpoint returns no transaction time.
symbolBTCUSDT—The symbol the collector requested.
event_typesnapshot—snapshot for every REST snapshot.
first_update_idnull—Null for snapshots.
final_update_id101075699690lastUpdateIdCopied.
prev_final_update_idnull—Null for snapshots.
last_update_id101075699690lastUpdateIdCopied. Updates with final_update_id ≤ this value are already in the snapshot. Replay from the first later update whose first_update_id ≤ this value + 1 ≤ final_update_id.
sideaskbidsasksbid for levels in bids, ask for levels in asks. One row per level.
price85667.23000000bids[][0]asks[][0]Copied as the exact decimal string.
quantity5.95855000bids[][1]asks[][1]Copied as the exact decimal string.
order_countnull—Null. Binance does not report order counts.

Notes

  • Spot updates have no pu, so prev_final_update_id is always null. Between updates, check continuity with first_update_id = previous update's final_update_id + 1. The first update after a snapshot can overlap it instead: it continues the snapshot when first_update_id ≤ snapshot last_update_id + 1 ≤ final_update_id.
  • REST snapshots hold up to 100 levels per side. Levels outside the snapshot are unknown until an update changes them.
  • Snapshot event_time is our clock, not an exchange time. Do not compare it with the exchange event_time of updates.
  • Update rows whose final_update_id equals a snapshot's lastUpdateId in the same hour are not published: the snapshot already contains them.
  • A depth update with no levels becomes one row with side noop and price and quantity 0. It carries the update IDs and does not change the book. An empty REST snapshot becomes one noop snapshot row: clear the book on it.
  • A file can start with a checkpoint: our replayed book at the hour boundary, as snapshot rows with received_time at the hour start, the event_time of the last exchange event before it, null transaction_time, and the last applied update ID in final_update_id and last_update_id. A checkpoint is written only when the book is proven current. Without one, continue from the previous hour's book or wait for the next snapshot.

Column types and descriptions: Order Book schema.

Ticker

One row per <symbol>@ticker message, about one per second per symbol.

  • WebSocket <symbol>@ticker

Rolling 24-hour statistics, not statistics of the UTC day.

WebSocket message · <symbol>@tickerreceived 2026-10-05 19:15:47.154175 UTC
{
"stream": "btcusdt@ticker",
"data": {
"e": "24hrTicker",
"E": 1791227747016,
"s": "BTCUSDT",
"p": "276.01000000",
"P": "0.323",
"w": "86032.94355095",
"x": "85391.21000000",
"c": "85667.22000000",
"Q": "0.06326000",
"b": "85667.22000000",
"B": "3.80987000",
"a": "85667.23000000",
"A": "5.98305000",
"o": "85391.21000000",
"h": "86999.11000000",
"l": "84972.01000000",
"v": "17674.90865000",
"q": "1520624418.15357380",
"O": 1791141347009,
"C": 1791227747009,
"F": 6734725364,
"L": 6738013629,
"n": 3288266
}
}

Published row

received_time1791227747154175000—Our collector's clock when the message arrived, in nanoseconds since the Unix epoch. Not sent by Binance.
event_time1791227747016data.ECopied. Milliseconds.
symbolBTCUSDTdata.sCopied.
price_change276.01000000data.pCopied.
price_change_percent0.323data.PCopied. Percent: 0.323 means +0.323 %.
weighted_average_price86032.94355095data.wCopied.
last_price85667.22000000data.cCopied.
last_quantity0.06326000data.QCopied. Base asset units.
open_price85391.21000000data.oCopied.
high_price86999.11000000data.hCopied.
low_price84972.01000000data.lCopied.
base_asset_volume17674.90865000data.vCopied. Base asset units.
quote_asset_volume1520624418.15357380data.qCopied. Quote asset units.
statistics_open_time1791141347009data.OCopied. Milliseconds.
statistics_close_time1791227747009data.CCopied. Milliseconds.
first_trade_id6734725364data.FCopied.
last_trade_id6738013629data.LCopied.
total_trades3288266data.nCopied.

Notes

  • The price of the last trade before the 24-hour window (x) and the best bid and ask (b, B, a, A) are not published.

Column types and descriptions: Ticker schema.

Not published

  • Mark Price: Spot markets have no mark price or funding rate.
  • Open Interest: Spot markets have no open interest.
  • Liquidations: Binance does not publish spot liquidations.