Gas fee vs total transaction cost: what you actually pay
When you swap tokens on a decentralized exchange, your wallet shows one number. MetaMask, Rabby, or whatever interface you use presents a gas fee estimate. That number is real money. But it is rarely the only cost you pay for that swap.
The gas fee is what you pay the network to include your transaction in a block. On Ethereum that means base gas plus a priority fee (tip) to validators. The wallet rounds them up into a single estimate. You approve it. You think you know the cost.
You do not.
The components the gas modal hides
A single swap breaks down into at least four distinct costs. Your wallet typically shows you only one.
Base gas fee. This is the network-determined floor. It burns. You cannot avoid it on Ethereum post-EIP-1559. It fluctuates with demand. At network congestion it spikes. When activity is quiet it falls. You see this in the gas meter.
Priority fee. This is optional in theory. In practice you pay it to get included quickly. Validators choose transactions with higher tips first. If you set priority too low your transaction stalls. You then either wait or replace it with a higher fee. The wallet’s “fast” vs “market” vs “slow” toggle adjusts this tip. It is still part of the gas fee.
LP fee. The protocol fee paid to liquidity providers. On Uniswap this is typically 0.01% to 1% of the swap amount depending on the pool’s fee tier. On Curve it varies by pool. The interface usually shows this as a separate line item. Many users ignore it because it looks small. On a large swap it can dwarf the gas fee.
Slippage. The difference between the price you see when you sign and the price you get when the transaction executes. This is not a fee in the traditional sense. It is a cost nonetheless. Slippage happens because prices change between submission and execution. It also happens because the pool’s liquidity is shallow for your trade size. A swap that moves the price by 0.5% costs you that 0.5% of the trade value. Slippage is almost always larger than the gas fee for trades above a few hundred dollars.
The MEV Problem
There is a fifth cost that your wallet never shows. It is called maximal extractable value (MEV). When you submit a swap, bots in the mempool see your transaction before it is mined. They can frontrun you.
A sandwich attack works like this. The bot sees your buy order. It buys the same token ahead of you, driving the price up. Your swap executes at that inflated price. The bot then sells immediately after you, capturing the difference. The victim ends up paying more for fewer tokens. The cost is real but invisible on the receipt. The transaction succeeded. It was just expensive.
You can protect against sandwich attacks by using a private mempool service like Flashbots, or by trading on a protocol with built-in MEV protection like Cow Protocol. These add a small fee. They often save you more.
Why the Gas Fee Is a Poor Proxy for Cost
MetaMask shows an estimated gas fee. It does not show the LP fee unless you expand the details. It does not show slippage at all. It certainly does not warn you that a bot might extract value from your trade. The gas fee dominates the modal because it is the only thing the wallet must verify with the network. Everything else happens at the application layer.
A swap can succeed with a gas fee of $2 and still cost you $20 from slippage and a sandwich.
A swap can have a gas fee of $50 because the network is congested, yet cost you almost nothing in slippage if the pool is deep and your trade is small.
You cannot read cost from the gas meter alone.
What you actually pay
The total cost of a single swap is:
base gas + priority fee + LP fee + slippage + any MEV extraction
Only the first two appear in the wallet’s gas modal. The LP fee appears in the interface if you click expand. Slippage you approximate from the price impact shown on the swap screen. MEV extraction you do not know until it has happened.
A practical rule: for trades under $100, gas dominates. For trades over $1000, slippage and LP fees dominate. For trades at any size on a congested L1 with a mev-hungry pool, the sandwich can exceed all other costs combined.
Do not trust the single number. Decompose it.
Not financial advice. whitecoffeecat.lol publishes market data and general information about digital assets. Crypto assets are volatile and you can lose everything you put in. Nothing here is a recommendation to buy, sell or hold, and we make no price predictions.
Prices are sourced from third parties and may be delayed or wrong. Verify anything you intend to act on against a primary source.