How to Swap Tokens: Fees, Slippage, Approvals, and Taxes

To swap tokens, connect a non-custodial wallet to a decentralized exchange, pick the token you want to sell and the one you want to buy, approve the trade, and confirm it. Two on-chain transactions move through your wallet (an approval and the swap), and three costs come out of the trade: the liquidity pool’s trading fee, the network’s gas fee, and any slippage between the quoted price and the price you actually receive. Every swap is also a taxable event in the United States, so the trade needs to land in your records the day it happens.

Here is what the process looks like in practice, what each cost is, and what the IRS expects afterward.

What You Need Before You Start

Three things sit between you and your first swap: a non-custodial wallet, enough of the network’s native token to pay gas, and the verified contract address of the token you want to buy.

The wallet is the piece most new users underestimate. A non-custodial wallet, such as MetaMask as a browser extension or Trust Wallet and Coinbase Wallet on mobile, puts your private keys and seed phrase under your sole control. The decentralized exchange never takes custody of your tokens during the trade. That is the point of swapping on-chain, and also why mistakes are not reversible.

Gas is paid in the native token of whatever network you are on. ETH on Ethereum. SOL on Solana. If your wallet holds only the token you want to sell and zero native currency, the transaction fails and the gas for the failed attempt is still deducted. Keep a small buffer of the native token beyond what you think you will need.

Before you select a token on the exchange, verify its contract address. Scammers routinely deploy fake tokens with identical names and tickers. Copy the contract address from a reputable data aggregator like CoinGecko or CoinMarketCap and paste it into the exchange’s search bar yourself. Some wallets also ask you to enter the token’s decimal precision and symbol the first time you import it.

Executing the Swap

Open the decentralized exchange in your browser and connect your wallet. Select the token you are selling and the token you want to receive, enter an amount, and the interface will show you a quote along with estimated fees and the minimum you will receive after slippage.

The first time you trade a particular token on a given platform, you have to send an approval transaction. This grants the exchange’s smart contract permission to move a specific quantity of that token out of your wallet. You sign the approval in your wallet, pay a small gas fee, and wait for the blockchain to confirm. The approval is a safety mechanism that caps what the contract can touch instead of handing it blanket control.

Once the approval confirms, the swap button activates. Clicking it triggers a second wallet signature authorizing the actual trade. The smart contract pulls your sell token, routes it through the liquidity pool, and deposits the buy token back to your address. The platform returns a transaction hash you can paste into a block explorer to watch the confirmation in real time.

What the Swap Actually Costs

Every swap carries at least two visible costs and one invisible one.

Trading Fees

Liquidity providers deposit paired tokens into pools so traders always have someone to trade against, and they earn a cut of every swap in return. On Uniswap v3, the most widely used decentralized exchange on Ethereum, pools are organized into four fee tiers: 0.01%, 0.05%, 0.3%, and 1%. Stablecoin-to-stablecoin pools typically sit in the 0.01% or 0.05% tier. Volatile pairs tend to use 0.3% or 1%. The fee is deducted from your trade automatically and shows up in the quote before you confirm.

Gas Fees

Gas fees pay the network’s validators for processing your transaction. On Ethereum, gas is priced in gwei (one-billionth of an ETH), and the total depends on network congestion and the complexity of the contract call. After Ethereum’s recent upgrades, a typical mainnet swap can cost under a dollar during quiet periods and climb into the double digits or higher when the network is busy. Gas is non-refundable even if the transaction fails, which is why setting an adequate gas limit matters.

Slippage

Slippage is the gap between the quoted price and what you actually receive. Prices in a liquidity pool shift with every trade, so if another transaction processes ahead of yours, the ratio changes and your rate moves. Large orders relative to the pool size amplify the effect.

Every decentralized exchange lets you set a slippage tolerance, which is the maximum price deviation you will accept. If the market moves beyond that tolerance before your transaction confirms, the swap cancels automatically. A tolerance of 0.5% to 1% works for most liquid pairs. Illiquid or volatile tokens sometimes need more, but anything above 2% to 3% means you are accepting a meaningfully worse price, so set it deliberately rather than by habit.

Cutting Costs With Layer 2 Networks and Aggregators

If Ethereum mainnet gas feels steep, Layer 2 networks like Arbitrum, Optimism, and Base process transactions off the main chain and settle them in batches. A swap that costs several dollars on mainnet might cost a few cents on Arbitrum. Solana, a separate blockchain rather than an Ethereum Layer 2, charges base fees measured in fractions of a penny. The tradeoff is that you need to bridge assets to those networks first, and not every token or pool exists everywhere.

A DEX aggregator like 1inch or Jupiter scans liquidity across many decentralized exchanges at once and routes your trade through whichever combination of pools yields the best output. The routing engine can split a large order across multiple pools to reduce price impact, or go through an intermediary token when the indirect path pays off after fees. For larger trades, the price improvement often exceeds the extra gas cost of a more complex route.

Revoking Approvals After You Trade

Most wallets default to approving the exact amount you are trading, but some platforms request “unlimited” approval so you do not have to re-approve for future trades. That convenience carries real risk. If a smart contract with unlimited approval is ever exploited, the attacker can drain every unit of that token from your wallet without any further signature from you. Over $405 million has been stolen through approval exploits since 2020.

After you finish trading, revoke the approval. Tools like Revoke.cash and Etherscan’s Token Approvals page list every active approval tied to your wallet and let you revoke them one by one. Each revocation costs a small gas fee, so batching your cleanup at the end of a session is more efficient than revoking after every swap. Revoke.cash’s pencil icon also lets you reduce an unlimited approval to a specific amount instead of removing it entirely.

Check your active approvals periodically, especially if you have interacted with newer protocols. One compromised contract can drain tokens you approved months ago and forgot about.

Avoiding Sandwich Attacks

A less obvious cost of swapping on-chain is MEV, short for “maximal extractable value.” The version that targets ordinary traders is the sandwich attack. A bot watches pending transactions, spots your swap sitting in the public mempool, buys the same token right before your trade to push the price up, lets your trade execute at the inflated price, then sells immediately to capture the difference.

The strongest defense is keeping your transaction out of the public mempool. Services like Flashbots Protect let you submit transactions through a private channel so bots never see your swap before it confirms. Setup usually means adding a custom RPC endpoint to your wallet and takes about a minute. Tight slippage settings also help, because the attack is only profitable when there is enough slippage room to extract value. Setting the tolerance too low on volatile pairs will cause legitimate transactions to fail, so there is a balance.

Wrapping and Bridging

Some trades require a prep step. Native ETH predates the ERC-20 token standard that decentralized exchange contracts are built around, so it cannot interact directly with most liquidity pools. Wrapping converts ETH into WETH, an ERC-20 version, at a 1:1 ratio. The same idea applies to BTC on Ethereum (WBTC) and to native tokens on other chains. Wrapping and unwrapping are simple and cheap.

Bridges move assets between chains that do not natively communicate. If your funds are on Ethereum mainnet but you want to swap on Arbitrum, a bridge locks your tokens on Ethereum and mints equivalents on Arbitrum. The convenience is real and so is the risk. Bridge contracts hold enormous pools of locked assets, which makes them high-value targets. More than $3.2 billion has been lost to bridge exploits through smart contract vulnerabilities, compromised validator keys, and flawed security models. Before using one, check whether it has been audited, how long it has operated, and how much total value it secures. For smaller amounts, moving funds between chains through a centralized exchange can actually be the safer path.

Taxes on Every Swap

The IRS treats cryptocurrency as property, so every token-for-token swap is a taxable event that produces a capital gain or loss. The gain or loss equals the fair market value of what you received minus your adjusted cost basis in what you gave up. This applies whether you are swapping ETH for a governance token, trading between two stablecoins, or exchanging tokens in a project migration. How long you held the asset before swapping determines whether the gain is short-term or long-term.

Each disposal gets reported on Form 8949 with the asset sold, the date acquired, the date sold, proceeds, cost basis, and gain or loss. The totals flow through to Schedule D of your Form 1040. For each transaction, document the date, time, amounts, fair market value in USD, and the wallet addresses involved. The IRS notes that a unit of virtual currency can be identified by its unique digital identifier, including the public key and address, which is how you establish cost basis for a specific unit.

Starting with sales on or after January 1, 2026, brokers that handle digital asset transactions must file Form 1099-DA reporting gross proceeds and, for covered securities, cost basis. The definition of “broker” covers anyone who regularly facilitates digital asset sales for others, including platforms that redeem tokens they issue and digital asset kiosks. The IRS has carved out exceptions for entities that only provide validation services (mining or staking) and for wallet software providers that let users control their own keys. Most purely decentralized protocols without a central operator likely fall outside the current broker definition, so self-reporting remains your responsibility for those swaps.

One quirk worth knowing: as of 2026, the wash sale rule under IRC Section 1091 does not apply to cryptocurrency. You can sell a token at a loss and immediately repurchase it to harvest the tax loss without the 30-day waiting period that applies to stocks. Legislation to close the gap has been proposed repeatedly but has not passed. The rule could change, so the strategy is worth using while it is available.

Keeping Records You Can Actually Use

Every swap produces a transaction hash that lives on the blockchain forever, but the chain does not record the USD value at the moment of your trade and does not calculate cost basis for you. Export your transaction history from your wallet, or use a crypto tax tool to tag each swap with the fair market value at the time it occurred. The IRS requires records sufficient to establish the positions on your returns, including receipts, sales, exchanges, and fair market value for each transaction. If you trade across multiple wallets and chains, a portfolio tracker that aggregates on-chain data saves hours at filing and produces an audit trail a spreadsheet rarely matches.