> 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/saved-balance.md).

# saved\_balance()

saved\_balance() returns a token balance saved at the moment update\_balance\_formula returned true.

Learn how to use the Saved Balance function in Origami Tech to reference previously stored account balances in automated trading strateg

## `saved_balance`(*coin*: *str*, *account\_id*: *Optional*\[*int*]) -> \[*Balance*]

Returns structure that can be used to obtain balance of tokens saved at the moment when `update_balance_formula` returns `True` or any other non-zero value

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

`coin` check \[`balance`] specification

**Important:** can’t be used in `update_balance_formula` inside group

<details>

<summary>Example:</summary>

`saved_balance('ETH').available` → 100.2

`saved_balance('base').reserved` → 200.3

`saved_balance(’counter’).total` → 300.5

`saved_balance('USDT').total` → 400.55

</details>
