> 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/required-parameters/execute-volume.md).

# Execute Volume

## <mark style="color:purple;">`execute_volume`</mark> \[*decimal* | *formula* -> \[*decimal*]]

Volume (amount) value for each order in grid, denominated in the base token. It accepts both integer and decimal inputs and allows the use of formulas as values.

It must be borne in mind that when the quantity in the volume parameter changes and in the absence of the [<mark style="color:blue;">`sleep_after_seconds`</mark>](/function/optional-parameters/sleep-after-seconds.md) parameter, the grid will immediately re-place orders on the exchange, which leads to an increase in the load on the communication channel with the exchange. For correct operation, it is advisable to use the [<mark style="color:blue;">`sleep_after_seconds`</mark>](/function/optional-parameters/sleep-after-seconds.md) parameter and the [<mark style="color:blue;">`cached`</mark>](/function/functions/cached.md) function.

It is mandatory to use the [<mark style="color:blue;">`cached`</mark>](/function/functions/cached.md) function or the [<mark style="color:blue;">`sleep_after_seconds`</mark>](/function/optional-parameters/sleep-after-seconds.md) parameter when using the [<mark style="color:blue;">`random`</mark>](/function/functions/random.md) function.

{% hint style="danger" %}
Always positive value. Can’t be zero.
{% endhint %}

{% hint style="info" %}
Supports the use of the iterable parameter [`order_pos`](/function/pre-defined-parameters/order-pos.md) to facilitate the placement of multiple orders.
{% endhint %}

{% hint style="info" %}
It is possible to use the [<mark style="color:blue;">`execute_price`</mark>](/function/required-parameters/execute-price.md) parameter, which also supports the use of [<mark style="color:blue;">`order_pos`</mark>](/function/pre-defined-parameters/order-pos.md).
{% endhint %}

<details>

<summary>Example:</summary>

The order of 2345.95 amount will be placed in the base token.

<mark style="color:red;">`"execute_volume": "2345.95"`</mark>

***

The order will be executed in the amount of 10 divided by the market price of the base token. For example, if the counter token is USDT, then this is equivalent to placing an order of 10 USDT denominated in the base token.

<mark style="color:red;">`"execute_volume": "10 /`</mark> [<mark style="color:blue;">`ticker`</mark>](/function/functions/ticker.md)<mark style="color:red;">`()"`</mark>

```
10 / ticker()
```

***

The order will be executed in the amount of 100 plus 10 multiplied by the sequence number of the order in the grid, divided by the price of the base token. For example, if the counter token is USDT, then this is equivalent to placing an order of 100 USDT plus 10 USDT multiplied by the ordinal number of the order in the grid, denominated in the base token.

<mark style="color:red;">`"execute_volume": "(100 + 10 *`</mark> [<mark style="color:blue;">`abs`</mark>](/function/functions/abs.md)<mark style="color:red;">`(`</mark>[<mark style="color:blue;">`order_pos`</mark>](/function/pre-defined-parameters/order-pos.md)<mark style="color:red;">`)) /`</mark> [<mark style="color:blue;">`execute_price`</mark>](/function/required-parameters/execute-price.md)<mark style="color:red;">`"`</mark>

```
(100 + 10 * abs(order_pos)) / execute_price
```

***

The order will be executed in an amount equal to the size of the first market bid, but not exceeding 100 divided by the price of the executed order. This means that if the counter token is USDT, the order amount will be capped at a value equivalent to 100 USDT, denominated in the base token.

<mark style="color:red;">`"execute_volume": "`</mark>[<mark style="color:blue;">`min`</mark>](/function/functions/min.md)<mark style="color:red;">`(`</mark>[<mark style="color:blue;">`orderbook`</mark>](/function/functions/orderbook.md)<mark style="color:red;">`().bid[0].amount,100/`</mark>[<mark style="color:blue;">`execute_price`</mark>](/function/required-parameters/execute-price.md)<mark style="color:red;">`)"`</mark>

```
min(orderbook().bid[0].amount,100/execute_price)
```

***

The order will be executed in an amount equal to the total of all orders up to and including the first own ask order in the market.

<mark style="color:red;">`"execute_volume": "sum([ask.amount if ask.price <=`</mark> [<mark style="color:blue;">`own`</mark>](/function/functions/own.md)<mark style="color:red;">`().ask[0].price else 0 for ask in`</mark>  [<mark style="color:blue;">`orderbook`</mark>](/function/functions/orderbook.md)<mark style="color:red;">`().ask])"`</mark>

```
sum([ask.amount if ask.price <= own().ask[0].price else 0 for ask in orderbook().ask])
```

***

The order will be executed in the amount of 10% of the current available ETH balance, but not more than 0.2.

<mark style="color:red;">`"execute_volume": "`</mark>[<mark style="color:blue;">`min`</mark>](/function/functions/min.md)<mark style="color:red;">`(`</mark>[<mark style="color:blue;">`balance`</mark>](/function/functions/balance.md)<mark style="color:red;">`('ETH').available * 0.1, 0.2)"`</mark>

```
min(balance('ETH').available * 0.1,0.2)
```

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.origami.tech/function/required-parameters/execute-volume.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
