> For the complete documentation index, see [llms.txt](https://docs.ees.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ees.xyz/fee-modules/peggedlinearauction.md).

# PeggedLinearAuction

The `PeggedLinearAuction` fee module builds upon the same core ideas of [`LinearAuction`](/fee-modules/linearauction.md) but utilizes [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) and [EIP-3198](https://eips.ethereum.org/EIPS/eip-3198) to peg the execution fee to the current base fee. This fee module calculates the total gas cost of the execution, multiplies it with `block.basefee`  and uses a price oracle to convert the amount in ETH to the amount of the user specified execution fee token. During the execution window, `PeggedLinearAuction` performs a reverse dutch auction similarly to `LinearAuction` but over the percentage overhead from the calculated base fee in execution fee tokens. The overhead is represented in basis points (bps), such that 10000 bps corresponds to 100%.

<figure><img src="/files/mwexYADrK36DDPeA5Dqr" alt="" width="563"><figcaption><p>Abstract chart of execution fee function.</p></figcaption></figure>

The overhead basis points as a function of time within execution mode is calculated as follows:

$$
overhead(t) = \frac{(maxBps  - minBps) }{executionWindow - 1} \cdot (t - executionTime) + minBps
$$

The fee function is then:

$$
fee(t) = \frac{overhead(t)}{10000} \cdot baseFee\_{feeToken}
$$

The input bytes to the `onCreateJob` function should follow the structure:

```solidity
address executionFeeToken;
uint48 minOverheadBps;
uint48 maxOverheadBps;
IPriceOracle priceOracle;
bytes memory oracleData;
```

`priceOracle` is a contract implementing `IPriceOracle` which will provide price data of the token. `oracleData` is arbitrary data which can be used by the price oracle.

{% hint style="info" %}
**Note:** Price oracles have the purpose of finding the price of the execution fee token in terms of ETH.
{% endhint %}

{% hint style="warning" %}
**Warning:** `PeggedLinearAuction`is only deployed on EVM chains supporting EIP-1559 and EIP-3198.
{% endhint %}


---

# 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.ees.xyz/fee-modules/peggedlinearauction.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.
