You go to app.uniswap.org, pick a token to trade in and a token to trade out, type an amount, and click Swap. A moment later you get a transaction prompt, a spinning indicator, and eventually a confirmation. You receive slightly less than the quoted amount; sometimes a lot less.
This is what happens between the click and the confirmation, broken into the four layers that actually decide your final price.
Layer 1: the AMM maths
Uniswap does not have an order book. There is no one on the other side of your trade offering to sell. Instead, every trading pair has a liquidity pool — a smart contract holding a balance of two tokens, put there by liquidity providers (LPs).
The price of token A in terms of token B is set by the ratio of their balances in the pool. The core invariant is x * y = k for Uniswap V2, where x and y are the pool balances and k is a constant. When you swap, you push tokens in on one side and the contract computes how many you take out on the other so that k is preserved (minus fees).
This is why price impact exists. If you swap a large amount relative to the pool depth, you move the ratio, and the effective price you pay is worse than the "spot" price shown in the UI. A 10 ETH swap against a 1,000 ETH pool barely moves the needle. A 10 ETH swap against a 20 ETH pool changes the ratio materially, and your output reflects that.
Uniswap V3 (2021) and V4 (2024) layer concentrated liquidity on top of the same invariant — LPs commit capital to specific price ranges instead of the whole curve, which means less slippage per dollar of deposited liquidity, but sharper cliffs when prices move outside a range.
Layer 2: routing
For any given pair, there may be multiple pools — different fee tiers (0.05%, 0.3%, 1%), different versions (V2, V3, V4), different chains. Uniswap's router — called Uniswap X in 2026 — searches across all of them and splits your order to hit the best combined price.
A simple USDC → ETH trade might route entirely through the 0.05% V3 pool. A long-tail trade like USDC → RARE might go USDC → WETH → RARE through two different pools, costing two pool fees but less overall slippage than a single thin pool.
The interesting routing behaviour is multi-chain. Uniswap X fills orders off-chain on whichever chain has the best liquidity, then bridges the output back. You click Swap on Base; the fill happens on Arbitrum; you receive tokens on Base. This is invisible to you in the UI but shaves basis points on long-tail pairs.
Layer 3: gas and the mempool
Swapping is a transaction, and transactions on Ethereum (or any EVM chain) compete for block space. You attach a gas fee. If it is too low, the transaction sits in the mempool, and by the time it lands, the pool price has moved.
Gas on Ethereum mainnet runs $2-$20 for a typical swap in 2026, depending on congestion. On L2s (Arbitrum, Base, Optimism) it is typically $0.05-$0.50. Uniswap's UI estimates both the gas cost and a reasonable priority fee; during busy moments you can override upward for faster inclusion.
The trap: if you underpay gas on a volatile token, the price may move by more than the fee difference saved you. For tokens that move fast, paying up to land in the next block is usually the right call.
Layer 4: the extractive stack (MEV)
Between submitting your transaction and its inclusion in a block, an adversary with inventory can see it in the mempool and profit from it. This is MEV (maximum extractable value).
The two patterns most relevant to a retail swap:
- Sandwich attacks. A searcher bot sees your pending swap, places a buy in front of it (pushing the price up for you), lets your buy execute at the worse price, and sells immediately after. You pay the difference; the bot pockets it.
- Back-running. After your swap lands, a bot arbitrages the price back to the prevailing rate elsewhere. This doesn't cost you anything directly, but it is how price discovery happens in practice.
Uniswap V3 and later use tight slippage defaults (0.5% typical) to limit sandwich damage. Most retail swaps in 2026 also route through MEV-protected relays like MEV Blocker or Flashbots Protect — set in your wallet, usually transparent to you. If your swap gets sandwiched for more than 0.5%, the transaction reverts instead of executing at a bad price.
What you actually paid
A concrete example. You swap 1 ETH for USDC on a quiet day, Ethereum mainnet, via a 0.05% pool with deep liquidity. The ledger looks like:
- Pool fee: 0.05% on the ETH side → ~$3.
- Gas: ~$5 for the transaction.
- Slippage: effectively zero in a deep pool for a 1-ETH trade. Could be 0.1-0.5% on the same trade against a thinner pool.
- MEV tax: close to zero with MEV protection enabled, potentially 0.1-0.3% without it on volatile pairs.
Total cost: somewhere between $8 and $25 on a $3,500 trade. For long-tail tokens or volatile conditions, multiply the slippage and MEV lines by 3-5x.
What to watch for
- Slippage tolerance. Default 0.5% is fine for major pairs. For thin pools or volatile tokens, consider raising; for rock-stable pairs, lower. Setting 5%+ is an invitation to sandwich attacks.
- Token contract address. Scam tokens clone legitimate names. Verify the contract address matches the official project before your first trade into a new token.
- Gas fee vs slippage. On mainnet, gas often dominates on small trades; on L2s, it is negligible. Route accordingly.
- Front-end vs direct. The Uniswap app is convenient but not the only way in. Wallet built-in swaps (Rabby, Rainbow), aggregators (CoWSwap, 1inch, Matcha), and direct contract calls all hit the same underlying pools with different UX trade-offs.
Your Uniswap swap price is not one number — it is AMM maths, routing quality, gas, and MEV stacked on top of each other. For major pairs on L2s in quiet conditions, the total cost rounds to "a few basis points." For thin pairs in volatile conditions on mainnet, it can be several percent. The default UI is tuned for the former.