Your First Swap: A Worked Example
Every concept in this module — wallets, approvals, AMM pricing, slippage — comes together in this lesson as you walk through a complete token swap from start to finish. This is the first full DeFi transaction you'll execute, and the goal is to do it deliberately and carefully, checking each step rather than clicking through quickly.
The full sequence has six steps. Step one: connect your self-custody wallet (set up in Module 2) to the DEX interface — this is a read-only connection at first, simply letting the interface see your address and balances; it does not yet authorize any spending. Step two: select the token pair you want to swap, for example USDC to ETH. Step three: review the quoted price, the estimated slippage or price impact, and the network fee (gas) before confirming anything — this is where the AMM pricing and slippage concepts from this module become concrete numbers on your screen. Step four: if this is your first time swapping this particular token on this particular DEX, you'll need to sign a separate approval transaction (from Module 2) authorizing the DEX's contract to spend the token — review this prompt carefully rather than clicking through it. Step five: confirm the actual swap transaction and wait for it to be included in a block. Step six: once confirmed, verify the result on a block explorer — the exact amount received, the gas fee paid, and the transaction's final status.
Doing all six steps deliberately, and recording what actually happened at each one, turns an abstract concept into a concrete reference point you'll use again in this course's capstone project.
Worked Example
Here's a complete walkthrough using concrete numbers: you want to swap 100 USDC for ETH. After connecting your wallet, you select USDC as the input and ETH as the output; the interface quotes 0.0495 ETH at the current pool price, with an estimated price impact of about 0.3% given the trade size relative to the pool, and a default slippage tolerance of 1% already set (which you review and decide to tighten to 0.5%, since this is a deep, liquid pair). Since this is your first swap using USDC on this particular DEX, the interface first prompts you to approve USDC spending — you read the prompt, confirm the contract address matches the DEX you intended to use, and see the amount is set to the exact 100 USDC rather than unlimited, and you approve.
A second prompt then asks you to confirm the swap itself, showing the same quoted amount and slippage tolerance. You confirm, the transaction is submitted, and after roughly 20 seconds it's included in a block. You check the transaction on a block explorer using the transaction hash provided by your wallet, and confirm you received 0.0493 ETH (a small amount of slippage within your 0.5% tolerance) and paid a gas fee of a few dollars' worth of ETH for the approval and swap transactions combined.
It's worth pausing on step six specifically, because many new users skip it entirely once their wallet shows a "success" notification. The block explorer confirmation is where you independently verify, from the public blockchain record rather than your wallet's own interface, exactly what happened: the precise amounts transferred in each direction, the exact gas fee charged, which contract addresses were involved, and the transaction's definitive final status. Wallet interfaces are generally trustworthy, but building the habit of independently verifying on a block explorer — a tool that reads directly from the blockchain itself rather than any single company's servers — is a skill that pays off enormously later, particularly when something goes wrong and you need to diagnose exactly what a transaction actually did rather than relying on a notification that might be delayed, cached, or simply wrong.
Common Pitfalls
- Rushing through the approval and swap prompts because you're excited to complete your first trade. This is exactly the moment the habits from Module 2 matter most — read the contract address, token, and amount on each prompt.
- Not checking the gas fee before confirming. Network fees vary significantly by time and congestion; an interface will show an estimated fee before you confirm, and it's worth comparing it to the trade size, especially for small trades where gas can represent a large percentage of the amount traded.
- Confusing "pending" with "failed." A transaction sitting as pending for longer than expected during network congestion is not necessarily a failure — check its status on a block explorer using the transaction hash rather than assuming something went wrong and resubmitting.
Exercise
Using a testnet (free test tokens with no real monetary value, designed exactly for this kind of practice) if one is available to you, or a very small real amount if not, execute one complete swap following all six steps described above: connect, select pair, review quote and slippage, approve if needed, confirm, and verify on a block explorer.
Record four specific numbers from your real transaction: the quoted amount you were offered, the actual amount you received, the slippage percentage between the two (using the formula from the previous lesson), and the gas fee paid. Keep this record — in Module 7's capstone project, you'll be asked to document real transaction data as part of your final strategy write-up, and this first swap gives you an authentic data point to reference.
Recap
- A complete swap has six steps: connect, select pair, review quote/slippage, approve if needed, confirm, and verify on a block explorer.
- Reviewing the approval and swap prompts carefully — rather than clicking through — applies the Module 2 approval lesson directly to a live transaction.
- The quoted amount, actual amount, slippage percentage, and gas fee from this first swap become real data you'll reuse in your Module 7 capstone.
Resources
Module quiz
5 questions · pass mark 70% · retake any time