Trading
Crypto swapping explained
Swapping refers to exchanging one cryptocurrency directly for another, without an intermediate step through euros or dollars. Where a traditional exchange often requires converting to a fiat currency or a stablecoin first, a swap function lets you move from, say, ether to another token in a single action. Behind that simplicity sits a mechanism of liquidity pools, routing algorithms and smart contracts that few users fully understand. We explain below how a swap comes together, why the final price sometimes differs from what you expected, and where the risks lie. It is not investment advice and does not recommend any specific platform or token.
What happens technically during a swap
On a decentralised exchange (DEX), a swap is not matched between a buyer and a seller as in a traditional order book. Instead, the exchange runs through a liquidity pool: a smart contract holding two (or more) tokens deposited by other users. When you deposit token A in exchange for token B, the ratio in the pool shifts and a mathematical formula automatically adjusts the price.
This approach is called automated market making (AMM). There is no counterparty specifically accepting your order; instead, the pool responds to the demand you add. The larger your swap relative to the pool, the more the price within that pool moves during the transaction itself.
Routing: why a swap sometimes passes through several pools
Not every token pair has its own deep liquidity pool. If you want to swap token A directly for token C but that pool has little liquidity, a swap interface may split the route automatically: first from A to a commonly used intermediate token such as a stablecoin, then from that intermediate token to C. This is called routing and usually happens automatically in the background.
Aggregators are services that search multiple DEXs and pools simultaneously to find the most favourable combination of routes. They can even split a swap across several platforms at once if that produces a better net result. The outcome is typically a better price, but also a slightly more complex transaction with more underlying steps and therefore often higher network fees.
- Direct pool: fastest, but only favourable with sufficient depth
- Split route via an intermediate token: often needed for less liquid pairs
- Aggregator: automatically compares multiple routes and platforms
Costs of a swap: network, platform and spread
A swap typically involves three types of cost. First, network fees (gas fees) paid to the blockchain network to process the transaction, regardless of which platform you use. These fees fluctuate with network congestion and can rise sharply on a popular blockchain during peak times.
Second, the liquidity pool itself usually charges a small percentage as compensation for liquidity providers, often between 0.01% and 1% of the swap. Third, the platform or interface may add its own service fee. Together, these three components determine how much you actually end up with compared to the price you initially saw.
Slippage settings and the confirmation screen
Before confirming a swap, almost every interface shows an overview with the expected amount of tokens you will receive, the minimum amount in case of adverse price movement, and an adjustable slippage tolerance. This tolerance determines how much deviation from the expected price you accept before the transaction is cancelled.
A tolerance set too low can cause your swap to repeatedly fail in a volatile market, while you still lose gas money on the failed attempt. A tolerance set too high exposes you to a significantly worse price or to so-called front-running, where a bot sees your transaction coming and profits from it. See the guide on slippage for a more detailed explanation.
Approving smart contracts: the approve transaction
Before a DEX can move tokens out of your wallet on your behalf, you usually need to sign a separate 'approve' transaction that grants the smart contract permission for a specific token. This is a separate step from the actual swap and also costs network fees.
Many wallets and interfaces offer a choice between an unlimited approval (convenient for repeated use, but riskier if the contract is ever found vulnerable) or an approval limited to exactly the required amount. For those who prefer caution, limiting approvals to the swap amount is a sensible habit, even though it requires a new signature for each subsequent swap.
Risks specific to swapping
Beyond market risk, swapping carries a few specific risks. Entering the wrong token address or selecting a counterfeit version of a popular token can result in swapping into a worthless token, especially when using lesser-known interfaces. Always verify the contract address through an official source before swapping a new or unfamiliar token.
There is also the risk of vulnerabilities in the underlying smart contract of the DEX or pool itself. Larger, longer-established protocols have typically undergone multiple external audits, which reduces but does not fully eliminate that risk.
Frequently asked questions
What is the difference between swapping and trading on an order book?
When swapping via an AMM pool, a formula determines the price based on the ratio between two tokens in a pool, without requiring a counterparty to match your order exactly. On an order book, as used by most centralised exchanges, buy and sell orders from users are matched directly against each other.
Why do I receive slightly fewer tokens than the initial estimate showed?
This is usually due to a combination of slippage during transaction processing, the pool fee, and any network fees deducted. The confirmation screen typically shows a minimum received amount that acts as a floor.
Is a swap always done through a decentralised exchange?
No, some centralised platforms also offer a 'swap' function that works internally through their own order book or liquidity, without you signing a blockchain transaction yourself. The underlying mechanism then differs from a DEX swap, even though it feels similar to the user.
Why do I need to sign an 'approve' transaction first?
This is a technical requirement of most token standards: a smart contract can only move tokens out of your wallet after you have explicitly authorised it. Without this approval, the swap transaction cannot be executed.
Can a swap be reversed if I make a mistake?
No, once a swap transaction is confirmed on the blockchain, it is final and irreversible. Always check the token address, amount and slippage setting before confirming.
Read next
What is a DEX?
A DEX is a decentralised exchange where you trade straight from your own wallet. How it works, what it costs, and the risks of slippage and fake tokens.
What is a liquidity pool?
A liquidity pool is a shared reserve of assets you trade against. How depth, slippage, fees and impermanent loss actually work.
Slippage and price impact
What is slippage, how does price impact arise with large orders, and how do you set a sensible tolerance? An explanation without investment advice.
Holding your own crypto
How to set up a self-custody wallet, store a seed phrase safely and decide when a hardware wallet is worth it. Practical guide, not advice.