Try it Live
Run FeeMarket examples in the interactive playground
EIP-1559 Base Fee Calculations
Dynamic base fee mechanism adjusting based on block gas utilization.Overview
EIP-1559 introduced a dynamic base fee that:- Targets 50% full blocks (gasLimit / 2)
- Increases up to 12.5% per block when above target
- Decreases up to 12.5% per block when below target
- Enforces minimum of 7 wei
BaseFee
parentGasUsed- Gas used in parent blockparentGasLimit- Gas limit of parent blockparentBaseFee- Base fee of parent block (wei)
getGasTarget
state- Block state with gasLimit
isAboveGasTarget
state- Block state
true if gasUsed > gasTarget
Example:
Constants
See constants.mdx#eip1559:Base Fee Dynamics
Increase Rate
Block above target by X% → base fee increases by up to X/2 * 12.5%Decrease Rate
Block below target by X% → base fee decreases by up to X/2 * 12.5%Equilibrium
Constant 50% utilization maintains stable base fee:Projecting Base Fees
See BaseFee projections:Usage Patterns
Fee Estimation
Gas Target Monitoring
Implementation
Location:/src/primitives/FeeMarket/BrandedFeeMarket/BaseFee.js
See branded-feemarket.mdx for implementation details.

