Why your own trade moves the price
A DEX pool has no order book. It holds two reserves, and an AMM formula sets the price from their ratio. When you buy token B with token A, you add A to the pool and take B out. B becomes scarcer in the pool, so each next unit of B costs more, already during your own trade. The average price you pay ends up worse than the price the pool showed before you started.
The larger your trade is against the pool, the further the price moves. That is why the same $1,000 swap can cost 0.1% in a deep pool and 20% in a thin one. Price impact is a property of the trade and the pool, not of the market mood: it does not depend on what other traders do.
Price impact formula and a worked example
The classic pool type, which DeDust calls a volatile pool, uses the constant-product formula x × y = k. Leaving the fee aside, if you put in Δx of token X, you get Δy = y × Δx / (x + Δx), and the price impact is about Δx / (x + Δx): your trade divided by the reserve plus your trade.
Take a pool with 100,000 GRAM and 1,000,000 XYZ, so 1 GRAM buys 10 XYZ at the pool price.
- Swap 1,000 GRAM: you get 1,000,000 × 1,000 / 101,000 ≈ 9,901 XYZ instead of 10,000. Price impact ≈ 1%.
- Swap 10,000 GRAM: you get 1,000,000 × 10,000 / 110,000 ≈ 90,909 XYZ instead of 100,000. Price impact ≈ 9%.
The pool fee comes on top. Stable pools for assets of near-equal value, such as two dollar tokens, use a flatter curve and show much lower impact for the same size. Splitting a trade across several pools also lowers it, which is what a DEX aggregator does.
Price impact vs slippage
Slippage is the change in price between the quote and execution, caused by other trades and by time. Price impact is caused by your trade itself and is already in the quote.
- Known in advance? Price impact, yes: the quote shows it. Slippage, no.
- What it depends on. Price impact: your size against the pool's Liquidity. Slippage: Volatility and how busy the pool is.
- What protects you. Slippage tolerance caps slippage. Against price impact the only cure is a smaller trade, a deeper pool or a split route.
A 1% slippage tolerance does not stop you from losing 15% to price impact: the swap goes through at the quote you accepted.
How DYOR Swap shows and limits price impact on TON
DYOR Swap shows the price impact in the swap details before you confirm. It does not read the figure from one pool's reserves: it compares the dollar value of what you send with the dollar value of what the quote says you receive, both at DYOR's own token prices. So the number covers the whole route, takes in the pools' fees, and also catches a pool whose price has drifted away from the rest of the market. When DYOR has no price for one of the tokens, the details say "Unknown" instead of guessing.
Without Expert Mode, the swap stops at 15%: above it the warning reads "Price impact too high" and the button says High price impact instead of Swap. In Expert Mode you can set the Price impact threshold yourself: under 3%, under 5%, under 15% or your own value. Expert Mode comes with the note "Use at your own risk", and turning it off puts the threshold back to 15%.
To estimate the impact before you open the swap, look at the token's liquidity on its token page: the table below shows the TON tokens with the deepest liquidity, where large trades move the price least.