DEX slippage: distinguish the quote, price impact, and tolerance

Bitcoins Rainbow / Knowledge library · Foundations · 2 min read

Three different comparisons

Price impact describes how your own trade changes the available execution price along a liquidity curve or route. Slippage compares expected execution with what happens as conditions change before execution. Slippage tolerance is the bound you authorize. These concepts overlap in user interfaces but answer different questions.

A displayed spot price is not necessarily executable for your entire order. Routing, fees, liquidity distribution, token transfer behavior, and competing transactions all matter. Review the final quoted output for the actual amount you plan to swap.

A hypothetical minimum output

Suppose a quote offers 1,000 output units and the user chooses a 1% tolerance. A simplified minimum-output calculation gives 990 units. If the route can only deliver 985 at execution, the contract should reject the trade under that bound rather than complete below it, subject to the actual router’s rules.

If the quote already includes substantial price impact, allowing 1% slippage does not limit the total difference from the pre-trade spot price to 1%. It permits additional movement relative to the quote. This distinction is crucial for large trades through shallow liquidity.

Field Question answered
Quoted output What does this route estimate now?
Price impact How does my size affect execution?
Minimum output What lower bound do I authorize?
Deadline How long may the instruction remain usable?

High tolerance creates exposure

Raising tolerance can make a transaction more likely to execute under changing conditions, while permitting a worse price. Publicly observable transactions can also attract strategies that profit from their ordering and permitted price movement. A successful receipt therefore does not establish that execution was economically favorable.

An extremely low tolerance can cause repeated reverts during volatile conditions. Included failed attempts may still consume network fees. The goal is a deliberate bound consistent with the trade’s purpose, rather than copying a universal number or repeatedly increasing tolerance until something passes.

Compare routes using net received value and all relevant costs. Splitting a trade can reduce impact in some settings but adds transactions and may change routing or information exposure. A smaller test trade can verify token behavior, though it does not establish the execution price available for a much larger order.

Swap review checklist

  • Verify input and output contract addresses and the correct network.
  • Compare quoted output, price impact, minimum output, and deadline.
  • Include approval and network charges in the total cost.
  • Read warnings about transfer fees or unusual token mechanics.
  • Recheck the quote if the transaction has been waiting or conditions changed.

After execution, compare actual token balance changes with the quote and receipt. Preserve the route and timestamp in research notes. This turns an impression such as “the swap was expensive” into a specific explanation involving impact, fee, movement, or token behavior.

Frequently asked questions

Does tolerance specify an extra fee?

No. It defines an execution boundary. The realized difference depends on the route and conditions; it is not automatically a payment to the exchange.

Can a reverted swap leave an approval active?

Yes. If approval succeeded in an earlier transaction, a later failed swap does not automatically undo that authorization.

Primary references

Further reading