Under the hood, a swap is just a sequence of well-defined steps. Walking through one demystifies almost everything else.
One swap, step by step
- Connect your wallet. The site reads your public address to show balances. It still cannot move anything without your signature.
- Choose tokens and amount. Pick what you have and what you want; the DEX quotes an expected result.
- Approve (first time only). Before a contract can move a given token, you grant it permission once — a separate, small on-chain step. We cover this in the upcoming lesson on token approvals.
- Review and sign. Your wallet shows the rate, the fees and a minimum you will receive. Signing is the final, binding action.
- The contract executes. Your tokens go into a liquidity pool and the other token comes out — atomically, all-or-nothing.
- It settles on-chain. Seconds to a minute later, the trade is confirmed and visible to anyone on a block explorer.
Where the price comes from
Most DEXes do not match you with another trader. Instead you trade against a pool of two tokens, and a formula sets the price from the ratio of what is inside. The larger your trade relative to the pool, the more the price moves — the reason slippage and price impact exist. We unpack the math in Module 3.
"Atomic" is your friend
A swap either completes fully or not at all; it cannot half-execute and strand your funds. If conditions change mid-flight — say the price moves past your limit — the whole transaction reverts. On Ethereum you may still pay gas for the attempt, which surprises many newcomers.
How to verify anything
Every transaction has a hash you can paste into a block explorer — Etherscan for Ethereum, Solscan for Solana — to confirm exactly what happened. When in doubt, check the chain; it is the source of truth.
- Panicking when a transaction is 'pending' and submitting it again — you can end up paying twice.
- Not knowing where to verify a trade. The block explorer always has the real answer.
- Assuming the quoted price is guaranteed. It is an estimate until the block confirms — which is why slippage settings exist.