L1 / top of book
Best bid and best ask only. Derive this view after replaying the L2 snapshots and deltas; ticker statistics are not a substitute for quotes.
Lighter Order Book Dataset
Lighter perpetual and spot order book events packaged for replay, latency analysis, and market microstructure research.
No credit card · The sample is one real hourly Parquet file and needs no API key
Is this the right dataset?
This landing page is for coverage, schema, sample files, and downloads. Use the SDK docs for method parameters and the reconstruction tutorial for replay logic.
Best bid and best ask only. Derive this view after replaying the L2 snapshots and deltas; ticker statistics are not a substitute for quotes.
This dataset. It records aggregate quantity at each visible price level so you can measure spread, depth, and imbalance.
Not provided. L2 cannot reveal queue position or how many individual orders make up a level unless the venue publishes an order count.
Sample
The first rows of one real hour: BTC on Lighter, 2026-09-02 at 12:00 UTC. One row per bid or ask price level in a snapshot or update.
lighter/2026-09-02/12/BTC_orderbook.parquetDownload full file| received_time | event_time | transaction_time | symbol | event_type | first_update_id | final_update_id | prev_final_update_id | last_update_id | side | price | quantity | order_count |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1788351287231700242 | 1788351287231700242 | null | BTC | snapshot | null | 953873 | null | 953873 | bid | 20000.0 | 0.10000 | null |
| 1788351287231700242 | 1788351287231700242 | null | BTC | snapshot | null | 953873 | null | 953873 | ask | 119000.0 | 0.00094 | null |
| 1788351287231700242 | 1788351287231700242 | null | BTC | snapshot | null | 953873 | null | 953873 | bid | 30000.0 | 0.05000 | null |
| 1788351287234708698 | 1788351287234708698 | null | BTC | update | null | 953880 | null | 953880 | bid | 76731.7 | 0.00521 | null |
| 1788351287234708698 | 1788351287234708698 | null | BTC | update | null | 953880 | null | 953880 | ask | 76751.6 | 0.00000 | null |
| 1788351287234708698 | 1788351287234708698 | null | BTC | update | null | 953880 | null | 953880 | bid | 76735.1 | 0.00260 | null |
Wire format
Every row starts as a message on the exchange's WebSocket or REST API. Point at a line or a column to see where each value comes from and how we convert it. Our test suite replays these messages through the production pipeline, so the rows shown are the rows you download.
Lighter (Perpetuals & Spot)
When the collector subscribes, also after each reconnect, Lighter sends the order book as subscribed/order_book. Each snapshot becomes one snapshot row per level and starts a new nonce chain.
Exchange sends
WebSocket message · order_book/<index>received 2026-10-05 19:15:04.141358 UTC
{"channel": "order_book:1","last_updated_at": 1791227703748044,"offset": 4577935,"order_book": {"code": 0,"asks": [{"price": "85635.5","size": "0.03539"},{"price": "85635.7","size": "0.01700"}],"bids": [{"price": "85635.3","size": "0.00020"},{"price": "85635.2","size": "0.00020"}],"offset": 4577935,"nonce": 23863347847,"last_updated_at": 1791227703748044,"begin_nonce": 0},"timestamp": 1791227703769,"type": "subscribed/order_book"}
Shortened: Lighter sent 1821 bid levels and 1271 ask levels in this snapshot. The example shows the best two levels of each side.
You download
Parquet row · orderbook · 1 of 4 rows from this message
Point at a line in the message or a column in the row to trace where each value comes from. Click a column to pin it.
Our tests replay this message through the production pipeline
All Lighter (Perpetuals & Spot) mapping rules →Conventions for every exchange are in the wire formats overview. Column types and units for order book data are in the schema below.
Use cases
Coverage
Every venue is stored under its own exchange ID, so spot and derivatives never mix. Bars show each venue's history from its first hourly file to today, or to its last file for a venue that is no longer collected. Symbol counts are live from the symbols API.
| Venue | Exchange ID | Market | History | Order book symbols |
|---|---|---|---|---|
| lighter | Perpetuals & Spot | 2025-12-3011 mo | 252 |
Other exchanges
The same schema on every venue, so switching exchange is a one-argument change.
Or compare every venue on the cross-exchange order book overview.
Schema · 13 columns
Every row represents one bid or ask price level inside a snapshot or incremental update. Rows carry exchange timing, sequence fields when available, price, quantity, and event type.
| Column | Type | Description |
|---|---|---|
| received_time | INT64 | Unix timestamp (nanoseconds) when our system received the event |
| event_time | INT64 | Unix timestamp when the exchange generated the event (the time unit changes with the exchange) |
| transaction_time | INT64nullable | Exchange-specific transaction timestamp (if available) |
| symbol | STRING | Trading pair symbol (for example, "BTCUSDT") |
| event_type | STRING | Type of order book event ("snapshot" or "update") |
| first_update_id | INT64nullable | First update ID in the update sequence |
| final_update_id | INT64nullable | Final update ID in the update sequence |
| prev_final_update_id | INT64nullable | Previous final update ID (to find gaps) |
| last_update_id | INT64nullable | Last update ID that the exchange processed |
| side | STRING | Order book side ("bid" or "ask") |
| price | STRING | Price level (stored as string for precision) |
| quantity | STRING | Quantity at the price level (stored as string for precision). The unit is the base asset on most venues. OKX derivatives use contracts, and BitMEX uses raw instrument units (refer to the venue notes) |
| order_count | INT64nullable | Number of orders at this price level (if the exchange gives it) |
Quickstart
The example loads BTC from Lighter for 2026-09-02. Change the symbol, exchange, or dates to pull any other slice of the archive.
pip install cryptohftdataSign up with email or Google, then generate a key from your dashboard. No credit card.
Create accountPaste the snippet, replace YOUR_API_KEY, and you get a pandas DataFrame with the columns listed above.
import cryptohftdata as chd
client = chd.CryptoHFTDataClient(api_key="YOUR_API_KEY")
df = client.get_orderbook(
symbol="BTC",
exchange=chd.exchanges.LIGHTER,
start_date="2026-09-02",
end_date="2026-09-02",
)
print(df.head())
print(f"Order book rows: {len(df):,}")curl --fail --location \
"https://api.cryptohftdata.com/download?file=lighter/2026-09-02/12/BTC_orderbook.parquet" \
-o BTC_orderbook_12.parquetCaveats
Exchange feeds differ in subtle ways. These are the details that matter for accurate backtests, replay pipelines, and features. Missing hours and pending corrections for every venue are listed on Known Gaps & Corrections.
L2 order book data is aggregated by price level, not individual L3 orders.
Files contain snapshots plus incremental updates. Build state from a complete snapshot, apply later events in stored order, and reset whenever another snapshot appears.
Sequence fields vary by venue. If available continuity IDs show a gap, discard the local book and wait for a newer snapshot rather than replaying a state you cannot verify.
Quantities are in the venue's unit: base asset on most venues, contracts on OKX derivatives (multiply by the instrument's ctVal), and raw per-instrument units on BitMEX.
Hour-start checkpoint snapshots exist for Binance, Aster, OKX, Bybit, Bitget, Lighter, Kraken Futures and Hyperliquid, not for Kraken spot or BitMEX. A checkpoint is written only when the book is proven current, so some hours start without one; continue from the previous hour's book or wait for the next snapshot.
In some periods only part of the Lighter market universe was published (for example 2026-09-22 16:02 to 2026-09-23 about 00:30 UTC). These periods cannot be recovered.
This page starts on 2025-12-30 based on the earliest stored hourly files for its covered exchange IDs and grows as new hourly files are published.
FAQ
Yes. A free CryptoHFTData account with no credit card gives API access to Lighter order book data and every other dataset. Individual hourly files can also be downloaded without an API key on the rate-limited free tier.
The earliest hourly files start on 2025-12-30, and new files are added every hour. Start dates differ by venue; the coverage table on this page lists each one.
Each file holds one symbol for one UTC hour, stored as Zstd-compressed Parquet under {exchange_id}/{YYYY-MM-DD}/{HH}/{SYMBOL}_orderbook.parquet. Parquet reads directly into pandas, Polars, DuckDB, and Arrow.
Install the SDK with pip install cryptohftdata, create a client with your API key, and call client.get_orderbook() with a symbol, exchange, and date range. It returns a pandas DataFrame.
L2. Each row is the aggregate quantity at one price level, recorded in snapshots and incremental updates. Individual orders (L3) and queue position are not included.
One free API key covers every exchange and every data type. $0.00.