> 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.md).

# Functions

Functions that can be called inside the grid parameters.

## Market Data

<table data-header-hidden data-full-width="true"><thead><tr><th width="342">Function</th><th>Description</th></tr></thead><tbody><tr><td><h3><a href="/function/functions/ticker.md"><mark style="color:blue;"><code>ticker</code></mark></a></h3></td><td>The current market price of the latest traid on the market.</td></tr><tr><td><h3><a href="/function/functions/orderbook.md"><mark style="color:blue;"><code>orderbook</code></mark></a></h3></td><td>Orderbook from the market in the <a href="/function/structures/orderbook.md"><mark style="color:blue;">Orderbook</mark></a> structure.</td></tr><tr><td><h3><a href="/function/functions/candles.md"><mark style="color:blue;"><code>candles</code></mark></a></h3></td><td>Market candlesticks in the <a href="/function/structures/candle.md"><mark style="color:blue;">Candle</mark></a> structure.</td></tr><tr><td><h3><a href="/function/functions/own.md"><mark style="color:blue;"><code>own</code></mark></a></h3></td><td>Self orders in the <a href="/function/structures/orderbook.md"><mark style="color:blue;">Orderbook</mark></a> structure.</td></tr><tr><td><h3><a href="/function/functions/vwap.md"><mark style="color:blue;"><code>vwap</code></mark></a></h3></td><td>Calculates the volume-weighted average.</td></tr><tr><td><h3><a href="/function/functions/amount-before-price.md"><mark style="color:blue;"><code>amount_before_price</code></mark></a></h3></td><td>The amount of basic tokens up to a certain price.</td></tr><tr><td><h3><a href="/function/functions/amount-threshold-index.md"><mark style="color:blue;"><code>amount_threshold_index</code></mark></a></h3></td><td></td></tr></tbody></table>

***

## Balances and Exchange info

<table data-header-hidden data-full-width="true"><thead><tr><th width="240">Function</th><th>Description</th></tr></thead><tbody><tr><td><h3><a href="/function/functions/symbol.md"><mark style="color:blue;"><code>symbol</code></mark></a></h3></td><td>Exchange information in <a href="/function/structures/symbol.md">Symbol</a> structure.</td></tr><tr><td><h3><a href="/function/functions/balance.md"><mark style="color:blue;"><code>balance</code></mark></a></h3></td><td>Token balance of certain exchange in <a href="/function/structures/balance.md">Balance</a> structure.</td></tr><tr><td><h3><a href="/function/functions/saved-balance.md"><mark style="color:blue;"><code>saved_balance</code></mark></a></h3></td><td>Saved token balance of certain exchange in <a href="/function/structures/balance.md">Balance</a> structure.</td></tr><tr><td><h3><a href="/function/functions/group-balance.md"><mark style="color:blue;"><code>group_balance</code></mark></a></h3></td><td>The sum of the token balances from all exchanges in the group in <a href="/function/structures/groupbalance.md">Group Balace</a> structure.</td></tr></tbody></table>

***

## Calculations

<table data-header-hidden data-full-width="true"><thead><tr><th width="252">Function</th><th>Description</th></tr></thead><tbody><tr><td><h3><a href="/function/functions/mean.md"><mark style="color:blue;"><code>mean</code></mark></a></h3></td><td>Compute the arithmetic mean (average) of the given list elements.</td></tr><tr><td><h3><a href="/function/functions/median.md"><mark style="color:blue;"><code>median</code></mark></a></h3></td><td>Compute the median of the given list elements.</td></tr><tr><td><h3><a href="/function/functions/max.md"><mark style="color:blue;"><code>max</code></mark></a></h3></td><td>Returns max value of the given list elements.</td></tr><tr><td><h3><a href="/function/functions/min.md"><mark style="color:blue;"><code>min</code></mark></a></h3></td><td>Returns min value of the given list elements.</td></tr><tr><td><h3><a href="/function/functions/exp.md"><mark style="color:blue;"><code>exp</code></mark></a></h3></td><td>Calculates the exponent value.</td></tr><tr><td><h3><a href="/function/functions/abs.md"><mark style="color:blue;"><code>abs</code></mark></a></h3></td><td>Returns the absolute value of the given number.</td></tr><tr><td><h3><a href="/function/functions/logn.md"><mark style="color:blue;"><code>logn</code></mark></a></h3></td><td>Calculates the value of the natural logarithm.</td></tr><tr><td><h3><a href="/function/functions/count.md"><mark style="color:blue;"><code>count</code></mark></a></h3></td><td>Returns the number of the given list elements.</td></tr><tr><td><h3><a href="/function/functions/random.md"><mark style="color:blue;"><code>random</code></mark></a></h3></td><td>Random decimal value in range [0, 1].</td></tr><tr><td><h3><a href="/function/functions/sum.md"><mark style="color:blue;"><code>sum</code></mark></a></h3></td><td>Sum of the given list elements.</td></tr></tbody></table>

***

## Other

<table data-header-hidden data-full-width="true"><thead><tr><th width="254">Function</th><th>Description</th></tr></thead><tbody><tr><td><h3><a href="/function/functions/cached.md"><mark style="color:blue;"><code>cached</code></mark></a></h3></td><td>Used to cache the results of calculating the cached_value formula for the ttl time in seconds.</td></tr><tr><td><h3><a href="/function/functions/remove-nan.md"><mark style="color:blue;"><code>remove_nan</code></mark></a></h3></td><td>Drop decimal(Nan) of the given list elements.</td></tr><tr><td><h3><a href="/function/functions/is-nan.md"><mark style="color:blue;"><code>is_nan</code></mark></a></h3></td><td>True if input Nan and False if input not Nan.</td></tr><tr><td><h3><a href="/function/functions/var.md"><mark style="color:blue;"><code>var</code></mark></a></h3></td><td></td></tr></tbody></table>
