Skip to the article
Onchain Brief

News from across crypto

Price impact vs slippage: how a swap’s cost changes

Price impact vs slippage: price impact sets the quoted cost; slippage is later pool movement your tolerance allows. See how each changes swap output.

The Onchain Brief Editors3 min read
Price impact vs slippage: how a swap’s cost changes

Price impact vs slippage comes down to when the cost changes: price impact shapes your quote, while slippage is the further movement your tolerance allows before execution.

How price impact and slippage change your quote

Price impact is the price move your own trade causes in a pool. In a constant-product pool, the reserves follow x × y = k. For reserves x and y, adding Δx of one token returns y·Δx/(x+Δx) of the other before fees. The output is lower than it would be at the starting pool price because your trade changes the reserve balance.

Say you sell 1% of a pool’s x reserve. The formula gives an output about 0.99% below the starting-price estimate, before fees. That is price impact, and it is already reflected in the quote you see before signing. A deeper pool or smaller trade reduces it.

Slippage is a later change: other trades can shift the pool after you receive a quote but before your swap executes. Slippage tolerance sets how far the output may fall from that quote. On SunSwap, the swap screen shows price impact and a minimum received derived from your tolerance. Before signing, compare those figures; for context on who controls the swap and keys, read how SunSwap handles swaps and keys.

If the quote is Q and tolerance is t, minimum received = Q × (1 − t). Since Q already includes price impact, the minimum is not based on the starting pool price. A 1% tolerance trims the quoted output by another 1%. Against the starting market price, the worst-case shortfall is approximately impact plus tolerance; more exactly, the two reductions compound. Raising tolerance does not reduce impact. Only a smaller trade or deeper pool does.

The distinction matters when deciding what to change: high impact means the trade is large for that pool; a wide tolerance means you accept more movement after the quote. A tight tolerance can make a swap fail if the pool moves too far, while a loose one allows a lower output.

Related questions

The fee and front-running can affect the amount you receive, but they are not the same thing as price impact.

Is the swap fee included in price impact?

The fee is a separate cost from the reserve-driven price impact. The formula above shows output before the fee; the actual quote can reflect both the fee and price impact. Read the fee and output figures separately where the swap screen shows them.

Does front-running cause slippage?

Front-running can cause slippage when another trade executes ahead of yours and changes the pool before your swap. Your tolerance sets the maximum output drop you accept; if the move exceeds it, the swap fails.

What to do before a SunSwap swap

Use the quote to judge price impact, then use minimum received to judge the execution floor your tolerance permits.

What slippage tolerance should I set on SunSwap?

Set a tolerance that allows for expected movement while keeping minimum received acceptable to you. A tighter setting limits the output drop but can cause a revert if the pool changes before execution.

Why does SunSwap warn about high price impact?

High impact means your trade would move the pool price substantially at the quoted size. Check the pool depth and consider lowering the trade amount before signing.

Does splitting a large trade reduce price impact?

Smaller trades can have less impact per swap, but splitting does not guarantee a better total output: the pool can move between trades, and fees may apply to each. Compare the combined expected output before choosing.