> For the complete documentation index, see [llms.txt](https://docs.origami.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.origami.tech/reference/grid-language/functions/orderbook.md).

# orderbook()

orderbook() returns the current order book for a pair and exchange, with bids and asks in the Orderbook structure.

An order book is a comprehensive record maintained by a trading platform, documenting the buy and sell orders that reflect the interests of market participants.

## `orderbook`(*symbol*: *Optional*\[*str*], *exchange*: *Optional*\[*str*|*int*]) -> \[*Orderbook*]

Returns orderbook in Orderbook structure.

**Parameters:**

\*\*symbol : \*\****str, default 'base-counter'***

Use token symbols in the 'symbol-symbol' format. Example: `'ETH-USDT'`,`'base-USDT'`,`’ETH-counter’`. If `symbol` is empty - uses current symbol for bot. Shortcuts `base` and `counter` could be used.

**exchange : int|str, default bot's exchange**

If `symbol` is empty - uses current symbol for bot. (ex.: `'ETH-USDT'`, `base-USDT`,`’ETH-counter’`)

If `exchange` is empty - uses current exchange for bot’s account

{% hint style="warning" %}
\`symbol\` must be specified for usage in \`update\_balance\_formula\` inside group
{% endhint %}

{% hint style="warning" %}
\`exchange\` must be specified for usage in \`update\_balance\_formula\` inside group
{% endhint %}

<details>

<summary>Example:</summary>

`orderbook().bid[0].price` → 0.65…

`orderbook('base-counter').bid[0].price` → 0.65…

`orderbook().bid[0].amount` → 300.51

`orderbook(’base-counter’,'mexc').bid[0].amount` → 300.51

`orderbook(’ETH-USDT’).bid[0].amount` → 3000

`orderbook('BTC-ETH', exchange='gateio').bid[0].amount` → 300.51

`orderbook(exchange=8).ask[0].amount` → 300.51

`orderbook(exchange='mexc').ask[0].amount` → 100.23

</details>
