Skip to main content

Try it Live

Run FeeMarket examples in the interactive playground

FeeMarket

Type-safe Ethereum fee market calculations for EIP-1559 and EIP-4844.
New to Ethereum fee markets? Start with Fundamentals to learn about base fees, priority fees, and blob gas pricing.

Overview

FeeMarket provides complete fee calculation and projection for Ethereum’s two fee markets:
  • EIP-1559: Dynamic base fee adjusting based on block utilization (gas)
  • EIP-4844: Exponential blob fee pricing for data availability (blobs)

Quick Start

API Methods

State Management

  • State Types - Complete block fee market state and next state calculations

EIP-1559 (Base Fees)

EIP-4844 (Blob Fees)

Transaction Fees

Projections

Validation

Constants

EIP-1559

See constants.mdx#eip1559

EIP-4844

See constants.mdx#eip4844

Types

Core Types

Transaction Types

Learning Resources

  • Fundamentals - Fee market mechanics, base fee adjustment, priority fees, blob gas
  • usage-patterns.mdx - Common patterns for fee estimation and transaction cost calculation

BrandedFeeMarket

See branded-feemarket.mdx for tree-shakable namespace functions.

WASM Support

Pure TypeScript implementation is optimal for FeeMarket. See wasm.mdx for details.

Performance

  • BaseFee: ~4M ops/sec
  • BlobBaseFee: ~100K ops/sec
  • calculateTxFee: ~20M ops/sec
  • nextState: ~2M ops/sec
  • projectBaseFees: ~1M ops/sec per block
See FeeMarket.bench.ts for detailed benchmarks.

References