Why are my swaps on layer 2 so much cheaper than Ethereum? Rollups
Why are my swaps on layer 2 so much cheaper than Ethereum? Rollups lower the execution price and share Ethereum data costs across many transactions.
iCrypto Editorial5 min read
Swaps on layer 2 cost less because they execute where gas is cheaper, then share the cost of posting transaction data to Ethereum across many users. The swap still takes computational work; the price per unit of that work is lower, and each user pays only a fraction of the batch’s Ethereum data cost.
Matcha swap is a decentralized exchange aggregator: it lets you exchange one token for another through an interface that searches liquidity sources for a route. The 0x protocol page explains the protocol behind this kind of routing and how it connects swaps to liquidity.
Rollup fees combine execution and Ethereum data
A rollup swap fee has two parts: an L2 execution fee and an L1 data fee. The execution fee pays for processing the swap on the layer 2 network. The data fee covers the rollup’s share of the cost to post transaction information to Ethereum.
That distinction explains why a swap can use roughly the same gas units on an L2 as on Ethereum mainnet but cost much less. Gas units measure the work a transaction requires. The fee also depends on the price charged for each unit. On mainnet, demand for limited block space can push that price up. L2 block space is more plentiful, so its gas price can stay far below mainnet’s.
Think of two swaps that do the same work: one on Ethereum, one on Arbitrum. If both require roughly similar gas units, the Ethereum swap can still cost more because each unit is priced higher there. On Arbitrum, the execution part is cheaper. The Arbitrum user also pays only a share of the Ethereum cost of posting the rollup’s data.
So the saving does not come from the L2 swap doing less work. It comes from cheaper execution and shared data costs. The exact fee moves with network demand and the cost of posting data to Ethereum.
The sequencer batches swaps and shares the data bill
A sequencer is the service that orders and processes transactions on a rollup. When you make a swap, the sequencer handles it on the L2, groups it with other transactions, and posts compressed transaction data to Ethereum.
This step matters because Ethereum charges for the block space used to publish that data. If one user had to cover the whole posting cost, the L2 fee would be much higher. Instead, the sequencer’s batch contains many transactions, and their users share the L1 data cost. Compression helps fit the batch into less data space, which further reduces the cost divided among them.
Imagine a sequencer has a batch of swaps and other transactions ready to post. Each user’s fee includes a small share of the batch’s Ethereum data cost, alongside the fee for executing their own transaction on the L2. More transactions in a batch can spread that shared cost across more users, though the amount each swap pays still depends on the data it contributes and current costs.
EIP-4844 added blobs, a dedicated space on Ethereum for rollups to post data. Blobs became available with the Dencun upgrade in March 2024. They gave rollups a cheaper way to publish data than relying only on ordinary transaction data, helping lower the L1 portion of rollup fees.
Arbitrum One and Optimism are optimistic rollups. They process transactions off mainnet and post data to Ethereum, where the rollup’s security process can be applied. Their fees can differ because their activity, data use and pricing vary, even though both use the broad approach of batching L2 transactions and sharing Ethereum costs.
Compare the network fee when you choose where to swap
Say you check the same token pair on Matcha swap, first on Ethereum and then on Arbitrum. Keep the pair and amount the same, and imagine the quoted exchange rates are similar. The network fee line can still be much smaller on Arbitrum because execution is cheaper there and its batch shares the Ethereum data cost among many transactions.
That fee line is separate from the exchange rate. The route can use different liquidity sources on each network, and token prices can move between quotes. For a real trade, compare both the rate and the network fee, then check that your wallet is set to the network where the tokens you want to trade are available.
Polygon PoS can also offer low fees, but for a different reason. It is a sidechain with its own validators, rather than an Ethereum rollup that batches transactions and posts data to Ethereum. Its costs reflect the operation of its own network. A low fee on Polygon PoS therefore does not come from sharing an Ethereum rollup data bill.
Related
Are layer 2 swaps as secure as swaps on Ethereum mainnet?
Rollups use Ethereum for posted data and their security processes, but a swap still depends on the specific L2 and its design. Arbitrum One and Optimism are optimistic rollups; Polygon PoS has its own validators. Before moving funds, check which network you are using and how that network handles security and withdrawals.
How long does it take to move funds from a layer 2 back to Ethereum?
Withdrawal time depends on the network and the bridge method. An optimistic rollup withdrawal through its standard process can involve a waiting period, while other bridge routes may have different timing and costs. Check the withdrawal estimate before moving funds if you need them on mainnet by a particular time.
Do token prices differ between Ethereum and layer 2s?
They can. Liquidity and trading activity may differ between networks, and prices can change over time. Compare the quoted rate and fee for the exact amount on the network you plan to use; the cheaper network fee alone does not guarantee the better trade.