# Saved Balance

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

Returns structure that can be used to obtain balance of tokens saved at the moment when <mark style="color:red;">`update_balance_formula`</mark> returns <mark style="color:red;">`True`</mark> or any other non-zero value

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

<mark style="color:red;">`coin`</mark> check \[<mark style="color:red;">`balance`</mark>] specification

**Important:** can’t be used in <mark style="color:red;">`update_balance_formula`</mark> inside group

<details>

<summary>Example:</summary>

<mark style="color:red;">`saved_balance('ETH').available`</mark> → 100.2

<mark style="color:red;">`saved_balance('base').reserved`</mark> → 200.3

<mark style="color:red;">`saved_balance(’counter’).total`</mark> → 300.5

<mark style="color:red;">`saved_balance('USDT').total`</mark> → 400.55

</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/saved-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.
