Skip to main content

Try it Live

Run FeeMarket examples in the interactive playground
Conceptual Guide - For API reference and method documentation, see FeeMarket API.
Ethereum has two independent fee markets: EIP-1559 for transaction execution (gas) and EIP-4844 for blob data availability. This guide explains how both work using Tevm.

What is EIP-1559?

EIP-1559 replaced the legacy gas price auction with a predictable base fee that adjusts based on network demand:
  • Base Fee: Minimum fee per gas, adjusted each block based on utilization
  • Priority Fee: Optional tip to validators for faster inclusion
  • Fee Burn: Base fee is burned (destroyed), reducing ETH supply

Why EIP-1559 Exists

Before EIP-1559 (Legacy):
  • Users bid gas prices in blind auction
  • Unpredictable fees (overpay or wait forever)
  • Validators keep all fees
After EIP-1559:
  • Base fee calculated algorithmically
  • Predictable costs: base_fee + priority_fee
  • Base fee burned (deflationary pressure)
  • Only tips go to validators

Base Fee Mechanics

The base fee targets 50% block utilization and adjusts ±12.5% per block:

Calculating Next Base Fee

Base Fee Adjustment Formula

The /8n factor gives 12.5% max adjustment per block.

Priority Fee (Tip)

Priority fee (tip) incentivizes validators to include your transaction:

How Effective Gas Price is Calculated

Example scenarios:

maxFeePerGas vs maxPriorityFeePerGas

Understanding the two fee parameters:

Setting Fees for Different Urgency Levels

Complete Example: Estimating Transaction Cost

Calculate total cost for a token transfer:

Handling Fee Spikes

Protect against sudden base fee increases:

EIP-4844 Blob Gas

EIP-4844 introduced a separate fee market for blob data (layer 2 data availability):

Blob Fee Mechanics

Unlike EIP-1559’s ±12.5% adjustment, blob fees use exponential pricing:

Complete Blob Transaction Example

Visual Fee Calculation

EIP-1559 Transaction Fee Breakdown

Base Fee Adjustment Visualization

Blob Gas Market Visualization

Resources

Next Steps