Why every transaction costs what it costs — and what you can actually do about it.
Gas is a unit of computational work. Not a currency. Not a fee in itself. Every operation the Ethereum Virtual Machine executes — adding two numbers, reading from storage, writing to state — costs a fixed number of gas units. Sending ETH from one address to another requires exactly 21,000 gas. Always. No variance.
What varies is the price you pay per unit of gas, denominated in gwei (one gwei = 10⁻⁹ ETH). Your actual cost is the product of two things: gas used × gas price. If you send ETH when gas is 20 gwei, you pay 21,000 × 20 × 10⁻⁹ ETH = 0.00042 ETH. If gas is 100 gwei, that same transfer costs 0.0021 ETH.
Operations scale with complexity. A simple ETH transfer burns 21,000 gas. A token swap on a DEX typically uses 100,000 to 300,000 gas, depending on how many internal calls the contract makes. A complex DeFi operation — routing through multiple liquidity pools, checking oracle prices, updating positions — can exceed 1,000,000 gas. Every instruction the EVM executes has a cost defined in the Yellow Paper.
This distinction matters because gas is not a market for transactions — it is a market for computation. You are paying for CPU cycles on a decentralized computer. The analogy to cloud compute pricing is not accidental.
Before August 2021, Ethereum used a first-price auction. You named your gas price, miners picked the highest bids, and during congestion you were forced into a guessing game: bid too low and your transaction sat in the mempool indefinitely; bid too high and you overpaid massively.
EIP-1559, activated in the London hard fork, replaced this with an algorithmic mechanism. Every block now has a base fee — the minimum price any transaction in that block must pay. This base fee is not paid to validators; it is burned, removing ETH from circulation permanently. You also pay an optional priority fee (the "tip") directly to the validator who includes your transaction.
The base fee adjusts every block based on how full the previous block was. Target block size is 15 million gas. If a block is fuller than 50% target, the next block's base fee increases by up to 12.5%. If it is below target, base fee decreases. This creates a predictable, responsive pricing signal — and it killed the wild overbidding wars of the pre-London era.
In practice, you set a maxFeePerGas (the most you are willing to pay per gas unit in total) and a maxPriorityFeePerGas (your tip to the validator). You pay base fee + tip, but never more than your maxFeePerGas. Any difference between your max and the actual cost is refunded.
Gas price follows demand. When more people want block space simultaneously, the base fee climbs. These are the most common causes:
Gas prices are not random noise. They track global human activity — specifically, when traders in North America, Europe, and Asia are awake and transacting simultaneously.
The cheapest windows are structurally predictable: weekend nights UTC, and particularly Sunday mornings before US East Coast wakes up. Between roughly 00:00 and 08:00 UTC on weekends, average mainnet gas is 30-60% lower than weekday afternoon peaks.
The data below reflects averaged ETH mainnet base fees over 90 days. Each cell represents one hour-of-week. Darker orange means more expensive. The cheapest hours — consistently — are Sunday 02:00–07:00 UTC.
Ethereum mainnet is deliberately constrained. Block space is scarce by design — that scarcity is what makes it secure and decentralized. Layer 2 networks solve the cost problem by moving execution off mainnet while inheriting its security.
Optimistic rollups (Arbitrum, Optimism) batch hundreds of transactions together and post compressed data to mainnet. They assume transactions are valid unless challenged. ZK-rollups (Base uses a ZK stack; zkSync, StarkNet) use cryptographic validity proofs to verify batches without re-executing them on mainnet.
The cost difference is stark. A token swap on Ethereum mainnet at 30 gwei costs roughly $2–8 depending on ETH price. The identical operation on Arbitrum or Base costs $0.01–0.05. The reason: you are sharing mainnet calldata costs across thousands of bundled transactions.
EIP-4844, activated in March 2024 in the Dencun upgrade, introduced blob transactions — a new transaction type for rollups that carries data outside the normal calldata field, at dramatically lower cost. L2 fees dropped another 10-100x after Dencun. A swap on Base today typically costs under $0.01.
Concrete numbers. Assumptions: 10 transactions per month, averaging 150,000 gas each (a typical DEX swap). ETH price: $3,000.
A failed transaction is not free. This surprises people, but it follows directly from how the EVM works.
When you submit a transaction, validators execute it. If the execution reaches a REVERT opcode — because a condition failed, a slippage check didn't pass, you tried to transfer more tokens than you own, or a contract assertion fired — the EVM unwinds all state changes. Your transaction had no effect. The chain looks the same as before.
But the validator did work. They executed every instruction up to the revert. They consumed block space. The base fee was burned. The work was real, even if the outcome was undone. Charging gas for failed transactions is not punitive — it is the only design that prevents denial-of-service attacks where anyone could flood the network with complex transactions at zero cost.
Common causes of reverts: insufficient slippage tolerance on DEX swaps (price moved between submission and execution), interacting with a contract that has already reached a participation cap, insufficient token allowance, or a race condition where another transaction changed state that your transaction depended on.