# Balance

## <mark style="color:purple;">`balance`</mark>(*coin*: *str*, *account\_id*: *Optional*\[*int*]) -> \[[*<mark style="color:blue;">Balance</mark>*](/function/structures/balance.md)]

Parametrs:

coin: {‘base’, ‘counter’, token ticker}

<mark style="color:red;">`coin`</mark> \[shortcuts] can’t be used in <mark style="color:red;">`update_balance_formula`</mark> inside group

account\_id: int, default current bot account id

<mark style="color:red;">`account_id`</mark> should be specified for usage in <mark style="color:red;">`update_balance_formula`</mark> inside group

Returns:

Returns structure that can be used to obtain balance of tokens on the account

<details>

<summary>Example:</summary>

<mark style="color:red;">`balance('USDT').available`</mark> → 1000.2

<mark style="color:red;">`balance('ETH').reserved`</mark> → 20.3

<mark style="color:red;">`balance(’BTC’).total`</mark> → 1.5

<mark style="color:red;">`balance(’counter’).reserved`</mark> → 6.55

<mark style="color:red;">`balance('base').total`</mark> → 300.5

<mark style="color:red;">`balance('base', account_id=100).total`</mark> → 10

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.origami.tech/function/functions/balance.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
