How to Swap Tokens, and the Four Screens That Matter
The swap itself is two clicks. Everything that decides whether it was a good one happens on the screens around it.
The short answer
To swap tokens onchain you connect a wallet to a decentralised exchange, pick the pair, approve the token you are spending if it is the first time, and confirm the swap. Four things on those screens decide the result: the price impact, which is the cost of your own size against the pool's depth; the slippage tolerance, which is how much movement you will accept between clicking and landing; the approval, which should be for the amount you are trading rather than unlimited; and the confirmation itself, which is the last moment anyone can tell you what the transaction will actually do.
Mechanically this is short: connect, choose, approve, confirm. Written out as a tutorial it takes thirty seconds to read and teaches almost nothing, because the part that separates a good swap from an expensive one is not the sequence.
The sequence, briefly
- Connect your wallet to the exchange, which on this chain usually means
Uniswap. Check the domain before you do – this is the step phishing depends on. - Pick the token you are spending and the one you are buying. Paste the contract address rather than trusting the name.
- Enter the amount, and read the quote before doing anything else.
- Approve the spending token if this is the first time you have traded it from this wallet.
- Confirm the swap, and read what the wallet says it will do.
Screen one: price impact
This is what your own trade costs by moving the price along the pool's curve, and it is not a fee anyone charges. It grows faster than your order size, so a trade twice as large costs more than twice as much. A number above a couple of percent on a small order is telling you the pool is thin, which matters more for your exit than for your entry.
Screen two: slippage tolerance
The gap you will accept between the quoted price and the executed one. Too tight and the transaction fails while the price moves; too loose and you agree in advance to whatever the price is when it lands. It is a setting about volatility, not a setting about speed, and the default is rarely right for a token minutes old.
Screen three: the approval
Before a contract can move a token out of your wallet you have to permit it, and the default request is usually unlimited and permanent. Most interfaces let you edit the amount. Setting it to what you are actually trading costs a few cents more in gas and removes a standing claim on your balance that outlives the trade by months.
Screen four: the confirmation
The last point at which anything can warn you. A wallet that simulates the transaction –
Rabby, for instance – will say what leaves and what arrives in plain language; one that does not shows a contract call you are expected to interpret. This single difference prevents most of the ways a swap goes badly wrong, which is why it is worth choosing the wallet for it.
When it fails
- Slippage too tight for how fast the price is moving – the most common cause by far.
- Not enough of the gas token left, because you swapped all of it.
- The approval succeeded and the swap was rejected separately; they are two transactions.
- The token itself refuses to be sold, which is not a failure of the swap but of the token.
- The route the interface found no longer exists by the time your transaction lands.
Before the first swap of the day
Keep a gas balance you never trade, verify the contract address from source rather than from history, and set the approval to the amount rather than the maximum. Three habits, no effort after the first week, and they remove most of what goes wrong in this process.
FAQ
How do you swap tokens on a DEX?
Connect your wallet, select the pair, enter an amount, approve the token you are spending if it is the first time, and confirm the swap. The approval and the swap are two separate transactions, and both cost gas.
Why does a swap fail?
Most often because slippage tolerance was too tight for how fast the price moved between clicking and inclusion. The other common causes are having swapped away the gas token, or a token whose own contract prevents selling.
What slippage should you set?
Enough to fill through normal movement and not enough to hide a bad fill. It depends on the token rather than on a universal number – a deep pair needs very little, and a token minutes old moves far enough that any tolerance wide enough to fill is also wide enough to hurt.
More from the blog
Arbitrum Orbit: The Stack Robinhood Chain Is Built On
Not a brand on a box. A specific set of choices about who orders transactions, where the data goes, and what you are trusting when you bridge in.
What Volume Means, and When the Number Is Manufactured
Volume is how much traded, not how many wanted to. Two wallets with a script can produce a week of it in an afternoon.
What a Contract Address Is, and Why It Is the Real Name
A token's name and ticker are text anyone can copy. The address is the only part that cannot be faked, which is why every safety check starts there.