Skip to content
DeFi & Web3Beginner

How Decentralized Exchanges Work for Your Swaps

A DEX swaps crypto from your own wallet through smart contracts, with no account. You usually pay gas, approve if needed, and keep US tax records.

Vahe HakobyanVahe HakobyanEditor-in-chief Updated Oct 6, 20263 min readFact-checked
A dark navy background with a glass cube split by a glowing emerald green light seam and light trails on the right half.
Illustration: World-Crypt
On this page
Key takeaways
  • A reverted swap usually still costs gas.
  • Open token approvals can drain a wallet.
  • US tax treats crypto swaps as taxable.
  • DEX records are public, not anonymous.

Short answer

A decentralized exchange, or DEX, lets you swap crypto from your own wallet through smart contracts. You connect a self-custody wallet, choose tokens, and pay network gas.

Your wallet signs every transaction, so check the network, token contract, and fees before you confirm.

What Does a DEX Do?

A DEX is a set of smart contracts that let people swap tokens without a company holding the coins. You open no account and send funds to no exchange wallet. The contract moves tokens by its code, and the trade is public and permanent.

What You Need Before You Start

You need a self-custody wallet, which holds your keys. Fund it with tokens on a supported network, and keep native token for gas. Most swaps cost gas, though some DEXs or networks support gasless swaps, and a DEX may add a liquidity provider fee. Ethereum smart contracts, launched in 2015, made this possible.

Before you swap:

  • Choose a self-custody wallet for the network.
  • Fund it with the tokens you plan to swap.
  • Keep native token for gas.
  • Confirm the token contract address.

Step-by-Step DEX Swap Walkthrough

Every check comes before the confirmation. A swap is final once confirmed.

  1. 1Connect Your WalletOpen the DEX and connect your wallet. Check the address.
  2. 2Select the TokensPick the token you have and the one you want. Most single-chain DEXs need both on the same network; cross-chain swaps need a bridge.
  3. 3Approve if RequiredFor an ERC-20 style token, the contract needs an allowance first. Native-token swaps do not. This costs gas.
  4. 4Check Slippage, Gas, ConfirmSlippage caps how much the price can move before the swap fails. Price impact shows how much your trade moves the pool price. Check the gas fee and the amount you receive. A reverted swap still costs gas; one rejected before broadcast does not.

After the Swap: Records and Safety

The IRS treats crypto as property, so a swap is taxable in the US. Save the transaction hash, the date, and each token's value at the swap. Revoke token approvals you no longer need, because an open approval can let a scam contract drain your wallet.

After the swap:

  • Save the transaction hash and date.
  • Note each token's value at the swap.
  • Report the swap on your US tax return.
  • Revoke unused token approvals.

Frequently asked questions

The receiving network usually cannot see those tokens, so they can be lost.

Sometimes. You can replace it with a higher-fee transaction using the same nonce. Otherwise you wait, and gas is paid for the mined transaction.

DEXs may use different liquidity pools or order books, so prices can differ.

Was this guide helpful?
Written byVahe HakobyanVahe Hakobyan is the editor-in-chief of World-Crypt. He covers bitcoin, markets and regulation, and leads the newsroom that fact-checks every story before it goes live.