TheDocumentation Index
Fetch the complete documentation index at: https://docs.allium.so/llms.txt
Use this file to discover all available pages before exploring further.
hyperliquid.raw.orderbook_snapshots table contains point-in-time snapshots of every resting order on the Hyperliquid order book. New snapshots arrive approximately every 15 minutes; each snapshot is one row per resting order at that moment. The same order will appear in successive snapshots until it is filled or canceled, so you can observe how an individual order’s size, trigger conditions, or status evolve over time.
Table Columns
| Column Name | Description |
|---|---|
| snapshot_id | UUID identifying a single snapshot. All rows from the same snapshot share this value. Use it to scope a query to one complete book at one point in time. |
| snapshot_timestamp | UTC timestamp of the snapshot. Constant across all rows of the same snapshot_id. |
| max_order_timestamp | The latest order_timestamp represented in the snapshot. Useful as a “what’s new” cutoff when combining the snapshot with later orders. Identical for every row in a snapshot. |
| user | The address of the user who placed the order. |
| coin | A unique identifier for the asset being traded: • The coin for perpetuals is the standard token symbol, e.g. HYPE • The coin for spot tokens is an ID representing a pair of tokens based on Hyperliquid’s metadata, e.g. @4 represents token 5/token 0, which corresponds to JEFF/USDC. The metadata is available from the info endpoint of Hyperliquid’s API. |
| side | B - Buy ・ A - Ask (Sell) |
| limit_price | The maximum price the buyer or seller is willing to pay. |
| size | The current size of the order. If the order has been partially filled since it was placed, this is the size of the unfilled remainder. |
| original_size | The size of the order when it was first placed. If the order has not been partially filled, size equals original_size. |
| order_id | Order ID generated by Hyperliquid (also referred to as oid). Note: order_id is not unique on its own — Hyperliquid reuses the oid space across markets. Use (snapshot_id, coin, order_timestamp, order_id) to identify a unique row. |
| order_timestamp | The time the order was originally placed on Hyperliquid. Unlike snapshot_timestamp, this can be hours or days before the snapshot. |
| order_type | The type of order. Refer to the Hyperliquid Docs. |
| time_in_force | Behaviour for the order. Refer to the Hyperliquid Docs. |
| trigger_condition | What will make this order become active and go into the order book. For example Price below 1560.1. The value can also be Triggered, meaning the trigger condition has already been met. |
| is_trigger | Boolean. Whether this order has a trigger condition (see trigger_condition). |
| trigger_price | The price at which the trigger fires, if is_trigger is true. |
| is_position_tpsl | Boolean. Whether this order is a take profit or stop loss order. |
| is_reduce_only | Boolean. Whether this order reduces the current position, instead of opening a new order in the opposite direction. Refer to the Hyperliquid Docs. |
| client_order_id | Custom order ID provided by the user (also referred to as cloid). Nullable. |
| children | JSON variant. Will contain one or two orders that will be added once the parent order is triggered (typically a take profit and/or stop loss). |
Notes
Identifying a unique row
Because the same order persists across snapshots and Hyperliquid reuses the oid space across markets, the minimum unique grain is:order_id alone is not unique — the same numeric oid may appear for different orders on different coins.
Snapshot grouping
All rows that share asnapshot_id belong to the same book at one moment. To get the most recent complete book for a coin:
Tracking a single order over time
Because the same order appears in multiple snapshots until it is filled or canceled, you can observe its evolution:Freshness via max_order_timestamp
max_order_timestamp is the latest order placement time represented in a snapshot. The gap between snapshot_timestamp and max_order_timestamp is useful for detecting stale or thinly-populated books:
Reconstructing a fresher book from hyperliquid.raw.orders and hyperliquid.raw.fills
New snapshots arrive approximately every 15 minutes, so the latest one can be up to ~15 minutes behind real time. To bring it forward, combine three sources:
| What changed since the snapshot | Source table | How to apply |
|---|---|---|
| Orders removed from the book (filled, canceled, liquidated, rejected, etc.) | hyperliquid.raw.orders | Drop the order from the reconstructed book if its latest status_change_timestamp > snapshot_timestamp and the resulting status is terminal. |
| Orders added to the book after the snapshot | hyperliquid.raw.orders | Include any order whose latest status is non-terminal and whose order_timestamp > max_order_timestamp. |
| Orders partially filled since the snapshot (still resting, but with reduced size) | hyperliquid.raw.fills | For each surviving order, subtract the sum of fill sizes with timestamp > snapshot_timestamp from the snapshot’s size. A partial fill on Hyperliquid does not change order status — the order keeps resting with a smaller size, so it would never appear in the orders table change stream. |
max_order_timestamp is the useful lower bound for the “what’s new” filter: any order placed at or before it is already represented in the snapshot, so the orders lookup only needs to consider placements after that point.
Terminal vs non-terminal statuses
hyperliquid.raw.orders records every status change for every order. To decide whether an order is still resting, take its latest status (by status_change_timestamp) and check whether that status is terminal. Refer to the Hyperliquid order-status reference for the full taxonomy; broadly:
- Terminal (order leaves the book):
Filled,Canceled,MarginCanceled,Liquidated,SelfTradeCanceled,ReduceOnlyCanceled,VaultWithdrawalCanceled,OpenInterestCapCanceled,DelistedCanceled,SiblingFilledCanceled,ScheduledCancel, and the various*Rejectedstatuses. - Non-terminal (order still resting):
Open,Triggered, and trigger-condition modifications.
SQL sketch
The
terminal_statuses list above is illustrative — keep it in lockstep with the Hyperliquid order-status reference. Missing a status will keep terminated orders in the reconstructed book; over-listing one will drop orders that should still rest.Query tips
- For efficient date-range queries, filter on
snapshot_timestamp::date.