> For the complete documentation index, see [llms.txt](https://docs.lighter.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lighter.xyz/api/orders/orderbookorders.md).

# orderBookOrders

Get the best resting orders of an order book. With `n_sig_figs`, the response also returns `group_size` and up to 20 aggregated price levels per side in `ask_levels` and `bid_levels`. Levels are built from the whole order book, independent of `limit`; ask prices round up to a multiple of `group_size` and bid prices round down.

```json
{"openapi":"3.0.0","info":{"title":"Lighter API","version":"1.0.0"},"tags":[{"name":"orders"}],"servers":[{"url":"https://mainnet.zklighter.elliot.ai","description":"Lighter mainnet"},{"url":"https://api.testnet.lighter.xyz","description":"Lighter testnet"},{"url":"https://api.rh.lighter.xyz","description":"Lighter on Robinhood Chain mainnet"},{"url":"https://api.rh-testnet.lighter.xyz","description":"Lighter on Robinhood Chain testnet"}],"paths":{"/api/v1/orderBookOrders":{"get":{"summary":"orderBookOrders","operationId":"orderBookOrders","tags":["orders"],"description":"Get the best resting orders of an order book. With `n_sig_figs`, the response also returns `group_size` and up to 20 aggregated price levels per side in `ask_levels` and `bid_levels`. Levels are built from the whole order book, independent of `limit`; ask prices round up to a multiple of `group_size` and bid prices round down.","parameters":[{"name":"market_id","in":"query","required":true,"schema":{"type":"integer","format":"int16"},"description":"Public market identifier returned by orderBooks or events."},{"name":"limit","in":"query","required":true,"schema":{"type":"integer","format":"int64","minimum":1,"maximum":250},"description":"Maximum number of orders to return per side in `asks` and `bids`. Does not apply to `ask_levels` and `bid_levels`."},{"name":"n_sig_figs","in":"query","required":false,"schema":{"type":"integer","format":"uint8","minimum":2,"maximum":6},"description":"Number of significant figures of the mid price to group prices by. Example: with BTC at 63,920.0, `4` groups by 10.0 and `5` by 1.0. The group size is at least one price tick."},{"name":"mantissa","in":"query","required":false,"schema":{"type":"integer","format":"uint8","enum":[1,2,5],"default":1},"description":"Multiplier of the group size. Only allowed when `n_sig_figs` is 5 or 6."}],"responses":{"200":{"description":"A successful response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderBookOrders"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResultCode"}}}}}}}},"components":{"schemas":{"OrderBookOrders":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"},"total_asks":{"type":"integer","format":"int64"},"asks":{"type":"array","items":{"$ref":"#/components/schemas/SimpleOrder"}},"total_bids":{"type":"integer","format":"int64"},"bids":{"type":"array","items":{"$ref":"#/components/schemas/SimpleOrder"}},"group_size":{"type":"string","description":"Price width of each level. Only returned when `n_sig_figs` is set; empty if the order book is empty."},"ask_levels":{"type":"array","items":{"$ref":"#/components/schemas/OrderBookLevel"},"description":"Up to 20 aggregated ask levels, lowest price first. Only returned when `n_sig_figs` is set."},"bid_levels":{"type":"array","items":{"$ref":"#/components/schemas/OrderBookLevel"},"description":"Up to 20 aggregated bid levels, highest price first. Only returned when `n_sig_figs` is set."}},"title":"OrderBookOrders","required":["code","total_asks","asks","total_bids","bids"]},"SimpleOrder":{"type":"object","properties":{"order_index":{"type":"integer","format":"int64"},"order_id":{"type":"string"},"owner_account_index":{"type":"integer","format":"int64"},"initial_base_amount":{"type":"string"},"remaining_base_amount":{"type":"string"},"price":{"type":"string"},"order_expiry":{"type":"integer","format":"int64"},"transaction_time":{"type":"integer","format":"int64","description":"Transaction execution time in Unix microseconds."}},"title":"SimpleOrder","required":["order_index","order_id","owner_account_index","initial_base_amount","remaining_base_amount","price","order_expiry","transaction_time"]},"OrderBookLevel":{"type":"object","properties":{"price":{"type":"string","description":"Level price: a multiple of `group_size`. Asks are rounded up to it, bids down."},"size":{"type":"string","description":"Total remaining base amount of all resting orders in the level."},"orders":{"type":"integer","format":"int64","description":"Number of resting orders in the level."}},"title":"OrderBookLevel","required":["price","size","orders"]},"ResultCode":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}},"title":"ResultCode","required":["code"]}}}}
```


---

# 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.lighter.xyz/api/orders/orderbookorders.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.
