Expand description
EIP-1559 fee estimation with configurable presets.
Estimates maxFeePerGas and maxPriorityFeePerGas from eth_feeHistory,
where the chosen [Eip1559FeeEstimatePreset] selects the reward percentile
used for the priority fee and the multiplier applied to the base fee.
Structsยง
- Resolved
Eip1559 Fees - The resolved EIP-1559 fees together with the base fee they were derived from.
Constantsยง
- FEE_
HISTORY_ ๐BLOCKS - The number of past blocks sampled from
eth_feeHistoryfor fee estimation. - MIN_
GAS_ ๐USED_ RATIO - Gas used ratio below which a block is treated as near-empty and its reward is dropped from sampling, so one-off tips in otherwise idle blocks do not dominate the cross-block median on low-traffic chains. Local heuristic: there is no protocol-defined utilization threshold for priority-fee estimation.
- MIN_
PRIORITY_ ๐FEE - The minimum priority fee to provide, in wei.
Functionsยง
- estimate_
eip1559_ fees - Estimates EIP-1559 fees for
providerusing the givenpreset. - estimate_
priority_ ๐fee - Estimates the priority fee as the median of the non-zero per-block rewards,
never returning less than
MIN_PRIORITY_FEE. - resolve_
broadcast_ eip1559_ fees - Applies, in order, the optional
browser_suggested_tip,with_gas_priceandpriority_gas_priceoverrides to estimated EIP-1559 fees.