# 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: 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:

```
GET https://docs.avantisfi.com/trading/trading-fees-fixed-fee-perpetuals/keeper-fees.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
