> 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/function/functions/orderbook.md).

# Orderbook

## <mark style="color:purple;">`orderbook`</mark>(*symbol*: *Optional*\[*str*], *exchange*: *Optional*\[*str*|*int*]) -> \[[*<mark style="color:blue;">Orderbook</mark>*](/function/structures/orderbook.md)]

Returns orderbook in [Orderbook](/function/structures/orderbook.md) structure.

**Parameters:**

**symbol :&#x20;*****str, default 'base-counter'***

Use token symbols in the 'symbol-symbol' format. Example: <mark style="color:red;">`'ETH-USDT'`</mark>,`'`[<mark style="color:blue;">`base`</mark>](/function/shortcuts/base.md)<mark style="color:red;">`-USDT'`</mark>,<mark style="color:red;">`’ETH-`</mark>[<mark style="color:blue;">`counter`</mark>](/function/shortcuts/counter.md)<mark style="color:red;">`’`</mark>. If <mark style="color:red;">`symbol`</mark> is empty - uses current symbol for bot. Shortcuts [`base`](/function/shortcuts/base.md) and [`counter`](/function/shortcuts/counter.md) could be used.

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

If <mark style="color:red;">`symbol`</mark> is empty - uses current symbol for bot. (ex.: <mark style="color:red;">`'ETH-USDT'`</mark>, [<mark style="color:blue;">`base`</mark>](/function/shortcuts/base.md)<mark style="color:red;">`-USDT`</mark>,<mark style="color:red;">`’ETH-`</mark>[<mark style="color:blue;">`counter`</mark>](/function/shortcuts/counter.md)<mark style="color:red;">`’`</mark>)

If <mark style="color:red;">`exchange`</mark> is empty - uses current exchange for bot’s account

{% hint style="warning" %} <mark style="color:red;">`symbol`</mark> must be specified for usage in <mark style="color:red;">`update_balance_formula`</mark> inside group
{% endhint %}

{% hint style="warning" %} <mark style="color:red;">`exchange`</mark> must be specified for usage in <mark style="color:red;">`update_balance_formula`</mark> inside group
{% endhint %}

<details>

<summary>Example:</summary>

<mark style="color:red;">`orderbook().bid[0].price`</mark> → 0.65…

<mark style="color:red;">`orderbook('`</mark>[<mark style="color:blue;">`base`</mark>](/function/shortcuts/base.md)<mark style="color:red;">`-`</mark>[<mark style="color:blue;">`counter`</mark>](/function/shortcuts/counter.md)<mark style="color:red;">`').bid[0].price`</mark> → 0.65…

<mark style="color:red;">`orderbook().bid[0].amount`</mark> → 300.51

<mark style="color:red;">`orderbook(’`</mark>[<mark style="color:blue;">`base`</mark>](/function/shortcuts/base.md)<mark style="color:red;">`-`</mark>[<mark style="color:blue;">`counter`</mark>](/function/shortcuts/counter.md)<mark style="color:red;">`’,'mexc').bid[0].amount`</mark> → 300.51

<mark style="color:red;">`orderbook(’ETH-USDT’).bid[0].amount`</mark> → 3000

<mark style="color:red;">`orderbook('BTC-ETH', exchange='gateio').bid[0].amount`</mark> → 300.51

<mark style="color:red;">`orderbook(exchange=8).ask[0].amount`</mark> → 300.51

<mark style="color:red;">`orderbook(exchange='mexc').ask[0].amount`</mark> → 100.23

</details>
