Every trade on a decentralized exchange quotes a price. Sometimes the trade executes at that price. Often, it doesn't.
Slippage is the difference between the price quoted when you submit a swap and the price you actually pay when it executes. A market buy quoted at $1.00 that fills at $1.03 carries 3% slippage. That three-cent gap is what this article explains.
Two directions, one mechanism
Slippage runs both ways. Negative slippage means buyers pay more than quoted and sellers receive less. The market moved against the trade. Positive slippage delivers a better fill. The price shifted in your favor between submission and execution.
Centralized exchanges show slippage when the order book changes faster than your order reaches it. Decentralized exchanges show it for a different reason: every swap changes the pool's reserves, which changes the price. On a DEX, your trade is what moves the market against you.
How AMMs calculate the damage
Automated market makers run on a constant product formula: x times y equals k. Two token reserves multiply to a fixed number. When you buy token A by depositing token B, you add B to its reserve and pull A from its reserve. The product stays constant. The ratio shifts. That shift is the price.
An ETH-WBTC pool holds 86,000 ETH and 2,700 WBTC. Marginal price sits at 0.0314 WBTC per ETH. Sell 550 ETH into the pool. You receive about 17.2 WBTC. That is an average price of 0.0313 WBTC per ETH, slightly worse than the marginal price before your trade landed.
The first ETH you sold traded near the quoted price. The last one traded worse. Each successive token costs more because the pool gets more imbalanced with every unit you take.
A general rule: price impact approximates twice the trade size relative to the pool. A swap representing 1% of pool depth carries roughly 2% slippage. Ten percent of the pool? Twenty percent slippage, not ten. The math is nonlinear. Large trades pay exponentially worse prices.
Five causes, one core problem
Low liquidity sits at the center. A $10,000 swap barely moves a pool holding millions in reserves. The same trade wrecks a pool holding $50,000 total value locked.
Trade size relative to depth determines everything. Small trades in deep pools experience near-zero slippage. Large trades in shallow pools can slip 10% or more.
Rapid price movement during execution adds a layer. Between the moment you see a quote and the moment the transaction confirms, the market can shift. This matters more on congested networks where confirmation takes longer.
Pool routing quality affects the outcome on aggregators. A direct swap might offer 1% slippage. A route through three pools to reach the same pair might deliver 3% slippage because each hop takes a cut.
Then there is your slippage tolerance setting, which does not cause slippage but does control whether the swap completes at all.
The tolerance line between success and failure
Slippage tolerance is the maximum execution difference you accept before the transaction reverts. Set it at 0.5%, and if the market moves 0.6% against you between submission and execution, the swap fails. Set it at 5%, and the swap goes through even if you pay 4.8% more than quoted.
Tight tolerance protects against bad fills but causes failed transactions when the market moves faster than your setting allows. Loose tolerance guarantees execution and also opens the door to sandwich attacks.
No universal percentage works for every trade. Stablecoin swaps on Uniswap v3 can run at 0.05% tolerance because USDC-to-USDT liquidity sits in the billions and price variance stays near zero. A low-cap altcoin on a $200,000 pool needs 1% or higher just to complete the trade.
The context sets the number. Pool depth, token volatility, network congestion. If you set 0.1% on a thin pair during a volatile hour, the transaction fails. If you set 5% on any pair during any hour, you hand MEV bots a license to extract value.
Sandwich attacks turn slippage into theft
A bot scans the mempool and spots your pending trade. You are buying $50,000 of a token with slippage tolerance set at 3%. The bot front-runs you. It buys the token just before your transaction, pushing the price up. Your trade executes at the higher price. The bot sells immediately after, pocketing the difference.
You accepted 3% slippage. The bot delivered exactly 3% slippage. The transaction succeeded. You lost money to someone who contributed nothing.
Estimates place the hidden cost between 1% and 5% on vulnerable trades. Billions in annual value extraction flows to MEV operators. Not every slippage event is an attack. Many are. The larger your trade relative to pool liquidity, the more attractive you become as a target.
High slippage tolerance signals vulnerability. MintonFin's guidance: set the minimum viable slippage, even if it means failed transactions. A failed trade costs gas. A sandwich attack costs gas plus the entire slippage amount.
Eight ways to reduce the gap
Use liquid trading pairs. ETH-USDC on Uniswap carries far less slippage than an obscure token pair on a minor DEX. Depth matters more than fees.
Split large orders. Five $10,000 swaps slip less than one $50,000 swap. The pool has time to rebalance between trades if you space them out.
Avoid volatile periods. Network congestion and rapid price movement compound slippage. Trade during calmer hours when gas is low and fewer users compete for the same liquidity.
Tighten tolerance settings where the pair supports it. Start conservative. Raise it only when transactions fail repeatedly.
Route through aggregators that optimize across multiple pools. 1inch and Matcha scan dozens of liquidity sources to find the best composite price. A single pool might offer 2% slippage. An aggregated route across four pools might deliver 0.8%.
Use limit orders on platforms that support them. A limit order fills at your price or not at all. No slippage. The trade-off is execution uncertainty.
Check pool composition before trading. Some pools hold unbalanced reserves or suffer from impermanent loss that distorts pricing. Balanced, high-TVL pools offer better execution.
Monitor the mempool if you are sophisticated enough. Tools exist to see pending trades and adjust your strategy accordingly. Most users skip this step. Professionals do not.
Why transactions revert
The blockchain processes transactions in order. Between the time you submit and the time a validator includes your transaction in a block, other trades land first. Those trades move the price. If the price moves beyond your tolerance, the swap fails.
A transaction that reverts still costs gas. You paid the network to attempt the trade. The trade did not complete. The gas is gone.
This happens more often on congested networks, during high volatility, and with tight slippage settings. A 0.1% tolerance on Ethereum during a major news event will fail frequently. The same setting on a stablecoin pair during low activity might execute every time.
Failed transactions are not always bad. They prevent you from buying at a price you did not agree to. The alternative is acceptance: raise tolerance, accept worse fills, and risk becoming sandwich attack bait.
Math behind the percentages
Slippage as a percentage: subtract the expected price from the actual execution price, divide by the expected price, multiply by 100. A quote at $100 that executes at $103 is 3% slippage.
Price impact as a function of trade size: the constant product formula guarantees that each additional token costs more than the previous one. Selling one ETH into a pool barely moves the price. Selling 1,000 ETH into the same pool collapses it.
The relationship is not one-to-one. A trade worth 5% of pool depth does not produce 5% slippage. It produces closer to 10%. The curve bends upward.
Slippage is friction, not failure
Centralized exchanges hide slippage behind order books and market makers. Decentralized exchanges surface it. The cost exists either way. On a DEX, you see it. On a CEX, it gets absorbed into the spread.
Zero slippage is possible only in infinite liquidity. Real markets are finite. Every trade moves the market. The question is how much, and whether you controlled it or someone else exploited it.
Tight tolerance settings work with deep liquidity to produce predictable execution. Loose tolerance in shallow pools produces unpredictable costs. The setting is yours to control. The pool depth is the market's. Understanding that split determines whether slippage stays manageable or spirals out of control.