The learning path
An onchain swap trades one token for another directly from your wallet using a decentralized exchange, with no company holding your funds. You connect a wallet, approve the token once, set a slippage tolerance, review the route, and confirm. Start on a cheap network like Base or Solana where a mistake costs cents rather than dollars.
What makes this different
On an exchange, you place an order and a company matches it. Your funds sit in their custody the whole time.
In an onchain swap, you interact directly with a smart contract. Your tokens go from your wallet into a liquidity pool and different tokens come back, in a single transaction. No account, no company, no permission. If the contract works, it works, and if you make a mistake, nobody can help you.
Before you start
- A self custody wallet with your recovery phrase safely written down
- Some tokens to swap, moved from an exchange
- Extra native token for gas. ETH on Ethereum and layer 2s, SOL on Solana. Beginners forget this constantly and get stuck
The walkthrough
Go to the exchange, from a bookmark
Type the address yourself or use a saved bookmark. Never click a DEX link from a search ad, a direct message or a social post. Fake front ends that look identical are one of the most common ways wallets get drained.
Connect your wallet
Click connect, choose your wallet, approve the connection. This grants permission to see your address and propose transactions. It does not by itself grant permission to move anything.
Check you are on the right network
Your wallet shows the current network. If you hold tokens on Base but the site is set to Ethereum, you will see a zero balance and get confused. Switch networks in the wallet or let the site prompt you.
Pick the two tokens and the amount
Select what you are giving and what you want. The interface shows the expected output, the price impact and the route it will take.
Set slippage sensibly
Slippage tolerance is how much worse than quoted you will accept. For major pairs, 0.1 to 0.5 percent. If a token demands 10 percent or more, treat that as information about the token rather than a setting to change.
Approve the token, once per token
The first time you trade a given token on a given exchange, you must grant the contract permission to move it. This is a separate transaction that costs gas. Approve only the amount you are trading rather than unlimited, if the interface offers the choice.
Review, then confirm the swap
Read the wallet popup. Check the amounts and that the destination contract matches the site you are on. Then confirm. It settles in seconds on a fast network.
Verify on the explorer
Click through to the block explorer and read what actually happened. Do this every time at first. It builds the instinct that catches problems later.
What every setting means
| Setting | Plain English | Sensible value |
|---|---|---|
| Slippage tolerance | How much worse than quoted you will accept before the trade cancels | 0.1 to 0.5 percent on major pairs |
| Price impact | How much your own trade moves the price, because you are consuming the pool | Under 1 percent. Above 3 percent, reduce your size |
| Minimum received | The worst case output given your slippage setting | Read it. This is the number that is actually guaranteed |
| Route | Which pools the trade passes through | Usually leave it automatic. Aggregators find better paths than you will |
| Deadline | How long before the transaction expires if unconfirmed | 20 minutes is a normal default |
The five expensive mistakes
No gas token
You have tokens but no ETH or SOL to pay the fee. Everything fails. Always keep a few dollars of the native token.
Slippage set far too high
Setting 20 percent to force a trade through is an open invitation to a sandwich attack. You will be filled at the worst price your setting allows.
The wrong token contract
Anyone can create a token called USDC. Always paste the contract address from an official source rather than picking the first search result.
Unlimited approvals
Convenient now, dangerous later. If that contract is ever exploited, every wallet with an open approval is drained. Revoke old ones periodically.
A fake front end
A pixel perfect copy of the real site, reached through a search ad. Bookmark the real thing and use the bookmark.
Where to do it
| Network | Recommended exchange | Cost per swap |
|---|---|---|
| Base | Uniswap or Aerodrome | Well under a cent |
| Solana | Jupiter | A fraction of a cent |
| Arbitrum | Uniswap | A few cents |
| Ethereum | Uniswap or 1inch | Several dollars |
Common questions
Do I need an account to use a DEX?
No. There is no sign up, no email and no identity check. Your wallet is your account. That is the entire point, and also why nobody can help you if you make a mistake.
Why does it ask me to approve before swapping?
Token standards require you to grant a contract permission before it can move your tokens. It is a safety feature. The risk is granting unlimited permission and forgetting about it, which is why reviewing approvals matters.
What if my swap fails?
You lose the gas but keep the tokens. Usual causes are slippage exceeded during a fast move, or insufficient gas. Retry with slightly higher slippage or wait for calmer conditions.
Is a DEX safer than an exchange?
Different risks, not fewer. A DEX cannot go insolvent with your funds, because it never holds them. But you carry the full weight of approvals, fake sites and irreversible mistakes yourself.
Where to go next
Stuck on this one?
Some things click faster with someone walking you through them live. Orca sessions are one to one, screen shared, and paced for wherever you actually are.