> ## 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.

# Orders

> Raw Hyperliquid orders data

The `hyperliquid.raw.orders` table contains raw order data for Hyperliquid (spot and perp). To resolve spot `coin` to a pair (e.g. HYPE/USDC), join to `hyperliquid.raw.spot_coin_pairs` on `coin = name`.

## Table Columns

| Column Name                      | Description                                                                                                                                                                                                                                                                                                                                                             |
| :------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| client\_order\_id                | Custom order ID provided by the user                                                                                                                                                                                                                                                                                                                                    |
| order\_id                        | Order ID generated by Hyperliquid                                                                                                                                                                                                                                                                                                                                       |
| 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 (coin) represents token 5/token 0, which corresponds to JEFF/USDC  The metadata is available from the info endpoint of Hyperliquid's API |
| is\_take\_profit\_or\_stop\_loss | Boolean  Whether this order is a take profit or stop loss order                                                                                                                                                                                                                                                                                                         |
| is\_trigger                      | Boolean  Whether this order has a trigger condition. For instance the order is only in effect if the price goes above 25.  See Notes for more details.                                                                                                                                                                                                                  |
| type                             | The type of order. Refer to the [Hyperliquid Docs](https://hyperliquid.gitbook.io/hyperliquid-docs/trading/order-types#order-types)                                                                                                                                                                                                                                     |
| original\_size                   | The size of the original order  For example if the order size has since changed since it was partially filled, then the `original_size` will show a different value                                                                                                                                                                                                     |
| is\_reduce\_order                | Whether this order reduces the current position, instead of opening a new order in the opposite direction.  Refer to the [Hyperliquid Docs](https://hyperliquid.gitbook.io/hyperliquid-docs/trading/order-types#order-options)                                                                                                                                          |
| side                             | B - Buy  A - Ask (Sell)                                                                                                                                                                                                                                                                                                                                                 |
| size                             | Order size. This is the current order size. So if partially filled, this will be the size of the unfilled part                                                                                                                                                                                                                                                          |
| time\_in\_force                  | Behaviour for the order.  Refer to the [Hyperliquid Docs](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order)                                                                                                                                                                                                          |
| order\_timestamp                 | This refers to the original order timestamp. See original\_size.  So depending on when the order status changes, this can be quite different from `status_change_timestamp`.                                                                                                                                                                                            |
| trigger\_condition               | What will make this order become active, go into the order book.  For example 'Price below 1560.1'  The value can also be 'Triggered' which means the trigger condition has already been met and the order is in active in the order book.  For an example see  `SELECT * from hyperliquid.raw.orders where order_id = '44776647532';`                                  |
| trigger\_price                   | The price for it to be triggered, if it is a trigger. See `is_trigger`  Will match the value in `trigger_condition`                                                                                                                                                                                                                                                     |
| limit\_price                     | Maximum price the buyer or seller are willing to pay                                                                                                                                                                                                                                                                                                                    |
| children                         | Children will contain one or two orders, which will be added once the parent order is triggered. These can be a take profit and/or a stop loss.  For examples see  `SELECT * from hyperliquid.raw.orders where order_id = '82039428821' or order_id = '82161896540' or order_id = '82182749399';`                                                                       |
| status                           | The status which the order has after the order\_status\_change\_timestamp. Refer to the [Hyperliquid Docs](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-order-status-by-oid-or-cloid) for a list of all possible statuses.  Currently we do not have the initial status `Open`  refer to the Notes                            |
| user                             | user that owns the order                                                                                                                                                                                                                                                                                                                                                |
| status\_change\_timestamp        | The time at which the status of this order changed. Basically represents the time at which the entries in this row took effect                                                                                                                                                                                                                                          |
| unique\_id                       | A unique identifier for each record                                                                                                                                                                                                                                                                                                                                     |
