How to Swap One Crypto for Another
Three routes from one coin to another, what each one costs and how each one fails, including the old token approvals that cost 153 wallets about $11.6 million in July 2024.

TL;DR
- A swap inside an exchange account is a ledger entry with no gas to pay, but the coins stay in the exchange's custody until you withdraw them.
- A DEX swap from your own wallet means approving the token, setting a slippage tolerance and paying gas, and a swap that reverts still spends its gas.
- An unlimited token approval stays live until you revoke it; on 16 July 2024, old approvals let an attacker drain about $11.6 million from 153 wallets.
- Cross-chain swaps add a second transaction, a wait (about seven days on Arbitrum's own bridge back to Ethereum) and the risk of landing the wrong version of a token.
On 16 July 2024, LI.FI, a service that routes swaps and transfers between blockchains, added a new module to its main contract. The module passed any call it was handed straight on to other contracts, without the whitelist check its other modules ran, and it was exploited the same day. By LI.FI's own estimate, about $11.6 million in USDC, USDT and DAI left 153 wallets on Ethereum and Arbitrum.
The attacker needed no signature from any of them. What those wallets shared was a permission granted earlier and never withdrawn: an unlimited approval letting the contract move one of their tokens. LI.FI's incident report says wallets that had given only a limited approval, the default in its own tools, were not affected.
Approvals are the least visible part of a swap. Turning one crypto into another looks like a single button, but three quite different routes sit behind it, and each one has its own costs and its own way of going wrong. Educational guide, not financial advice.
Inside an exchange account
The plainest swap never touches a blockchain. If both coins sit in an account at a centralised exchange, a trade between them is an entry in that exchange's own ledger, so there is no gas to pay and no wallet to sign with.
Many exchanges offer it two ways: an order-book trade matches you against other customers' standing offers for a stated fee, and a large market order can fill at a worse average price as it works through the queue of offers. An instant convert screen is quicker to use, and it shows a single rate with the margin already built in: a spread, the gap between the market rate and the rate you receive, and at some exchanges a trading fee on top of that.
The cost that never shows on the receipt is custody. Coins swapped inside an account stay with the exchange until you withdraw them, and the withdrawal is a separate on-chain transaction with its own network fee. Pick the wrong network on the way out and the coins can arrive on a chain your wallet is not watching.
A DEX swap from your own wallet
A decentralised exchange (DEX) is a set of contracts on a chain, and your coins stay in your wallet until the swap itself runs. The common design prices each trade by formula from a pool holding two tokens, so the rate you are quoted depends on how large your trade is against the pool. The volumes are large: DefiLlama's tracker, read at 13:41 Singapore time on 2 November 2026, put 24-hour volume on the DEXs it follows at about $5.4 billion, and roughly $242 billion over 30 days.
On Ethereum and chains built like it, the steps run in this order.
Connect the wallet to the exchange's interface, pick the two tokens and read the quote.
Approve the token you are selling, a separate transaction with its own gas (a chain's native coin, such as ETH, needs no approval).
Set a slippage tolerance, the worst rate you will accept before the swap cancels itself.
Confirm and pay the gas, while the pool's fee comes out of the trade.
Open the transaction on a block explorer and check what arrived.
The pool fee is not fixed either, and Uniswap's developer docs list four fee levels for its v3 pools: 0.01%, 0.05%, 0.30% and 1%. Its v4 contracts drop fixed tiers altogether, and a pool's creator can set any fee from 0% to 100%, so the fee line on the confirmation screen deserves a look.
Then come the failures, and each already has its own guide. Set the tolerance too tight and the price can drift past it before the transaction lands, so the swap reverts as a failed transaction with its gas already spent. Set it too loose and a bot watching the queue of pending transactions can sandwich the swap, the best-known form of MEV, and slippage itself sits between the two.
Token names prove nothing. The ERC-20 standard makes a token's name and symbol optional labels, picked by whoever deploys the contract, so a pool can pair ETH with a token calling itself USDC that Circle never issued. The contract address is the only identifier that counts.
What an approval actually allows
The approval step comes from EIP-20, the token standard Fabian Vogelsteller and Vitalik Buterin wrote in November 2015. Calling its approve function lets a named spender, usually a DEX's router contract, withdraw from your balance of that token more than once, up to a set amount. A second function, allowance, reports how much the spender can still take, and a fresh approval overwrites the old figure.
To spare you an approval on every later swap, some interfaces ask for an unlimited amount. That allowance has no expiry date. It outlives the swap and the browser session, and it is still there when the app's team ships new code, which is exactly how the LI.FI wallets were emptied. Revoking means setting the allowance back to zero, and that is an on-chain transaction that costs gas like any other.
Swapping across chains
A swap gets harder when the coin you want lives on another chain. The job then goes to a bridge or a cross-chain router, and one click usually hides at least two transactions: one on the chain you leave and one on the chain you arrive at, with a wait between them.
The wait can be long. Arbitrum's documentation, checked on 2 November 2026, gives a challenge period of 45,818 Ethereum blocks, about 6.4 days, for a withdrawal from Arbitrum One back to Ethereum through its own bridge, and roughly seven days in all before the funds can be claimed. The claim is manual, too: somebody has to send a second transaction on Ethereum, or the withdrawal sits there confirmed and undelivered.
Third-party bridges and routers can shorten the trip, but each adds its own contracts, and often its own approval, to the path. LI.FI was one of them.
Then there is the token that arrives. Arbitrum One carries two versions of USDC: native USDC, which Circle launched on the chain in 2023, and an older version bridged from Ethereum and now labelled USDC.e. Arbitrum's docs treat them as separate tokens, and a transfer from Ethereum can deliver either one depending on the route taken. Land the wrong one and you need another swap, with another fee, before an app expecting the other version will accept it.
Before you press confirm
Every route ends on a confirmation screen, and it repays a slow read.
Check the contract address of the token you are receiving against the issuer's own site, not the name in a dropdown. Check the minimum received, which is your slippage tolerance turned into a number, and the network the coins will land on. Read the approval amount before signing it as well, because a limited approval costs one extra step next time, while an unlimited one lasts until you revoke it.
The exchange route makes most of these choices for you, and you pay for that in fees and spread. The wallet routes put every one of them in front of you, and 153 wallets show what a forgotten one can cost.
