Uniswap

Uniswap price impact changes the quote that slippage limits protect

Uniswap price impact is the effect of your swap on pool prices, which shapes the quoted output for your selected amount and route. Slippage describes how execution differs from that quote as conditions change. Your tolerance sets a permitted boundary for adverse movement. Increasing tolerance allows a worse execution outcome without improving the liquidity behind the quote. For an exact-input pool swap, the important amount is the minimum output encoded in the transaction. A quote with substantial impact can still execute within a tight tolerance. An expired deadline or insufficient network balance requires a different correction from an output shortfall.

Updated ·

Trade size and the quoted exchange rate

Liquidity depth determines how strongly a swap amount moves prices along its route, while the quote expresses the average exchange rate for that complete trade. The starting pool price gives a reference rate before swap fees and the price movement caused by the trade. A larger swap progresses through prices as it exchanges one asset for the other. Its average rate can therefore differ from the starting rate. Keep the token direction consistent when comparing them: output tokens per input token and input tokens per output token are reciprocal measures.

Available liquidity also varies across prices. Concentrated liquidity supplies depth within chosen ranges, so total pool value does not describe every price interval equally. A trade that crosses into thinner liquidity can face a sharper deterioration in its remaining execution. This explains why changing the amount can materially change the quote. The relationship holds most clearly when the pool state and route stay fixed; a routing algorithm may select different pools for a different amount.

Pool fees affect quoted output alongside curve movement. A price chart or starting exchange rate cannot replace an executable quote for the selected amount.


Does price impact have to stay below slippage tolerance?

Price impact can exceed slippage tolerance because the quote already reflects the selected trade's effect on liquidity. The tolerance constrains subsequent adverse execution relative to that quote. Comparing the percentages directly mixes different baselines. A low tolerance can protect a poor quote just as strictly as a favorable one. Other contract checks still apply, and an interface may display a separate warning about the quoted impact.

Minimum-output arithmetic

Minimum received is an output-token floor for an exact-input swap, so its calculation starts with the quoted amount and the tolerance convention that the integration uses. Expected output describes the quote. Minimum output defines the lower execution boundary. Neither amount expresses the network cost of processing the transaction.

Fixed input

Let Q denote quoted output in integer token base units, and let s denote an output-reduction tolerance as a fraction between zero and one. An output-based tolerance gives the exact-input floor M = floor(Q * (1 - s)). The floor operation rounds the result down to a whole base unit.

Token precision

Token precision determines how raw base units translate into the readable token balance. Contract parameters use those raw units, while an interface may round its displayed amount. A shortened display can therefore hide a small difference near the boundary. The exact transaction value resolves that difference; the number of visible decimal places does not.

Tolerance basis

An adverse-price percentage uses a different denominator from an output-reduction percentage. If input tokens per output token may rise by a fraction t, the corresponding floor is floor(Q / (1 + t)). Price impact already sits inside Q; subtracting it again would double-count it. The displayed minimum and exact transaction parameter identify the applicable bound.

Fixed output

An exact-output swap sets an output target and a maximum input allowance. Its price protection limits the input needed for that target. In a v3 exactOutputSingle call, a nonzero pool price limit can allow less than the requested output. A custom integration requiring the full target must check the delivered amount. With sqrtPriceLimitX96 set to zero, that router requires the full requested output.


Rejection conditions and retry evidence

Router amount bounds reject execution when the checked output is too low or the required input is too high, subject to the selected swap mode. The v3 SwapRouter rejects an exact-input swap when its output falls below amountOutMinimum. Its exact-output methods check amountInMaximum. A deadline adds a separate validity condition: execution after the encoded timestamp fails even if the amounts would otherwise qualify.

Rejection conditions and retry evidence (Uniswap price impact)

View full-size image

Inspect the specific error, if available, to distinguish an output shortfall from an expired deadline, insufficient network funds, or another contract failure. Relevant retry evidence includes the attempted swap's status, encoded bound, current quote, and route. An output shortfall calls for comparing the fresh quote with the attempted minimum. An expired deadline requires a new transaction with a future deadline. Resolve insufficient balances or missing spending permissions before retrying. Widening tolerance addresses only the amount boundary and leaves unrelated failures unresolved.


Routing options and execution bounds

Trade-size and routing choices affect the quote, while amount bounds and deadlines control acceptable execution. Multi-hop routing uses intermediate pools; split routing distributes the trade across paths. Additional pool interactions can improve token output while adding fees and network work. An interface need not expose every control directly.

Table: Routing options and execution bounds
Option Effect on the swap Condition or limit
Smaller exact-input amount Reduces demand on the selected liquidity Compare with the same pool state and route
Multi-hop route Reaches liquidity through intermediate tokens Additional pool swaps add fees and network work
Split route Distributes the trade across different paths Each selected path needs usable liquidity
Exact-input output floor Sets the minimum checked output Execution rejects output below the bound
Exact-output input ceiling Caps input spending for the output target Execution rejects input above the bound
v3 pool price limit Limits how far the pool price can move An exact-input swap can leave input unspent
Transaction deadline Limits the submitted swap's validity Execution fails after the encoded timestamp
Routing changes the quote; amount bounds and deadlines constrain execution.

The v3 pool price limit operates inside a pool swap, separately from the router's output floor. A nonzero sqrtPriceLimitX96 can stop an exact-input swap before it spends all input. Integrations that collect input in advance must handle any unspent tokens. The router's minimum-output requirement still applies to the amount that the swap returns.

Splitting over time and transaction ordering

Separate sequential swaps revisit changing pool states, so smaller individual trades do not automatically improve the combined exchange rate. Without intervening liquidity or price changes, later trades continue along the pool's altered pricing curve. They also incur separate transaction costs. Routing a split trade across different liquidity paths is a different operation. Its potential benefit comes from distributing demand across additional available depth.

Transaction ordering can change the price before a pending swap executes. A sandwich attack surrounds a target swap with an attacker's trades to profit from manipulated execution prices. A wider tolerance can leave more room for an adverse fill within the accepted bound. A tight floor limits that room but can also increase rejection risk. The amount bound cannot establish that the underlying quote was economically attractive.


UniswapX minimums and pool-swap settings

UniswapX orders use their own execution terms, so the slippage settings for a conventional pool swap do not automatically apply to them. The Uniswap interface does not offer adjustable slippage for UniswapX swaps. Its displayed minimum describes the output boundary if the order fills; it does not promise a fill. Pool-swap tolerance arithmetic should not be carried unchanged into an order with different terms.

Uniswap price impact: reader questions

Is price impact an extra fee that Uniswap charges?

Price impact is a pricing effect, not a separate fee transferred to Uniswap. It changes the rate represented in your quote as the swap uses available liquidity. Pool fees and network costs have separate mechanisms. Adding a price-impact percentage to an already calculated token quote would count its effect again.

Do buy and sell quotes necessarily show the same price impact?

Buy and sell quotes can show different price impact because they concern different trade directions and input amounts. Each percentage belongs to a particular route and pool state. If both trades use the same pool, the purchase changes the state that the later sale encounters. Fees and intervening trades also affect the output available in the reverse direction.

Why can a zero minimum-output setting be dangerous?

A zero output minimum removes the router's positive lower bound on the tokens that the swap must return. Other contract checks can still apply, but this setting allows extremely unfavorable output to pass that particular check. A manipulated pool price can then produce a valid transaction with poor economic execution.

Does lower gas reduce the price impact of the same swap?

Lower network costs do not add liquidity or change the pool's pricing curve. They reduce a separate execution expense. Price impact can change while you wait because pool prices, available liquidity, or routing change. Any improvement in the quote comes from those changes, not from lower gas alone.

Will changing slippage settings update my pending transaction?

Changing interface settings does not rewrite the amount bounds inside an already-submitted transaction. A refreshed preview describes a new quote, while the pending swap still faces its original execution conditions. Its status and parameters matter when assessing whether another attempt is appropriate.

Can a price-impact warning identify a malicious token?

A price-impact warning identifies unfavorable quoted execution, not whether a token contract is malicious. Thin liquidity can produce high impact without establishing fraud. Token-risk warnings address separate issues, such as malicious code or impersonation. A low-impact quote likewise does not certify a token's behavior or the accuracy of those warnings.