On 9 August 2022 people who opened Curve Finance’s website and approved what looked like a normal transaction lost about $570,000, according to the on-chain investigator ZachXBT as reported by The Block. Curve’s own smart contracts were not the problem. Someone had redirected the site’s domain to a copy that asked visitors for an approval to a contract the attacker controlled. The protocol was fine; the page in front of it was not.
That is the core lesson on how to use a blockchain, where users swap tokens directly from their own wallets without handing custody of their funds to a company.">DEX safely. A decentralized exchange has no support desk and no cancel button. Once a swap is signed and included in a block, it is final. The protection sits in a few habits you apply before you press Swap: rehearse on a testnet, check the token address, set slippage with intent, keep your trade away from sandwich bots, control the permissions you hand out, and make sure the site is the real one.
None of these habits makes a swap risk-free. They make it safer, and most of them cost nothing. The one that costs a little, a first real swap on a layer 2 network, came to less than half a cent in fees on Base on the morning of 29 October 2026, as the receipts below show.
Five ways a swap that worked can still cost you money
A quick reminder from the previous lesson: on an automated market maker such as Uniswap, you do not trade against a person with an order. You trade against a smart contract holding reserves of two or more tokens, supplied by users, that a decentralized exchange uses to execute trades automatically at a price set by a formula.">pool of two tokens whose price moves as the balance between them changes. Our lesson on decentralized exchanges and AMMs explains pools, fees and aggregators; here we take that machinery as given and look at what can go wrong for the person pressing the button.
Five things, mostly invisible on the confirmation screen. You can buy the wrong token, one that copies a real name and ticker. You can get a worse price than the quote, because the market moved or because you allowed too much room. A bot can trade just before and just after you and keep the difference. A permission you granted months ago can let a contract take tokens later. And the website itself can be fake, as Curve’s users found out.
Behind all five sits the structural fact of self-custody: you hold the keys, so nobody can reverse a mistake for you. If your wallet setup is still new, the DeFi prerequisites checklist covers what to have in place before any of the steps below.
Rehearse your first swap on a testnet
A testnet is a copy of a blockchain where the coins are worthless. The same kind of contracts run there, the wallet asks for the same confirmations, and the explorer shows the same details. That makes it the right place to learn the screens without paying for mistakes.
Check which testnet your front end supports
Uniswap’s own contracts are deployed on several test networks. Its developer documentation lists v4 deployments on Sepolia, Base Sepolia, Arbitrum Sepolia and Unichain Sepolia, as of 29 October 2026. A deployed contract does not mean the website shows that network, though. Front ends add and drop testnets over time, so look in the app’s settings for a testnet option and read the list of networks it offers at that moment, or check its help centre. Pick a testnet that appears in that list and that your wallet can add.
Step by step on a testnet
- Create a separate wallet account for experiments, with its own seed phrase written on paper. Never reuse the phrase of a wallet that holds real money, and never type it anywhere a website asks for it (our guide to seed phrase security explains why).
- Add the testnet to your wallet if the app does not do it for you, and switch the front end to its testnet mode.
- Get test ETH from a faucet. A faucet only needs your public address. Conditions change often: some ask for an account, some for a small balance on the main network, and amounts vary from day to day, so read the faucet’s own page.
- Pick a pair of tokens that exist on that testnet, such as test ETH against a test version of a stablecoin, and type a small amount.
- Before anything else, study the quote: the amount you pay, the amount you receive, the exchange rate, the price impact, the network cost and the minimum amount you will accept. The labels differ between apps, but those numbers are always there somewhere, sometimes behind a small arrow.
- Press the button and read your wallet’s screen: the network name, the contract you are calling and, if it is your first trade of that token, a separate approval request.
- Confirm, wait for inclusion, then open the transaction on the testnet’s explorer (sepolia.etherscan.io for Sepolia). Check that it says success, how much gas it used and which tokens moved.
Some things a testnet cannot teach. Liquidity there is thin and the prices are meaningless, so a price impact of 30% on a test pair says nothing about the main network. There are no real sandwich bots and few fake tokens. Treat the testnet as practice for the buttons, not for the market.
A first small real swap on a layer 2, with the fee measured
Once the screens feel familiar, the next step is a real swap with an amount you can afford to lose entirely: think ten or twenty dollars, not a month’s savings. This is a learning exercise, not a recommendation to buy anything. A layer 2 network such as Base or Arbitrum One is the cheaper place to do it, because it bundles many transactions and settles them on Ethereum; our lesson on layer 1 and layer 2 networks explains how.
- Choose one layer 2 that your wallet and the DEX both support.
- Fund the wallet on that exact network. The simplest route is a withdrawal from an exchange that offers the layer 2 as a withdrawal network; the network chosen on the exchange must match the one in your wallet, or the funds can end up where you cannot reach them. A bridge is the other route.
- Keep a little ETH on that network: ETH pays for gas on Base and on Arbitrum One, even if you swap stablecoins.
- Use a bookmark saved from the project’s own documentation to reach the DEX, never from a search ad (more on that below).
- Select the token you want by its contract address, checked as explained in the next section, then type the small amount.
- Check the minimum received and the network cost in the quote, then confirm in the wallet.
- Look up the transaction on the network’s explorer (basescan.org for Base, arbiscan.io for Arbitrum) and note the transaction hash for your records.
How much does it cost? We measured it on real swaps. We took transactions sent to Uniswap’s Universal Router (the contract the Uniswap app sends swaps to) and included around 10:00 UTC on 29 October 2026, then read the fee actually paid from each transaction’s receipt on the network’s public node that day. ETH is valued at about $2,319, DefiLlama’s price at 10:00 UTC. One example on Base: a swap of about 0.0059 ETH in block 53,239,262 paid 0.00000117 ETH in total, about $0.003. That total includes the layer 1 data fee that Base adds for posting the transaction to Ethereum, which was only about 0.000000001 ETH here. A swap uses more or less gas depending on its route, which is why the figures below are ranges.
| Network (Uniswap swaps included around 10:00 UTC, 29 Oct 2026; fees read from the receipts) | Swaps read | Total fee per swap, ETH | About, in dollars (ETH at $2,319) |
|---|---|---|---|
| Base (blocks of 10:00:00 to 10:00:30 UTC) | 37 | 0.0000007 to 0.0000016 | $0.002 to $0.004 |
| Arbitrum One (about 2.5 minutes of blocks) | 2 | 0.000004 | $0.009 |
| Ethereum mainnet (10 blocks from 10:00 UTC) | 39 successful | 0.000004 to 0.00034 (median 0.000006) | $0.01 to $0.79 (median $0.01) |
| Ethereum mainnet, failed swap | 1 | 0.0000029 | $0.007, paid for nothing |
Two cautions. These are fees of one quiet morning: gas prices rise when many people transact at once, sometimes by a large multiple, so check the network cost shown in the quote rather than relying on our table. And a swap that fails still costs gas, as Uniswap points out in its guide to slippage: the failed mainnet swap in our sample paid its fee and received nothing. That morning it was under a cent. On a congested day the same failure on mainnet can cost dollars.

Check the token before you buy it
Anyone can create a token and call it USDC, PEPE or the name of a project that has not launched its token yet. A DEX pool will happily list it. The name and ticker on the screen prove nothing; only the contract address identifies a token.
Fake tokens, copycats and honeypots
Copycats carry the name and logo of a real asset. Honeypots are tokens you can buy but cannot sell, or can sell only at a punishing fee written into their code. Both depend on one moment of inattention: the buyer types a ticker, picks the first result and confirms.
The fix is to take the address from a source you trust, such as the project’s official website or documentation, or the token’s page on CoinGecko’s website, then compare it with the address in the swap screen, character by character at the start and at the end. Stablecoins need extra care on layer 2 networks, where a native version and an older bridged version of the same dollar token can both exist under similar names.
Front ends add their own filter. Uniswap introduced token warnings on 19 December 2024, powered by the security firm Blockaid, including labels for tokens identified as possible impersonators and for tokens with a 100% sell fee, according to Uniswap’s announcement, which adds that the warnings are not investment advice. Treat them as one signal among several. The absence of a warning does not prove a token is genuine, least of all one created a few hours ago.
A short checklist for an unknown token
- The source code is verified on the network’s explorer, so anyone can read what the contract does.
- Holdings are not concentrated in one or two wallets that could dump the supply.
- The pool has real depth and has existed for more than a few hours.
- The trade history shows sells as well as buys; many buys and no sells is the classic sign of a honeypot.
- Two different token scanners agree. Services such as GoPlus, Token Sniffer or Honeypot.is read the contract for known traps, but they miss things, and sometimes only an actual small sell proves a token can be sold.
Slippage tolerance and price impact are two different numbers
Uniswap defines slippage as the gap between the price you were quoted and the price at which the trade actually executes. Slippage tolerance is the largest gap you accept. If the market moves further than that before your transaction is included, the swap does not go through, and you still pay the network cost. In the Uniswap web app the tolerance usually sits somewhere between about 0.1% and 5%, set automatically or by hand, according to the company’s slippage guide published on 11 September 2025.
Price impact is something else. It is the move your own trade causes in the pool, set by the size of the trade against the depth of the pool, and it is already included in the quote you see. It is a cost you know before you sign, not a risk. A large price impact tells you the pool is too shallow for your size; the answer is a smaller trade, a deeper pool or an aggregator that splits the order.
A worked example makes the difference concrete. The figures are invented for teaching and are not market prices. You swap 1,000 USDC for ETH in a pool where, before your trade, 1 ETH costs 1,994 USDC. Your trade itself moves the price, so the quote says you will receive 0.5000 ETH instead of 0.5015 ETH: a price impact of about 0.3%. The tolerance then decides the minimum you accept below that quote.
| Slippage tolerance (example) | Minimum received | Most you can lose against the quote | At an example price of $2,000 per ETH |
|---|---|---|---|
| 0.5% | 0.4975 ETH | 0.0025 ETH | $5 |
| 1% | 0.4950 ETH | 0.0050 ETH | $10 |
| 3% | 0.4850 ETH | 0.0150 ETH | $30 |
| 5% | 0.4750 ETH | 0.0250 ETH | $50 |
Set it too tight and swaps fail whenever the price ticks, each failure costing gas. Set it too loose and you hand anyone who can reorder transactions a margin to take. Uniswap’s own guide gives the scale: on a 10,000 USDC trade, a 6% tolerance means accepting roughly 600 USDC less than quoted. Auto settings exist for a reason; a manual tolerance well above the app’s suggestion is worth a second look before you sign.
Why the slippage on a swap is high
A few causes explain most cases. The pool is thin, or your trade is large relative to it. The token is new or volatile, so its price moves between quote and inclusion. The token charges a fee on every transfer, which forces a higher tolerance (and scam tokens exploit exactly that). The market is moving fast, or the network is congested and your transaction waits. Or the tolerance was raised by hand and a bot used all of it.
Sandwich attacks: how MEV bots trade around you, and how to avoid them
On Ethereum, a transaction usually waits in a public queue, the mempool, before a block builder includes it. Bots read that queue. When one sees a large enough swap with room in its slippage tolerance, it can place a buy just before it and a sell just after it in the same block. Your trade pushes the price up between the two, and the bot pockets the difference. This is a sandwich attack, one form of what is called MEV (maximal extractable value), which a later lesson covers in depth.
The scale is measurable. Data from the analytics firm EigenPhi, published by Cointelegraph Research on 4 December 2025, covers Ethereum from November 2024 to October 2025.
| Sandwich attacks on Ethereum, Nov 2024 to Oct 2025 (EigenPhi) | Figure |
|---|---|
| Attacks over the period | more than 95,000 |
| Attacks per month | 60,000 to 90,000 |
| Estimated trader losses per year | about $60 million |
| Monthly value extracted, late 2024 | nearly $10 million |
| Monthly value extracted, October 2025 | about $2.5 million |
| Average profit per attack | just above $3 |
| Distinct bots in October 2025 | 515 (about 100 active in a typical month) |
Those numbers say two things. The damage per trade is usually small, a few dollars, and most of the value goes to block builders through fees rather than to the bots. But it is systematic: every swap sent through the public mempool with a loose tolerance is a candidate.
Protection that works on Ethereum mainnet
Your wallet talks to the blockchain through an RPC address, a server that relays your transactions. A private RPC sends your transaction to builders without passing through the public mempool, so sandwich bots do not see it before it is included. Flashbots Protect is one: according to its documentation it serves Ethereum mainnet (and has a separate Sepolia endpoint for testing), and it only includes transactions that will not revert, so a failed swap costs nothing. MEV Blocker is another, which its documentation describes as a set of Ethereum RPC endpoints that also hand users part of the profit bots make by trading right after them (back-running).
Adding one takes a minute in most wallets: add a network by hand, give it a name, enter the RPC address from the provider’s own documentation (for Flashbots Protect, https://rpc.flashbots.net/fast), chain ID 1, currency ETH, then switch to it. Flashbots warns not to switch RPCs while a transaction is still pending, because the wallet may rebroadcast it to the public mempool.
Intent-based swaps are the second route. With UniswapX, you sign an order and competing fillers execute it through a Dutch auction whose price decays from a best case towards your minimum; Uniswap’s documentation says the swapper pays no gas and failed orders cost nothing. CoW Protocol collects orders into batch auctions settled at one uniform price per pair, which makes the order of transactions inside the batch irrelevant and leaves a sandwich nothing to work with. Which networks and tokens each one serves changes, so check the app at the time of the trade.
Two simpler habits apply everywhere, including on layer 2 networks, which the documentation of these two services does not cover: keep the slippage tolerance tight, and avoid shallow pools where a small trade moves the price a lot. None of this protects you from a bad token, a fake website or an approval you should not have signed.
Token approvals: the permission you forget
Swapping an ERC-20 token takes two kinds of action. ERC-20 is the standard most tokens on Ethereum and its layer 2 networks follow. First you call its approve function, which lets another address, the spender, move up to a set amount of your tokens. The standard pairs it with allowance, which shows how much permission is left, and transferFrom, which the spender uses to pull the tokens. Then the DEX contract uses that permission during the swap.
Many apps ask for an unlimited amount, so you do not pay for a new approval on every trade. Convenient, but the permission stays after you leave the site. As Revoke.cash explains in its learning pages, once granted it can be used at any time, and if the contract is later hacked or was malicious from the start, the tokens it is allowed to spend can be taken.
Permit2 moves the risk, it does not remove it
Uniswap’s Permit2 contract changes the pattern. You approve Permit2 once per token, with a standard ERC-20 approval. After that, each app gets either an allowance with an amount and an expiry date, or a single signed transfer that leaves no allowance behind. That is cleaner, but the approval to Permit2 itself is commonly set to the maximum amount, as Uniswap’s documentation notes, and a signature can now grant a spending right without any transaction or gas. Phishing sites use exactly that: a harmless-looking signature request instead of a transaction. Read every signature request as carefully as a payment.
How to check and revoke approvals
- Open Revoke.cash, which says it supports more than 80 networks, or the Etherscan token approval checker (and its equivalent on the explorer of your layer 2).
- Enter your public address to see the list, or connect the wallet if you want to change something.
- Select the network; approvals are listed per chain.
- Sort by spender and look for unlimited amounts, contracts you do not recognise and sites you no longer use.
- Revoke, or lower the amount. Revoking sets the allowance back to zero, so it is a transaction and costs gas. Our estimate from Base gas prices on 29 October 2026 (about 0.006 gwei) is well under one cent for a revocation; check the network cost your wallet shows.
A separate wallet for DEX experiments limits the damage of any approval you get wrong: whatever it can lose is only what it holds.
Phishing front ends and DNS hijacks
The Curve case of August 2022 was not unique. On 11 July 2024 several DeFi websites registered through the domain provider Squarespace were targeted at the same time. Compound’s domain redirected to a page carrying a wallet drainer, and Celer Network said its domain monitoring caught the takeover before it succeeded, according to Cointelegraph. A DefiLlama developer posted a list of more than 100 DeFi protocols, Pendle among them, that were potentially exposed. No total loss figure was published in those reports.
The more common trap today is the search ad. On 26 May 2026 Cointelegraph reported a campaign of sponsored Google results that led to a copy of the Uniswap site. It had been flagged by an on-chain analyst known as b-block, and the scammers held at least $400,000, according to Cointelegraph’s report, the only account of that figure we found. The article does not say how each wallet was drained. A cloned site still needs something from its visitor, usually an approval or a signature, as in the Curve case.

The habits that follow from those cases are dull and effective:
- Bookmark the official address once, taken from the project’s documentation or official account, and open the DEX only from that bookmark.
- Never click a sponsored search result for a crypto app, even when the address shown looks right.
- Read the wallet’s preview: which contract you approve, how much, and whether a signature request grants a spending right.
- Pay attention to warnings from the wallet’s security checks; several wallets flag known malicious sites.
- Keep long-term savings in a different wallet, ideally on a hardware device, and be wary of signing on a hardware wallet that cannot display what you sign.
- When a protocol announces that its front end is compromised, stop using it and revoke the approvals you gave it.
If you have already signed something bad, speed matters more than diagnosis: revoke the approval, move what is left to a new wallet with a new seed phrase, and assume anyone offering to recover the funds for a fee is a second scam. Our guides on what to do after crypto is stolen and on avoiding crypto scams go through the steps.
What a DEX swap means for your taxes
A swap between two tokens feels like moving money around inside your wallet. Tax authorities in the United States and the United Kingdom see it as getting rid of one asset and acquiring another.
In the United States, the IRS digital assets page lists exchanging a digital asset for another digital asset among the transactions that call for answering Yes to the digital asset question on Form 1040. In practice each swap is a disposal of the token you give up: the gain or loss is the dollar value of what you received minus your cost basis in what you gave, and capital transactions are reported on Form 8949. Our guide to crypto taxes in the United States gives the details.
For UK taxpayers, HMRC’s Cryptoassets Manual lists exchanging tokens for a different type of token among disposals for Capital Gains Tax (CRYPTO22100), with gains computed in pounds sterling; the same manual pools each type of token separately. Our page on crypto taxes in the United Kingdom covers the allowance, rates and reporting.
Rules differ elsewhere. France, for example, defers tax on exchanges between crypto-assets without a cash balance (a sursis d’imposition), according to the French tax administration’s questions and answers, updated on 17 July 2026. Italy taxes crypto gains realised in 2026 at 33%, but its Agenzia delle Entrate treated swaps between crypto-assets with the same characteristics and functions as neutral in its circular 30/E of 27 October 2023; which pairs qualify, a swap into a stablecoin for instance, is a question for a local adviser. Whatever the country, a DEX sends you no statement: keep the transaction hash, the date, the amounts and the dollar value of each swap.
How to use a DEX safely: a routine before every swap
- Practise any new kind of trade on a testnet that your front end currently supports.
- Reach the DEX through your own bookmark, never from an ad or a link in a message.
- Use a separate wallet with limited funds for DEX activity.
- Paste the token’s contract address from the project’s official site or its CoinGecko page and compare it with the swap screen.
- Start with a small amount, and keep a little of the network’s gas token.
- Read price impact and the minimum received; keep slippage tolerance close to the app’s automatic setting.
- On Ethereum mainnet, send through a private RPC or an intent-based swap.
- Read every approval and signature request: spender, amount, expiry.
- Review and revoke approvals you no longer need, every few weeks.
- Record the transaction hash and the dollar value of the swap for your tax records.
The math behind pool prices and the deeper mechanics of MEV each get a later lesson of the DeFi path. Before then, the cheapest exercise is the one in this guide: one testnet swap, one swap of a few dollars on a layer 2, and one look at your approvals on Revoke.cash.



