> ## Documentation Index
> Fetch the complete documentation index at: https://docs.allium.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Order Books

> Order book snapshots with bid and ask levels.

The `lighter_robinhood.raw.order_books` table contains order book snapshots with bid and ask levels.

## Table Columns

**Unique key:** `timestamp`, `market_id`, `nonce`

| Column Name   | Data Type          | Description                                               |
| ------------- | ------------------ | --------------------------------------------------------- |
| `market_id`   | `NUMBER(38,0)`     | Market identifier.                                        |
| `asks`        | `VARIANT`          | Array of ask levels (price, size), ordered best to worst. |
| `bids`        | `VARIANT`          | Array of bid levels (price, size), ordered best to worst. |
| `nonce`       | `NUMBER(38,0)`     | Global sequence number at snapshot time.                  |
| `begin_nonce` | `NUMBER(38,0)`     | Sequence number at the start of the batch.                |
| `offset`      | `NUMBER(38,0)`     | Per-market incrementing version counter.                  |
| `code`        | `NUMBER(38,0)`     | Response status code.                                     |
| `timestamp`   | `TIMESTAMP_NTZ(9)` | UTC timestamp of the snapshot.                            |
| `_created_at` | `TIMESTAMP_NTZ(9)` | Timestamp when the row was first recorded.                |
| `_updated_at` | `TIMESTAMP_NTZ(9)` | Timestamp when the row was last updated.                  |

### Sample Query

```sql theme={null}
SELECT
    market_id,
    timestamp,
    nonce,
    asks,
    bids
FROM lighter_robinhood.raw.order_books
WHERE timestamp >= CURRENT_DATE
ORDER BY timestamp DESC
LIMIT 100;
```
