How gas works on Ethereum
Every EVM operation has a fixed gas cost — a storage write costs 20,000 gas, a SLOAD costs 2,100, an ADD costs 3. Your transaction’s total gas is the sum of these operations. You specify a gas limit (max gas you’re willing to use) and a gas price (what you’ll pay per gas unit).
Since EIP-1559 (August 2021), the pricing model has two components:
- Base fee — algorithmically set by the protocol based on block fullness. The base fee is burned (removed from circulation permanently).
- Priority fee (tip) — the user’s tip to validators for including the transaction quickly. Paid to the validator.
Fee = gas_used × (base_fee + priority_fee). At 15 gwei base + 2 gwei priority, a 150k-gas swap costs 150,000 × 17 × 10^-9 = 0.00255 ETH ≈ $7.65 at ETH = $3,000.
Gas across chains
| Chain | Typical transfer fee | Typical DEX swap |
|---|---|---|
| Ethereum L1 | $1-3 calm / $30+ congested | $5-20 calm / $100+ congested |
| Arbitrum | $0.05-0.20 | $0.20-0.60 |
| Base | $0.01-0.05 | $0.05-0.30 |
| Optimism | $0.02-0.10 | $0.10-0.40 |
| zkSync Era | $0.05-0.20 | $0.15-0.50 |
| Polygon | $0.01-0.05 | $0.05-0.20 |
| Solana | $0.0001-0.001 | $0.001-0.005 |
Ethereum L1 fees dominate crypto narratives because high gas is what drove most L2 adoption. Post-EIP-4844 blob pricing (March 2024), L2 fees dropped 5-10x.
When gas matters
- Small transactions — a $50 swap with $5 gas is 10% friction; the same fee on $5,000 is 0.1%.
- Congestion events — NFT mints, token launches, and market flushes can drive Ethereum gas to 200+ gwei briefly. Waiting 15-30 minutes during peaks often drops fees by 5-10x.
- Complex operations — looping DeFi positions across multiple protocols can easily burn 1M+ gas in a single transaction. Worth batching carefully.
Risks and considerations
- Failed transactions still cost gas — if your transaction reverts (slippage exceeded, revert in a smart contract), you pay the gas to the point of failure. DEX slippage-tolerance errors are the most common cause of failed transaction fees.
- Gas spikes during stress — liquidation cascades, NFT hype, or network congestion can push fees 10-20x typical. If you’re repaying a loan to avoid liquidation and gas spikes, you may not be able to act in time.
- L2 sequencer outage — if an L2 sequencer is down, you can force-include via L1 — which incurs L1 gas, so your “cheap L2 transaction” suddenly costs mainnet rates.
Gas trackers (Etherscan’s gas tracker, Blocknative, ultrasound.money) give live estimates. For routine activity, use L2s or wait for off-peak hours; for critical operations, pay the peak-fee premium to ensure prompt inclusion.