Swapping Tokens on a DEX
Swapping one token for another is the most common action in DeFi — and it happens on decentralised exchanges (DEXs) with no account, no custodian, and no market hours. This guide explains how DEXs price your trade and walks you through a safe first swap.
What Is a DEX?
A decentralised exchange is a set of smart contracts that lets you trade tokens directly from your wallet. Unlike a centralised exchange (Binance, Coinbase), a DEX never holds your funds — you approve each trade, and assets move from wallet to contract to wallet in a single transaction.
The largest DEXs are Uniswap (general trading), Curve (stablecoin-focused), and PancakeSwap (BNB Chain). Together they process tens of billions of dollars monthly across Ethereum, its Layer 2s, and other chains.
How Prices Work: Automated Market Makers
Most DEXs use an Automated Market Maker (AMM) instead of an order book. Liquidity providers deposit token pairs (say, ETH and USDC) into a pool, and a formula sets the price based on the ratio in the pool. Your trade shifts that ratio, which moves the price — that is why big trades in small pools get worse rates.
Every swap pays a small fee (typically 0.01 %–0.3 %) that goes to the liquidity providers. This is the yield source behind "liquidity provision", which we cover in a separate guide.
Five Terms You Must Know Before Swapping
These five concepts decide whether your swap executes at a fair price — or becomes an expensive lesson.
Slippage tolerance
The maximum price movement you accept between clicking "Swap" and the transaction confirming. Set 0.1–0.5 % for stablecoins and major pairs; anything that needs 3 %+ is a warning sign.
Price impact
How much your own trade moves the pool price. Under 0.5 % is normal for liquid pairs; if you see 2 %+, your trade is too large for the pool — split it or use a deeper venue.
Minimum received
The worst-case amount the contract guarantees. If the price moves beyond your slippage tolerance, the swap reverts instead of filling badly.
Token approval
Before a DEX can swap your token, you sign an approval transaction granting the contract access. Approve only the amount you are trading rather than "unlimited" for contracts you do not know.
Routing
The path your trade takes. Complex swaps route through several pools (e.g. TOKEN → ETH → USDC). Aggregators compare routes across many DEXs to get you a better net price.
Step-by-Step: Your First Swap
The walkthrough below uses Uniswap on a Layer 2, but the flow is nearly identical on every major DEX.
Open the official app
Type app.uniswap.org manually or use a saved bookmark — search-engine ads regularly impersonate DEX frontends. Connect your wallet and check you are on the intended network.
Verify the token
Scammers list fake tokens with identical names and tickers. Paste the contract address from the project's official site or a listing site like CoinGecko instead of picking by name from the dropdown.
Review the quote
Enter the amount and read the details panel: rate, price impact, network fee, and minimum received. On a Layer 2 the network fee should be cents; price impact on a liquid pair should be near zero.
Set slippage deliberately
Open settings and set slippage yourself rather than trusting "auto": 0.1–0.5 % for majors and stablecoins. If the swap fails, raise it in small steps — do not jump to 5 %.
Approve, then swap
Two transactions the first time: an approval for the token, then the swap itself. Read what your wallet shows before signing — the amount, the contract, the network.
Verify the result
Check the received amount in your wallet or on a block explorer. If the token does not appear, add its contract address manually — never "re-swap" out of impatience.
Aggregators and Intents: How Pros Swap in 2026
Aggregators like 1inch compare prices across dozens of DEXs and split your trade across routes. For anything beyond a small swap, an aggregator usually beats a single venue.
The newest model is intent-based trading: with UniswapX or CoW Swap you sign what you want ("sell X, receive at least Y"), and competing solvers execute it for you. Batch auctions and private execution give you built-in MEV protection — no one can front-run an order that never touches the public mempool — and failed intents cost you nothing.
Common Mistakes
The classic errors: buying a fake token with the right name (always verify the contract address), swapping a large amount into a shallow pool (check price impact), granting unlimited approvals to unknown contracts (revoke with tools like Revoke.cash), and chasing a failed transaction by cranking slippage to 10 % — which simply invites sandwich bots to take the difference.
Some tokens are honeypots: you can buy them, but a hidden transfer restriction stops you selling. If a brand-new token shows explosive gains and you cannot find sell transactions from normal wallets on the explorer, stay away.