> For the complete documentation index, see [llms.txt](https://docs.tardis.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tardis.dev/faq/order-books.md).

# Order Books

Common questions about order book depth, snapshots and reconstruction

## Using order book data

### What L2 order book data can be used for?

L2 data (market-by-price) includes bid and ask orders aggregated by price level and can be used to analyze among other things:

* order book imbalance
* average execution cost
* average liquidity away from midpoint
* average spread
* hidden interest (i.e., iceberg orders)

We provide L2 data in [CSV format as incremental order book L2 updates](/downloadable-csv-files/data-types.md#incremental_book_l2), [tick-level order book snapshots](/downloadable-csv-files/data-types.md#book_snapshot_25) (top 25 and top 5 levels) and in [exchange-native](/faq/data.md#what-is-a-difference-between-exchange-native-and-normalized-data-format) format via [API and client libraries that can perform full order book reconstruction](/api/quickstart.md) client-side.

### What L3 order book data can be used for?

L3 data (market-by-order) includes every order book order addition, update, cancellation and match and can be used to analyze among other things:

* order resting time
* order fill probability
* order queue dynamics

Historical L3 data is currently available via API for [Bitfinex](/historical-data-details/bitfinex.md), [Bitfinex Derivatives](/historical-data-details/bitfinex-derivatives.md), [Coinbase Exchange](/historical-data-details/coinbase.md), [Bitstamp](/historical-data-details/bitstamp.md) and [Blockchain.com](/historical-data-details/blockchain-com.md), and for the delisted [Serum](/historical-data-details/serum.md), [Mango Markets](/historical-data-details/mango.md) and [Star Atlas](/historical-data-details/star-atlas.md) DEXs - remaining supported exchanges provide [L2 data](#what-l2-order-book-data-can-be-used-for) only.

### What is the maximum order book depth available for each supported exchange?

We always collect full depth order book data as long as exchange's WebSocket API supports it. Table below shows current state of affairs for each supported exchange.

| exchange                                                                         | order book depth                                                                                                                                    | order book updates frequency                               |
| -------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| [Binance USDS-M Futures](/historical-data-details/binance-futures.md)            | top 1000 levels initial order book snapshot, full depth incremental order book updates                                                              | real-time, dynamically adjusted                            |
| [Binance COIN Futures](/historical-data-details/binance-delivery.md)             | top 1000 levels initial order book snapshot, full depth incremental order book updates                                                              | real-time, dynamically adjusted                            |
| [Binance Spot](/historical-data-details/binance.md)                              | top 1000 levels initial order book snapshot, full depth incremental order book updates                                                              | 100ms                                                      |
| [Binance US](/historical-data-details/binance-us.md)                             | top 1000 levels initial order book snapshot, full depth incremental order book updates                                                              | 100ms                                                      |
| [Binance European Options](/historical-data-details/binance-european-options.md) | top 20 levels order book snapshots since 2025-12-17; top 100 levels before                                                                          | 100ms                                                      |
| [OKX Futures](/historical-data-details/okex-futures.md)                          | top 400 levels initial order book snapshot and updates                                                                                              | 100ms since 2026-05-21; tick-by-tick before                |
| [OKX Swap](/historical-data-details/okex-swap.md)                                | top 400 levels initial order book snapshot and updates                                                                                              | 100ms since 2026-05-21; tick-by-tick before                |
| [OKX Options](/historical-data-details/okex-options.md)                          | top 400 levels initial order book snapshot and updates                                                                                              | 100ms since 2026-05-21; tick-by-tick before                |
| [OKX Spot](/historical-data-details/okex.md)                                     | top 400 levels initial order book snapshot and updates                                                                                              | 100ms since 2026-05-21; tick-by-tick before                |
| [OKX Nitro Spreads](/historical-data-details/okex-spreads.md)                    | top 5 levels order book snapshots (`sprd-books5`)                                                                                                   | 100ms                                                      |
| [Coinbase Exchange](/historical-data-details/coinbase.md)                        | full order book depth snapshot and updates                                                                                                          | real-time                                                  |
| [Coinbase Derivatives](/historical-data-details/coinbase-derivatives.md)         | full order book depth snapshot and updates                                                                                                          | real-time                                                  |
| [Coinbase International](/historical-data-details/coinbase-international.md)     | order book snapshots and deltas                                                                                                                     | real-time                                                  |
| [BitMEX](/historical-data-details/bitmex.md)                                     | full order book depth snapshot and updates                                                                                                          | real-time                                                  |
| [Deribit](/historical-data-details/deribit.md)                                   | full order book depth snapshot and updates                                                                                                          | 1ms since 2026-08-11, real-time before                     |
| [Bybit Derivatives](/historical-data-details/bybit.md)                           | full depth snapshots and updates since 2026-08-19; top 1000 levels from 2025-09-04, top 500 from 2023-04-05, top 200 from 2019-12-23, top 25 before | 200ms since 2025-09-04; 100ms from 2019-12-23; 20ms before |
| [Bybit Spot](/historical-data-details/bybit-spot.md)                             | full depth snapshots and updates since 2026-10-07; top 200 levels from 2025-02-24, top 50 from 2023-04-05; order book snapshots and deltas before   | 200ms since 2025-02-24; 20ms from 2023-04-05; 100ms before |
| [Bybit Options](/historical-data-details/bybit-options.md)                       | top 100 levels and top 25 levels snapshots and updates                                                                                              | 100ms (top 100), 20ms (top 25)                             |
| [Bybit Spread](/historical-data-details/bybit-spread.md)                         | top 25 levels snapshots and updates                                                                                                                 | 20ms                                                       |
| [Kraken Futures](/historical-data-details/cryptofacilities.md)                   | full order book depth snapshot and updates                                                                                                          | real-time                                                  |
| [Kraken](/historical-data-details/kraken.md)                                     | top 1000 levels initial order book snapshot and updates                                                                                             | real-time                                                  |
| [Bitfinex Derivatives](/historical-data-details/bitfinex-derivatives.md)         | top 250 levels initial order book snapshot and updates (top 100 until March 2021)                                                                   | real-time                                                  |
| [Bitfinex](/historical-data-details/bitfinex.md)                                 | top 250 levels initial order book snapshot and updates (top 100 until March 2021)                                                                   | real-time                                                  |
| [KuCoin Futures](/historical-data-details/kucoin-futures.md)                     | generated Level 2 order book snapshots plus Level 2 deltas                                                                                          | real-time                                                  |
| [KuCoin Spot](/historical-data-details/kucoin.md)                                | generated Level 2 order book snapshots plus Level 2 deltas                                                                                          | real-time                                                  |
| [Aster Futures](/historical-data-details/aster-futures.md)                       | top 1000 levels generated REST snapshot plus full depth incremental updates                                                                         | real-time, dynamically adjusted                            |
| [Aster Spot](/historical-data-details/aster.md)                                  | top 1000 levels generated REST snapshot plus full depth incremental updates                                                                         | real-time, dynamically adjusted                            |
| [MEXC Spot](/historical-data-details/mexc.md)                                    | generated REST depth snapshots up to 5000 levels plus incremental updates                                                                           | 10ms                                                       |
| [MEXC Futures](/historical-data-details/mexc-futures.md)                         | generated REST depth snapshots up to 5000 levels plus incremental updates                                                                           | 200ms                                                      |
| [Crypto.com](/historical-data-details/crypto-com.md)                             | order book snapshots and updates                                                                                                                    | real-time (5s heartbeat when unchanged)                    |
| [Bitstamp](/historical-data-details/bitstamp.md)                                 | full order book depth snapshot and updates                                                                                                          | real-time                                                  |
| [Bitvavo](/historical-data-details/bitvavo.md)                                   | top 1000 levels initial order book snapshot and updates                                                                                             | real-time                                                  |
| [Bitget Futures](/historical-data-details/bitget-futures.md)                     | full depth order book snapshots and updates from 2026-04-28; top 15 snapshots before                                                                | 50ms                                                       |
| [Bitget Spot](/historical-data-details/bitget.md)                                | full depth order book snapshots and updates from 2026-04-28; top 15 snapshots before                                                                | 50ms                                                       |
| [Gate.io Futures](/historical-data-details/gate-io-futures.md)                   | 400 levels (100 for delivery) snapshots and updates from 2026-10-21; top 20 snapshots before                                                        | 100ms                                                      |
| [Gate.io](/historical-data-details/gate-io.md)                                   | 400 levels snapshots and updates since 2025-08-01; incremental updates with REST snapshots from 2023-04-29; top 30 snapshots and updates before     | 100ms since 2023-04-29; real-time before                   |
| [HTX Coin-M Futures](/historical-data-details/huobi-dm.md)                       | top 150 levels initial order book snapshot and updates                                                                                              | 30ms                                                       |
| [HTX Coin-M Perpetual](/historical-data-details/huobi-dm-swap.md)                | top 150 levels initial order book snapshot and updates                                                                                              | 30ms                                                       |
| [HTX USDT-M Contracts](/historical-data-details/huobi-dm-linear-swap.md)         | top 150 levels initial order book snapshot and updates                                                                                              | 30ms                                                       |
| [HTX Spot](/historical-data-details/huobi.md)                                    | top 400 levels initial order book snapshot and updates (top 150 before 2021-08-26)                                                                  | 100ms                                                      |
| [Gemini](/historical-data-details/gemini.md)                                     | full order book depth snapshot and updates                                                                                                          | v2 real-time; v3 100ms since 2026-07-24                    |
| [WOO X](/historical-data-details/woo-x.md)                                       | top 50 levels REST snapshot plus incremental updates since 2026-06-29; WebSocket-requested snapshot plus incremental updates before                 | 50ms since 2026-06-29; 200ms before                        |
| [Upbit](/historical-data-details/upbit.md)                                       | top 30 levels snapshots from 2025-05-07; top 15 levels snapshots before                                                                             | real-time                                                  |
| [Bithumb](/historical-data-details/bithumb.md)                                   | top 15 levels snapshots                                                                                                                             | real-time                                                  |
| [Phemex](/historical-data-details/phemex.md)                                     | top 30 levels initial order book snapshot and updates                                                                                               | 20ms                                                       |
| [Delta Exchange](/historical-data-details/delta.md)                              | order book snapshots and incremental updates                                                                                                        | real-time                                                  |
| [AscendEX (BitMax)](/historical-data-details/ascendex.md)                        | order book snapshots followed by real-time deltas                                                                                                   | real-time                                                  |
| [Blockchain.com](/historical-data-details/blockchain-com.md)                     | Level 2 order book snapshots and deltas                                                                                                             | real-time                                                  |
| [Bitnomial](/historical-data-details/bitnomial.md)                               | order book snapshots plus price level updates                                                                                                       | real-time                                                  |
| [bitFlyer](/historical-data-details/bitflyer.md)                                 | full order book depth snapshot and updates                                                                                                          | real-time                                                  |
| [HitBTC (high caps)](/historical-data-details/hitbtc.md)                         | full order book depth snapshot and updates                                                                                                          | real-time                                                  |
| [Poloniex](/historical-data-details/poloniex.md)                                 | full order book depth snapshot and updates                                                                                                          | real-time                                                  |
| [Hyperliquid](/historical-data-details/hyperliquid.md)                           | top 20 levels snapshots (`l2Book`); top 5 levels snapshots (`fastBook`) since 2026-06-17                                                            | around 5s (`l2Book`), around 500ms (`fastBook`)            |
| [Lighter](/historical-data-details/lighter.md)                                   | order book snapshots and incremental updates                                                                                                        | 50ms                                                       |
| [Lighter RH](/historical-data-details/lighter-rh.md)                             | order book snapshots and incremental updates                                                                                                        | 50ms                                                       |
| [Polymarket](/historical-data-details/polymarket.md)                             | full order book snapshots plus price level updates                                                                                                  | real-time                                                  |
| [Bullish](/historical-data-details/bullish.md)                                   | Level 2 order book snapshots and updates                                                                                                            | real-time                                                  |
| [dYdX v4](/historical-data-details/dydx-v4.md)                                   | order book snapshots and incremental updates                                                                                                        | real-time                                                  |
| [FTX](/historical-data-details/ftx.md)                                           | top 100 levels initial order book snapshot and updates                                                                                              | real-time                                                  |
| [FTX US](/historical-data-details/ftx-us.md)                                     | top 100 levels initial order book snapshot and updates                                                                                              | real-time                                                  |
| [OKCoin](/historical-data-details/okcoin.md)                                     | top 400 levels initial order book snapshot and updates                                                                                              | real-time                                                  |
| [dYdX](/historical-data-details/dydx.md)                                         | full order book depth snapshot and updates                                                                                                          | real-time                                                  |
| [Binance DEX](/historical-data-details/binance-dex.md)                           | top 1000 levels initial order book snapshot, full depth incremental order book updates                                                              | 100ms                                                      |
| [Binance Jersey](/historical-data-details/binance-jersey.md)                     | generated full order book snapshot plus incremental updates                                                                                         | 100ms                                                      |
| [CoinFLEX (2.0)](/historical-data-details/coinflex.md)                           | order book snapshots and updates                                                                                                                    | real-time                                                  |
| [HTX Options](/historical-data-details/huobi-dm-options.md)                      | order book snapshots and incremental updates                                                                                                        | 30ms                                                       |
| [Mango Markets DEX](/historical-data-details/mango.md)                           | Level 2 order book snapshots and incremental updates                                                                                                | real-time                                                  |
| [Serum DEX](/historical-data-details/serum.md)                                   | Level 2 order book snapshots and incremental updates                                                                                                | real-time                                                  |
| [Star Atlas DEX](/historical-data-details/star-atlas.md)                         | Level 2 order book snapshots and incremental updates                                                                                                | real-time                                                  |

## Snapshots and reconstruction

### How are order book data snapshots provided?

Historical market data available via [HTTP API](/api/http-api-reference.md#data-feeds-exchange) provides order book snapshots at the beginning of each day (`00:00 UTC`) and after each WebSocket reconnect - [see details](/historical-data-details.md#collected-order-book-data-details).

We also provide order book snapshots computed from this data: at any interval from tick-by-tick to minutes or hours via [client libs](/api/quickstart.md), computed client-side from raw data provided via HTTP API, and as tick-level [book\_snapshot\_25](/downloadable-csv-files/data-types.md#book_snapshot_25) and [book\_snapshot\_5](/downloadable-csv-files/data-types.md#book_snapshot_5) [downloadable CSV files](/downloadable-csv-files/overview.md).

### Do you collect order books as snapshots or in streaming mode?

Order books are collected in streaming mode - snapshot at the beginning of each day and then incremental updates, except on exchanges that publish only snapshots, such as Upbit and Hyperliquid. [See details](/historical-data-details.md#collected-order-book-data-details).

We also provide order book snapshots computed from this data: at any interval from tick-by-tick to minutes or hours via [client libs](/api/quickstart.md), computed client-side from raw data provided via HTTP API, and as tick-level [book\_snapshot\_25](/downloadable-csv-files/data-types.md#book_snapshot_25) and [book\_snapshot\_5](/downloadable-csv-files/data-types.md#book_snapshot_5) [downloadable CSV files](/downloadable-csv-files/overview.md).

### How is the incremental\_book\_L2 CSV dataset built from real-time data?

Cryptocurrency exchanges' real-time APIs vary a lot, but for [L2 order book data](#what-l2-order-book-data-can-be-used-for) they all tend to follow a similar flow: first, when a WS connection is established and subscription is confirmed, exchanges send an initial order book snapshot (all existing price levels or top `x` levels depending on exchange; for exchanges that don't send one, such as Binance, we fetch it from their REST API), and then start streaming order book update messages (often called deltas). Those updates, when applied to the initial snapshot, result in an up-to-date order book state at a given time.

{% hint style="info" %}
We provide initial L2 snapshots in the `incremental_book_L2` dataset at the beginning of each day (00:00 UTC, [more details](/historical-data-details.md#collected-order-book-data-details)), and also after every WebSocket reconnect, [see details](/faq/data.md#how-frequently-do-exchanges-drop-websocket-connections).
{% endhint %}

{% hint style="info" %}
Snapshot rows (`is_snapshot=true`) may contain price levels outside the nominal top-N depth advertised by the exchange (e.g., beyond top 1000 for Binance). This is because snapshots combine the exchange-provided snapshot with any incremental updates buffered during connection setup. Consumers should always reset their local order book state when encountering a new snapshot batch, regardless of depth.
{% endhint %}

Let's take FTX as an example and start with its snapshot order book message (which is frequently called 'partial' in exchange API docs as well).

Remaining bids and asks levels were removed from this sample message for the sake of clarity.

```javascript
{
  "channel": "orderbook",
  "market": "ETH/USD",
  "type": "partial",
  "data": {
    "time": 1601510401.2166328,
    "checksum": 204980439,
    "bids": [
      [
        359.72,
        121.259
      ]
    ],
    "asks": [
      [
        359.8,
        8.101
      ]
    ],
    "action": "partial"
  }
}
```

Such snapshot message maps to the following rows in CSV file:

| exchange | symbol  | timestamp        | local\_timestamp | is\_snapshot | side | price  | amount  |
| -------- | ------- | ---------------- | ---------------- | ------------ | ---- | ------ | ------- |
| ftx      | ETH/USD | 1601510401216632 | 1601510401316432 | true         | ask  | 359.8  | 8.101   |
| ftx      | ETH/USD | 1601510401216632 | 1601510401316432 | true         | bid  | 359.72 | 121.259 |

... and here's a sample FTX orderbook update message.

```javascript
{
  "channel": "orderbook",
  "market": "ETH/USD",
  "type": "update",
  "data": {
    "time": 1601510427.1840546,
    "checksum": 1377242400,
    "bids": [],
    "asks": [
      [
        360.24,
        4.962
      ],
      [
        361.02,
        0
      ]
    ],
    "action": "update"
  }
}
```

Let's see how it maps to CSV format.

| exchange | symbol  | timestamp        | local\_timestamp | is\_snapshot | side | price  | amount |
| -------- | ------- | ---------------- | ---------------- | ------------ | ---- | ------ | ------ |
| ftx      | ETH/USD | 1601510427184054 | 1601510427204046 | false        | ask  | 360.24 | 4.962  |
| ftx      | ETH/USD | 1601510427184054 | 1601510427204046 | false        | ask  | 361.02 | 0      |

See [this answer](#how-can-i-reconstruct-full-order-book-state-from-incremental_book_l2-csv-dataset) if you have doubts how to reconstruct order book state based on data provided in `incremental_book_L2` dataset.

### How can I reconstruct full order book state from incremental\_book\_L2 CSV dataset?

{% hint style="info" %}
See also [how incremental\_book\_l2 CSV dataset is built from real-time data](#how-is-the-incremental_book_l2-csv-dataset-built-from-real-time-data).
{% endhint %}

In order to reconstruct full order book state correctly from [`incremental_book_L2`](/downloadable-csv-files/data-types.md#incremental_book_l2) data:

* Rows before the first snapshot in the file should be skipped — they are buffered updates received before the exchange sent the initial snapshot after a connection restart.
* For each row in the CSV file (iterate in the same order as provided in file):
  * only if the local timestamp of the current row is larger than the previous row local timestamp (`local_timestamp` column value) does it mean you can read your local order book state as consistent. Why? CSV format is flat where each row represents a single price level update, but most exchanges' real-time feeds publish multiple order book level updates via a single WebSocket message that need to be processed together before reading locally maintained order book state. We use local timestamp value here to detect all price level updates belonging to a single 'update' message.
  * if current row is a part of the snapshot (`is_snapshot` column value set to `true`) and previous one was not, or previous one was a part of a different snapshot (different `local_timestamp`), reset your local order book state object that tracks price levels for each order book side as it means that there was a connection restart and exchange provided full order book snapshot, it was a start of a new day (a new snapshot arrives shortly after 00:00 UTC) or the exchange publishes only snapshots (such as Upbit, Bithumb and Hyperliquid) and each one replaces the previous one
  * if current row amount **is** set to zero (`amount` column value set to `0`) remove such price level (row's `price` column) from your local order book state as such price level does not exist anymore
  * if current row amount **is not** set to zero update your local order book state price level with new value or add new price level if not exist yet in your local order book state - maintain separately bids and asks order book sides (`side` column value)

Alternatively, we also provide [top 25 and top 5 levels](/downloadable-csv-files/data-types.md#book_snapshot_25) order book snapshots as CSV datasets ready to download.

### Can order book snapshots be empty?

Yes. For very illiquid instruments (e.g., deep out-of-the-money options or niche currency pairs) order book snapshots can be present but empty — containing no bid or ask levels. This is not a data gap; it reflects the actual state of the order book on the exchange at that time. Subsequent snapshots after reconnects may also be empty if the instrument remains illiquid.

### Can reconstructed order books have bid-ask overlap?

Although it should never happen in theory, in practice due to various crypto exchanges bugs and peculiarities it can happen (very occasionally), see some posts from users reporting those issues:

* <https://www.reddit.com/r/BitMEX/comments/8lbj9e/bidask_ledger_weirdness/>
* <https://www.reddit.com/r/KrakenSupport/comments/emu7xc/websocket_bid_sometimes_not_being_deletedupdated/>
* <https://www.reddit.com/r/KrakenSupport/comments/d1a4nx/websocket_orderbook_receiving_wrong_bid_price_for/>
* <https://twitter.com/coinarb/status/931260529993170944>

We do track sequence numbers of WebSocket L2 order book messages when collecting the data and restart connection when sequence gap is detected for exchanges that do provide those numbers. We observe that even in scenario when sequence numbers are in check, bid/ask overlap can occur.

When such scenario occurs, exchanges tend to 'forget' to publish delete messages for the opposite side of the book when publishing new level for given side - we validated that hypothesis by comparing reconstructed order book snapshots that had crossed order book (bid/ask overlap) for which we removed order book levels for the opposite side manually (as exchange didn't publish that 'delete'), with quote/ticker feeds if best bid/ask matches (for exchanges that provide those) - see [sample code that implements that manual level removal logic](https://github.com/tardis-dev/tardis-node/blob/master/src/orderbook.ts#L73).

If you encounter a crossed book during reconstruction, the recommended approach is to remove overlapping levels from the opposite side. Additionally, crossed states are always resolved by the next snapshot reset (either at 00:00 UTC daily resubscription or after a WebSocket reconnect).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.tardis.dev/faq/order-books.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
