How a swap works
A single-hop swap on Uniswap V3:
- You sign a transaction calling
swapExactTokensForTokenson the router. - The router calculates the output based on the pool’s reserves and fee tier.
- The pool contract deducts your input token, adds the output token from its reserves, and transfers the output to you.
- The pool’s fee (0.05%, 0.3%, or 1%) stays in the pool as compensation for LPs.
Most swaps go through an aggregator (1inch, 0x, Paraswap, CoW Swap) rather than a single DEX. The aggregator splits your trade across multiple pools to minimize total slippage — so a $100k swap might route 60% through Uniswap V3, 30% through Curve, 10% through Balancer in one atomic transaction.
Swap considerations
Every DEX swap has several costs:
- Gas — the on-chain transaction fee. On Ethereum mainnet, a swap ranges from $3 to $50 depending on congestion. On L2s (Arbitrum, Base, Optimism) it’s typically $0.10-$1.
- Pool fee — 5-100 bps depending on pool tier.
- Slippage — the gap between quoted and executed price, driven by trade size vs pool depth.
- Price impact — the permanent price move your swap causes. For small trades, invisible; for institutional-sized trades, the dominant cost.
- MEV — sandwich attacks can extract 0.5-3% on unprotected swaps. Aggregators with MEV protection mitigate this.
Risks and considerations
Token contract impersonation is a persistent retail trap. Anyone can create an ERC-20 with the symbol “USDC” or “ETH” and seed a pool. The token aggregator can include these by default unless filtered. Before any swap, verify:
- Token contract address — not just the symbol. CoinGecko, official project docs, and established block explorers all publish the real addresses.
- Destination wallet address — especially if you’re bridging or transferring post-swap.
- Slippage tolerance — set to the minimum that works. 0.5% is typical for major pairs; 1-2% is often enough even for smaller alts. Going above 3% invites sandwich attacks.
- Route preview — most aggregators show which pools the swap traverses. Avoid unusual routes through unknown pools.
For swaps above a few thousand dollars, use a DEX aggregator with MEV protection (CoW Swap, UniswapX, 1inch Fusion). The 1-3% of MEV they neutralize pays for itself on every large trade.