Uniswap step by step: your first swap
Lesson 22 of 58 in the course “Crypto”. Free, with animations and a quiz.
Your first swap in 6 steps
Uniswap is the largest DEX on Ethereum and its L2s: trillions of dollars have passed through it since 2018. Open app.uniswap.org from a bookmark, tap Connect and link your wallet. Pick the network where your USDC sits, for example Base. At the top choose what you give, at the bottom what you get, and enter the amount. Before signing, expand the details: rate, price impact, network fee and the minimum you are guaranteed to receive. All good? Sign in your wallet.
Why a big swap costs more
A Uniswap pool follows the rule x · y = k: the amount of one coin times the amount of the other stays constant. Example: the pool holds 10 ETH and 30,000 USDC, a rate of 3,000. You buy 1 ETH. The pool is left with 9 ETH, so USDC must become 300,000 / 9 ≈ 33,333, and you pay about 3,333 USDC, 11% more. Buy 0.1 ETH and you overpay only about 1%. That is price impact. In big pools it is tiny; in tiny pools it is huge.
Slippage
While your transaction waits to land in a block, the price can move. Slippage is the maximum worsening you agree to. Set it too low and the trade is cancelled, and the gas is spent. Set it to 10–20% and a bot can “sandwich” you: it buys right before you, pushes the price up and sells right after. A sensible default is Auto or 0.5% for ETH and stablecoins. If the trade fails, raise it a little at a time, not straight to the max.
Approvals: what you are signing
Before your first swap of a token, the wallet asks for an approve: permission for a contract to spend that token. Uniswap does this through the Permit2 contract: one permission, then a signature for each swap. Unlimited permissions are convenient, but if the contract or site turns out to be malicious, they can drain everything. Once a month, go to revoke.cash, connect your wallet and revoke permissions you no longer need. Revoking costs a little gas and closes old doors.
Check yourself
- A pool holds 10 ETH and 30,000 USDC. Why does 1 ETH cost about 3,333 USDC instead of 3,000?
Correct answer: The trade is big for the pool and moves the price (x · y = k). You take 10% of all the ETH in the pool, and the formula lifts the price. A smaller buy would move it much less. - You set 20% slippage on an ETH → USDC swap. What’s the risk?
Correct answer: A bot can sandwich you and you get much less. High slippage is permission to get a bad price. Auto or 0.5% is enough for ETH and stables. - A month ago you gave an unlimited approve to an unknown site. What now?
Correct answer: Revoke the permission on revoke.cash. A permission lives until you revoke it. A wallet password doesn’t cancel it.
← DeFi and DEXs in plain words Liquidity on Uniswap: income and the catches →