> 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

## 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="/pages/vBJtwkBbxgLdMwiqplZq"><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="/pages/dp1E7DG3xZkkJKzKPBGY"><mark style="color:blue;"><code>orderbook</code></mark></a></h3></td><td>Orderbook from the market in the <a href="/pages/AVpLEudbWCHaLDLJPF0o"><mark style="color:blue;">Orderbook</mark></a> structure.</td></tr><tr><td><h3><a href="/pages/vc72nw3PaD2xKgGGD5wg"><mark style="color:blue;"><code>candles</code></mark></a></h3></td><td>Market candlesticks in the <a href="/pages/Xvc8UiJyVJn1I8gx8cUT"><mark style="color:blue;">Candle</mark></a> structure.</td></tr><tr><td><h3><a href="/pages/xVgpRCM2UzuJUTIzLKgF"><mark style="color:blue;"><code>own</code></mark></a></h3></td><td>Self orders in the <a href="/pages/AVpLEudbWCHaLDLJPF0o"><mark style="color:blue;">Orderbook</mark></a> structure.</td></tr><tr><td><h3><a href="/pages/vuks4i6s7eQJfS9NxEsm"><mark style="color:blue;"><code>vwap</code></mark></a></h3></td><td>Calculates the volume-weighted average.</td></tr><tr><td><h3><a href="/pages/rgg8QEJLqSGTfUK4mrq9"><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="/pages/5NgRRsQ242yuYRHVvrUB"><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="/pages/CEZal44BXH80x44GrEyJ"><mark style="color:blue;"><code>symbol</code></mark></a></h3></td><td>Exchange information in <a href="/pages/sUiJgz3vLYeR8qReYyDq">Symbol</a> structure.</td></tr><tr><td><h3><a href="/pages/o3gbsYcTdx2z4rIMcITI"><mark style="color:blue;"><code>balance</code></mark></a></h3></td><td>Token balance of certain exchange in <a href="/pages/mNaQxvV1ODnFvuGZpUuf">Balance</a> structure.</td></tr><tr><td><h3><a href="/pages/UgDb5FgjkhbcmGvvWP8J"><mark style="color:blue;"><code>saved_balance</code></mark></a></h3></td><td>Saved token balance of certain exchange in <a href="/pages/mNaQxvV1ODnFvuGZpUuf">Balance</a> structure.</td></tr><tr><td><h3><a href="/pages/VubzB1QaDDuU7zwwaNk5"><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="/pages/qGCniJ0oiSNXH59lDfoN">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="/pages/ADE1v2zZEp1K8H8Io5hM"><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="/pages/tB9b6H9V120z1QJlVL2v"><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="/pages/tciNnhsKiwLMxZJgZhvy"><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="/pages/UzA7uxr0ruhygx6HYdyE"><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="/pages/WXDWL6i2xJUG9Snl57TZ"><mark style="color:blue;"><code>exp</code></mark></a></h3></td><td>Calculates the exponent value.</td></tr><tr><td><h3><a href="/pages/vHuwIHANnLkoml1mW9YD"><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="/pages/kOlZOlCyD07M0GWsEzIn"><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="/pages/gXQmEZS62Ao7THKspt3d"><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="/pages/rXnZXSCQQWihGYVhdevB"><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="/pages/36Kv4zzhSB1hDf2nkZ5w"><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="/pages/axPY13eyhaOaHJU8vdPG"><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="/pages/O0buPabcaamf2h47LXSm"><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="/pages/BKIGcxFm9yvxldltnEmc"><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="/pages/ACurTfzTynxjF4tna1ow"><mark style="color:blue;"><code>var</code></mark></a></h3></td><td></td></tr></tbody></table>
