> For the complete documentation index, see [llms.txt](https://docs.avantisfi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avantisfi.com/trading/trading-fees-fixed-fee-perpetuals/keeper-fees.md).

# Keeper Fees

#### **Dynamic Gas Fee Module** <a href="#the-benefits-of-the-dynamic-gas-fee-module" id="the-benefits-of-the-dynamic-gas-fee-module"></a>

Keepers are bots that pick up transactions sent by users via the Avantis smart contract, and execute them on chain. For this, an execution fee is paid to the keeper upon opening or closing a trade. These fees are directly paid to the blockchain by the keeper, and not to the Avantis smart contract.

In order to ensure fairness for both the keeper (whether this is a keeper run by Avantis or the community) and the trader, we calculate keeper fees dynamically every time a user places a trade or closes it. This ensures:

1. Keepers are not covering the gas cost of a transaction personally.&#x20;
2. The trader is not overpaying for gas.&#x20;

<div align="left"><figure><img src="/files/SHOV2BJNEGCwGVSb5CWP" alt="" width="375"><figcaption><p>An example of Keeper fees on Avantis while opening a trade</p></figcaption></figure></div>

#### Keeper Fee in Action <a href="#the-benefits-of-the-dynamic-gas-fee-module" id="the-benefits-of-the-dynamic-gas-fee-module"></a>

The below screenshot should be a helpful explanation on keeper fees for opening a trade. As you can see below, the "Estimated fee" is the gas fee (42 cents) of including a user's txn to the L2 (in our case, this L2 is Base). As a part of this txn, the user sends the keeper fee (81 cents in this case) to the keeper bot who then executes this transaction as a second step.

n![](/files/Kdffh0oxqqRQumEMAbya)


---

# 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.avantisfi.com/trading/trading-fees-fixed-fee-perpetuals/keeper-fees.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.
