Bybit Spot wire format
This page shows how Bybit Spot messages become rows in our Parquet files. For each data type below, you see a real message next to the rows that we publish for it. The page also gives the source and the rule for each column. Put the pointer on a line or a column to see how they connect.
Checked against our pipeline
We recorded these messages from Bybit Spot on 2026-10-05. Our test suite replays each message through the production collector parser and the postprocessor. The test fails if the published rows are different from the rows on this page. Files that we wrote before a change to the pipeline can be different. Refer to Known Gaps & Corrections.
The collector subscribes to orderbook.50.<symbol>, publicTrade.<symbol> and tickers.<symbol> for each trading spot pair. The same code as for Bybit Futures parses and postprocesses the messages.
- Public WebSocket:
wss://stream.bybit.com/v5/public/spot - REST (trade backfill):
https://api.bybit.com
Exchange API reference: bybit-exchange.github.io. For the conventions that apply to all exchanges, refer to the wire formats overview.
Trades
One row per trade from the publicTrade.<symbol> topic. Also, one row per trade that the collector recovers through REST after a reconnect.
- WebSocket publicTrade.<symbol>
- REST GET /v5/market/recent-trade
Trade message
Bybit sends trades in batches. This message contains 2 trades, and each trade becomes a separate row.
{"topic": "publicTrade.BTCUSDT","ts": 1791227700350,→ event_time"type": "snapshot","data": [{"i": "2290000001224566789",→ trade_id"T": 1791227700349,→ trade_time"p": "85663.7",→ price"v": "0.0024",→ quantity"S": "Sell",→ is_buyer_maker"seq": 114993707179,"s": "BTCUSDT",→ symbol"BT": false,"RPI": false},{"i": "2290000001224566790",→ trade_id"T": 1791227700349,→ trade_time"p": "85663.7",→ price"v": "0.002853",→ quantity"S": "Sell",→ is_buyer_maker"seq": 114993707179,"s": "BTCUSDT",→ symbol"BT": false,"RPI": false}]}
Published rows · 2
ts, the time when Bybit generated the push. Milliseconds. All trades in the message have the same value.true if the taker side S is Sell. false if it is Buy.Market. This is a placeholder value because Bybit sends no order type.REST trade backfill
Bybit does not replay trades after a subscription. Each time a trade connection opens or opens again, the collector requests the latest trades from GET /v5/market/recent-trade. Then it publishes the trades that it did not receive through the WebSocket. If the trade_time of a backfilled trade is not in the hour of the file, we do not publish the trade.
Shortened: We requested this example with limit=1 to keep it short. The collector requests limit=60, the maximum that Bybit returns.
{"retCode": 0,"retMsg": "OK","result": {"category": "spot","list": [{"execId": "2290000001224568695",→ trade_id"symbol": "BTCUSDT",→ symbol"price": "85782.8",→ price"size": "0.005246",→ quantity"side": "Sell",→ is_buyer_maker"time": "1791227915828",→ event_time · trade_time"isBlockTrade": false,"isRPITrade": false,"seq": "114993797995"}]},"retExtInfo": {},"time": 1791227915979}
Published row
time. REST responses have no push time, thus event_time is equal to trade_time on backfilled rows. Milliseconds.true if the taker side side is Sell. false if it is Buy.Market. This is a placeholder value because Bybit sends no order type.Notes
- The rows are sorted by
trade_time, then byseq(the Bybit cross sequence), then bytrade_id. - We do not publish the block-trade flag
BT, the RPI flagRPI, the tick directionLandseq. We publish block trades and RPI trades as normal rows. - If the collector receives a trade through the WebSocket and through the REST backfill, we publish it one time, with the WebSocket values. On a backfilled row,
event_timeis equal totrade_time, andreceived_timecan be seconds after the trade. - The Bybit REST endpoint returns only the latest 60 spot trades. Thus, the collector recovers only a part of a longer reconnect gap.
For the column types and descriptions, refer to the Trades schema.
Order Book
One row per price level from the orderbook.50.<symbol> topic. We publish the levels as Bybit sent them.
- WebSocket orderbook.50.<symbol>
Order book snapshot
Bybit sends a snapshot of the 50-level order book when the subscription starts. Bybit also sends a snapshot after a problem on its side or after a service restart (u = 1). Each level becomes a snapshot row.
Shortened: Bybit sent 50 bid levels and 50 ask levels. This example shows the best three of each.
{"topic": "orderbook.50.BTCUSDT",→ symbol"ts": 1791227698276,→ event_time"type": "snapshot",→ event_type"data": {"s": "BTCUSDT","b": [→ side["85666.4", "0.134992"],→ side · price · quantity["85666.3", "0.000915"],→ side · price · quantity["85665.9", "0.006238"]→ side · price · quantity],"a": [→ side["85666.5", "0.596838"],→ side · price · quantity["85666.7", "0.024785"],→ side · price · quantity["85667.8", "0.000835"]→ side · price · quantity],"u": 311718506,→ final_update_id"seq": 114993705748→ last_update_id},"cts": 1791227698274→ transaction_time}
Published rows · 6
orderbook.50.BTCUSDT). It is equal to data.s.snapshot for type: "snapshot". This message has all levels of the 50-level order book. A message with u = 1 (Bybit service restart) is also a snapshot.u + 1.seq, the Bybit cross sequence. It gives the order of the messages, but it can skip values.bid for levels in b, ask for levels in a. One row per level.Order book delta
{"topic": "orderbook.50.BTCUSDT",→ symbol"ts": 1791227698296,→ event_time"type": "delta",→ event_type"data": {"s": "BTCUSDT","b": [→ side["85666.4", "0.139984"],→ side · price · quantity["85662.9", "0"],→ side · price · quantity["85662.2", "0.00447"]→ side · price · quantity],"a": [→ side["85668.3", "0.000111"],→ side · price · quantity["85693.8", "0.075584"],→ side · price · quantity["85694.5", "0"]→ side · price · quantity],"u": 311718507,→ first_update_id · final_update_id"seq": 114993705774→ last_update_id},"cts": 1791227698295→ transaction_time}
Published rows · 6
orderbook.50.BTCUSDT). It is equal to data.s.update for type: "delta".u. Each delta covers exactly one update ID, thus first_update_id = final_update_id.u of the previous message. A larger step is a gap.seq, the Bybit cross sequence. It gives the order of the messages, but it can skip values.bid for levels in b, ask for levels in a. One row per level.0 removes the level.Notes
- The collector subscribes only to the 50-level order book. WebSocket snapshots are the start points of this order book. Bybit REST depth snapshots have the update IDs of the 1,000-level stream. Thus, they cannot be a start point for this order book, and we do not publish them.
- Before the collector writes, it makes sure that the
uof each delta is one more than theuof the previous message. After a gap, it connects again and starts from a new WebSocket snapshot. - We publish a delta with no levels as one row with
side=noopand withpriceandquantity0. Thus, the update-ID chain has no gaps. Ignore these rows when you rebuild the order book. - A file can start with a checkpoint snapshot of the order book that continues from the previous hour. In this snapshot,
received_timeis the start of the hour andtransaction_timeis null.final_update_idis the lastuthat we applied, andlast_update_idis itsseq. - Quantities are in base asset units (BTC for BTCUSDT). Bybit does not include Retail Price Improvement (RPI) orders in the order book stream.
- Files that we wrote before the October 2026 pipeline update can also contain
snapshotrows that we made from REST depth snapshots. Their update IDs are from the Bybit 1,000-level stream and do not continue the 50-level chain. Ignore these rows when you replay the data.
For the column types and descriptions, refer to the Order Book schema.
Ticker
One row per tickers.<symbol> message.
- WebSocket tickers.<symbol>
Bybit spot tickers are always full snapshots, thus each row comes from one message.
{"topic": "tickers.BTCUSDT","ts": 1791227696127,→ event_time"type": "snapshot","cs": 114993705064,"data": {"symbol": "BTCUSDT",→ symbol"lastPrice": "85666.5",→ price_change · last_price"highPrice24h": "86996.9",→ high_price"lowPrice24h": "84978.5",→ low_price"prevPrice24h": "85386",→ price_change · open_price"volume24h": "7322.439121",→ base_asset_volume"turnover24h": "630464015.32595089",→ quote_asset_volume"price24hPcnt": "0.0033",→ price_change_percent"usdIndexPrice": "85662.421591"}}
Published row
lastPrice − prevPrice24h, calculated exactly in decimal.0.0033 becomes 0.33.prevPrice24h, the price 24 hours ago.Notes
usdIndexPriceis not published.price_change_percentis in percent since the 2026-09 data-integrity release. Earlier files contain the Bybit fraction.
For the column types and descriptions, refer to the Ticker schema.
Not published
- Mark Price: Bybit spot tickers have no mark price or funding rate.
- Open Interest: Spot markets have no open interest.
- Liquidations: Bybit's
allLiquidationtopic covers derivatives only.