EffectiveGasPrice
EIP-1559 effective gas price representing the actual gas price paid for a transaction. Calculated from base fee and effective priority fee, capped by maxFeePerGas.Overview
Branded bigint type representing effective price in Wei. Determines actual transaction cost:cost = effectiveGasPrice * gasUsed.
Quick Start
Type Definition
API
Construction
from(value)
Create from bigint, number, or hex string.
calculate(baseFee, maxFee, maxPriorityFee)
Calculate from EIP-1559 fee parameters.
fromGwei(gwei)
Create from Gwei value.
fromWei(wei)
Create from Wei value (alias for from).
Conversion
toGwei(effectivePrice)
Convert to Gwei.
toWei(effectivePrice)
Convert to Wei (identity).
toNumber(effectivePrice)
Convert to number. Warning: precision loss on large values.
toBigInt(effectivePrice)
Convert to bigint (identity).
Comparison
equals(price1, price2)
Check equality.
compare(price1, price2)
Compare values. Returns -1, 0, or 1.
Calculation Formula
Calculation Examples
Within Budget
Priority Fee Capped
Zero Priority Fee
MaxFee Equal to BaseFee
Real-world Examples
Transaction Cost
Receipt Verification
Refund Calculation
Fee Breakdown
Miner vs Burned
Historical Analysis
Track Effective Prices
Compare Networks
Fee Estimation
Predict Effective Price
Common Patterns
Validate Transaction
Cost Comparison
Related Types
- BaseFeePerGas - Network base fee (burned)
- MaxFeePerGas - Maximum total fee cap
- MaxPriorityFeePerGas - Maximum tip to miner
Specification
- EIP-1559: Fee market change for ETH 1.0 chain
- Formula:
effectiveGasPrice = baseFee + min(priorityFee, maxFee - baseFee) - Returned in transaction receipts as
effectiveGasPrice - Transaction cost:
effectiveGasPrice * gasUsed

