Gas
Gas can be configured via the gas
key. This currently only supports configuring
the base fee, but there are plans to extend these offerings in the future.
Base Fee
The base fee for gas can be configured via a gas strategy. After each environment post-step, the next base fee will be derived via the configured gas strategy and the base fee will be updated accordingly. There are currently three supported gas strategies.
None
The default gas strategy none
is to use no strategy at all. This means that the
base fee will never be updated over the course of the simulation.
This strategy will also ensure that ETH is topped up per agent transaction for the
purposes of processing the transaction at the EVM layer. If any other gas strategy
is used, then the top_up_gas
function will be skipped.
Sample
The sample
gas strategy samples the new price from a log-normal distribution.
The mean of this distribution can be configured in the parameters
via mean
,
which defaults to a value of 25000000000
(in wei) if undefined. The
use_volatility
parameter can also be defined to indicate whether to reshape the
mean and standard deviation by the current volatility at each step, where a
greater volatility indicates a greater mean and standard deviation.
Scale
The scale
gas strategy keeps the base fee relatively close, if not equal, to
the base fee at the start of the simulation. The summand
parameter is a whole
number indicating the percentage by which to deviate from the original base fee,
and use_volatility
indicates whether to then use volatility as a multiplicative
factor in the new base fee. The formula is therefore:
(initial_base_fee + (initial_base_fee * summand)) * (1 + volatility)
In this case, the initial_base_fee
and summand
remain constant throughout the
simulation, while volatility
is the factor that changes with each step.
Format
name | type |
---|---|
type | { name: string, parameters: dict, } |
required | true |
Example
gas:
strategy:
name: "scale"
parameters:
summand: 0
volatility: false