DeFi

How to swap tokens on a decentralized exchange safely

Swapping on a DEX takes a minute once you know the steps, and a single mistake can cost the whole amount. Follow this step-by-step guide to connect a wallet, find the right token, set slippage, approve safely and confirm the swap.

Verifeer Editorial Updated 4 min read

Decentralized exchanges let you trade tokens directly from your own wallet, without accounts or deposits. The interface usually looks simple: two boxes, an amount and a swap button. Underneath, though, you are interacting with smart contracts, choosing networks and granting permissions. This guide walks through a safe swap step by step and explains the settings that matter.

Before you start

  • A self-custody wallet that supports the network you want to trade on.
  • Some of the network's native coin for gas, such as ETH on Ethereum and most layer 2 networks.
  • The official address of the DEX or aggregator, saved as a bookmark.
  • The official contract address of the token you want to buy.

Step 1: Open the DEX from a trusted source

Fake DEX websites appear in search ads and social media links. Use your bookmark or type the address yourself. Check the domain carefully before connecting your wallet.

Step 2: Connect your wallet and choose the network

Click connect, choose your wallet and approve the connection. Connecting only shares your address; it does not give permission to move funds. Make sure the DEX and your wallet are on the same network where your tokens are.

Step 3: Select tokens by contract address

Choose the token you are selling, then the token you are buying. For well-known tokens, the default list is usually fine. For anything else, paste the contract address from the project's official website or a reputable data site. Many fake tokens share names and logos with real ones.

Names lie, addresses do notIf the DEX shows a warning that the token is not on its list, double-check the contract address. Scam tokens rely on people searching by name.

Step 4: Check the quote

Enter the amount. Review the details shown:

  • Exchange rate: compare with prices on other markets.
  • Price impact: how much your trade moves the pool price. High impact means low liquidity.
  • Minimum received: the least you will get with your slippage setting.
  • Route: which pools the trade goes through.
  • Network fee: estimated gas.

Step 5: Set slippage tolerance

Slippage tolerance limits how much worse than the quote the final price can be. If the price moves more, the swap fails. For major tokens in deep pools, low settings work. Some tokens with transfer taxes need higher settings, which is itself a warning sign. High slippage invites sandwich attacks by bots.

Step 6: Approve the token

The first time you sell a token on a DEX, you approve its contract to spend that token. Your wallet shows an approval request. If you can, set the amount to what you plan to swap instead of unlimited. Check that the spender is the DEX's official router. Some DEXs use signature-based approvals; read the prompt carefully.

Step 7: Confirm the swap

Review the transaction in your wallet: the tokens, amounts, network fee and contract. On a hardware wallet, confirm on the device screen. Then submit and wait for confirmation. The new tokens appear in your wallet when the transaction confirms; you may need to add the token to your wallet's list manually using its contract address.

Protecting yourself from MEV

Bots monitor pending transactions and may front-run or sandwich large swaps. To reduce exposure, keep slippage low, use deep pools, split large trades and consider wallets or routers that send transactions privately or offer MEV protection.

Common mistakes

  • Buying a fake token found by name.
  • Swapping on the wrong network.
  • Running out of native coin for gas after buying tokens.
  • Setting very high slippage to "make it go through".
  • Granting unlimited approvals to unknown contracts.
  • Buying tokens that cannot be sold.

Checking a token before buying

  1. Confirm the contract address from official sources.
  2. Look at liquidity in the pool and how long it has existed.
  3. Check the holder distribution on a block explorer.
  4. Use reputable token security scanners to check for honeypot behavior, taxes and owner privileges.
  5. Buy a tiny amount and try selling it before committing more.

After the swap

  • Verify the received amount.
  • Revoke approvals you no longer need.
  • Record the trade for tax purposes.

Swapping on layer 2 networks

Many people learn DEX trading on layer 2 networks, where fees are a fraction of mainnet costs. The steps are the same, but you need ETH on that specific network for gas and the token addresses differ from mainnet. Bridging funds to a layer 2 or withdrawing directly from an exchange to it are the usual ways to start. Double-check that the token you buy on a layer 2 is the official version, because bridged and native versions of the same token can coexist.

DEX aggregators

Aggregators compare many DEXs and split trades across pools to find better prices and lower price impact. They are especially useful for larger trades. They add another contract to trust, so use well-known aggregators through official links.

Key takeaways

  • Use bookmarked official DEX sites and token contract addresses.
  • Check price impact, minimum received and fees before confirming.
  • Keep slippage low and approvals limited.
  • Keep native coins for gas.
  • Test unknown tokens with tiny amounts first.

Frequently asked questions

Why did my swap fail but still cost gas?
The transaction was processed but reverted, usually because the price moved beyond your slippage tolerance or an approval was missing. The network still charges for the work done.
What is a DEX aggregator?
A service that compares prices across many DEXs and routes your trade through the best combination of pools.
Why can I buy a token but not sell it?
It may be a honeypot scam token whose contract blocks selling. Check the token before buying.
Do I need to approve every time?
Usually once per token and spender, unless you approve exact amounts each time.
Share this guide

Keep reading