← All posts
GUIDES

Price impact vs slippage vs positive slippage, with worked numbers

TT
Tirio Team · 8 min read

Price impact comes from your own order, slippage from other people's trades. A worked pool example shows what each one costs and how to set your tolerance.

Swap interfaces show "price impact" and ask for a "slippage tolerance" on the same screen, and the two get mixed up all the time. They are different costs with different causes. One is decided by the size of your order before you sign. The other is decided by what other people do between your signature and the block your swap lands in. A third, positive slippage, is the pleasant case where the market moves your way, and what happens to it depends on the service you use.

The clearest way to see the difference is to run all three through one pool with real arithmetic.

The pool

Take a classic constant-product pool, the design Uniswap popularised and PancakeSwap V2 uses on BNB Chain. It holds two tokens and keeps the product of the two balances constant through every trade:

x × y = k

Our example pool holds 1,000 BNB and 770,000 USDT, so the spot price is 770 USDT per BNB. It charges a 0.25 % fee on the input, as PancakeSwap V2 pools do. When you sell a BNB, the fee is taken first and the rest moves the balances along the curve:

amountInWithFee = a × 0.9975
amountOut       = 770,000 × amountInWithFee / (1,000 + amountInWithFee)

The Uniswap V2 whitepaper describes the curve, PancakeSwap documents its 0.25 % V2 fee, and its V2 router on BNB Chain applies exactly this formula in integers, as 9975 out of 10000.

Price impact: the cost of your own size

Sell into that pool at three sizes:

You sellYou receiveAverage priceBelow spot
1 BNB767.31 USDT767.310.35 %
10 BNB7,604.89 USDT760.491.24 %
100 BNB69,840.87 USDT698.419.30 %

Every row pays the same 0.25 % fee. The rest of the shortfall is price impact: each BNB you add makes BNB cheaper in the pool, so the later parts of your order sell at worse prices than the first. For a constant-product pool, impact before fees is close to a / (x + a). Ten BNB against a thousand gives 10 / 1,010, about 0.99 %, which is what the table shows once you take the fee out.

Three things follow from this:

  • Impact is known before you sign. It depends on the pool's depth and your size, both of which are visible. A good interface shows it next to the quote.
  • Impact grows faster than linearly with size. Going from 10 to 100 BNB made the average price nine times worse relative to spot, not ten times the cost of the first row.
  • You can reduce it by spreading the order. Two pools of half the depth, each taking half the order, give the same result as one deep pool. Put all 10 BNB into just one of those half-size pools and you get 7,530.52 USDT, about 74 USDT less. This is the main job of an aggregator, and our post on how aggregators split routes goes further into it.

Slippage: what happens after you sign

You decide to sell 10 BNB and the quote says 7,604.89 USDT. You sign. Your transaction now waits to be included in a block, and in that time someone else may trade in the same pool.

Suppose another trader sells 2 BNB into the pool just before you. The pool now holds more BNB and less USDT, so your 10 BNB fetch 7,574.75 USDT, 0.40 % less than quoted. That difference is slippage. Nothing about your order changed. The pool did.

Your slippage tolerance is the line you draw in advance. With 0.5 %, the transaction carries a minimum:

minimum received = 7,604.89 × (1 − 0.005) = 7,566.87 USDT

The 7,574.75 fill is above it, so the swap goes through. If the other trader had sold 3 BNB instead, your fill would have been 7,559.75 USDT, 0.59 % below the quote and under your minimum. The contract would revert the whole transaction. You would keep your 10 BNB and pay only gas.

A number line of possible outputs for selling 10 BNB: the quote at 7,604.89 USDT, the minimum received at 7,566.87, a fill of 7,574.75 that passes, a fill of 7,559.75 below the minimum that reverts, and a better fill of 7,635.15 above the quote.
Illustrative pool of 1,000 BNB and 770,000 USDT with a 0.25 % fee, selling 10 BNB at 0.5 % slippage. Fills come from other trades landing first.

Choosing a tolerance

There is no universal right number, only a trade-off:

  • Too tight and ordinary market movement makes swaps fail. Each failure costs gas and time, and you may end up retrying at a worse price.
  • Too loose and you accept fills far below the quote. It also tells a sandwich bot how much room it has. A bot can buy before you and sell after you and take up to your tolerance. Our post on sandwich attacks on BNB Chain explains how that works.
  • Liquid pairs such as BNB against major stablecoins usually do fine at 0.1 % to 0.5 %.
  • Thin or volatile tokens may need more, and tokens with a transfer tax need room for the tax on top. More on that in our guide to taxed tokens.

On tirio.io the default is 0.5 %, with presets of 0.1 %, 0.5 % and 1 %. The app warns from 5 % upward, and below 0.05 % it warns that the swap may revert if the price moves at all.

Positive slippage: when the market moves your way

Slippage can also go in your favour. Suppose that instead of selling, the trader ahead of you buys about 2 BNB from the pool with 1,540 USDT. The pool now holds less BNB and more USDT, and your 10 BNB would fetch 7,635.15 USDT, about 30 USDT (0.40 %) more than the quote.

Who gets that 30 USDT is a policy decision of the service that built your swap, and policies differ. Some pass all of it through. Some keep part of it.

Tirio keeps part of it, and you should know exactly how much. On a sale of an exact amount whose output token has no transfer tax, the swap's output passes through Tirio's Router, which compares it with the quote. Anything above the quote is kept by the Router up to 1 % of the quoted output, and only the part beyond that cap reaches you. In this example the 30 USDT excess is well inside the 1 % cap of about 76 USDT, so if this swap ran through Tirio you would receive the quoted 7,604.89 USDT. If the output comes in below the quote, the shortfall is yours down to your minimum. Buy (exact-out) swaps and taxed tokens are not affected. The details are in our overview.

The practical effect: on those swaps, the Tirio quote is close to the most you will receive, so judge it as such.

The three side by side

Price impactSlippagePositive slippage
Caused byyour order sizeother trades before yoursother trades before yours
Known before signingyesnono
You control it withorder size, splittingslippage tolerancethe service you choose
Worst caseshown in the quoteyour minimum receivedyou receive the quote

A few habits that help

  • Read price impact before anything else. Above 1 % on a pair you thought was liquid, try a smaller amount and compare.
  • Set tolerance for the token, not out of habit. Tight for liquid pairs, looser for thin or taxed tokens, and never far looser than you need.
  • Compare minimum received across services at the same tolerance, as well as the expected output.
  • Check the receipt. The amount that reached your wallet is on chain, and it is the only number that cannot be argued with.

The glossary defines these terms in one place, and our guide on reading a swap quote walks through a live quote line by line.

KEEP READING