Unit 2 · Level 1 · Reading transactions
Decoding a swap
On a stock exchange your order disappears into a black box. On a DEX, the whole trade is one public transaction: you call the router contract, it pulls your input tokens (using an approval you granted earlier), routes them through liquidity pools, and delivers the output tokens, with every hop written into the logs. Anyone can audit any trade, forever.
Free to play. No ads, no token, no account needed to start.
What you get asked
Put a DEX swap's on-chain journey in order
One signature, a whole relay race underneath. The logs are the referee's notebook: they record exactly what went in and what came out.
Where do you see how many tokens a swap actually delivered?
Unit 1 habit: Value only shows native coin. The token flows (what you paid, what you got) live in the Transfer events in the logs.
A swap's logs show the trader paid 500 USDC and received 0.25 ETH. What effective price per ETH did they pay, in USDC?
500 ÷ 0.25 = 2,000 USDC per ETH. Comparing this effective price against the market price is how you judge whether a trade got a good fill.
A swap's 'minimum received' setting protects you from ___: the price moving between signing and execution.
If the pool's price shifts too far before your transaction lands, the trade reverts instead of filling badly. You'll spot reverted swaps in the wild; that guard is usually why.
Why is it powerful that every swap is public?
This is the seed of 'smart money' analysis: if a famous fund's wallet is known, its trades are visible in real time. No press release needed; the chain already told you. 🐜
The rest of this unit
Transfers, approvals, swaps, mints: learn what each really looks like.