PeggedLinearAuction

The PeggedLinearAuction fee module builds upon the same core ideas of LinearAuction but utilizes EIP-1559 and 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%.

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

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

The fee function is then:

fee(t)=overhead(t)10000baseFeefeeTokenfee(t) = \frac{overhead(t)}{10000} \cdot baseFee_{feeToken}

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

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.

Note: Price oracles have the purpose of finding the price of the execution fee token in terms of ETH.

Warning: PeggedLinearAuctionis only deployed on EVM chains supporting EIP-1559 and EIP-3198.

Last updated