Spookyswap

Spookyswap slippage: tolerance limits and failed swaps

Spookyswap slippage is the difference between a swap’s quoted price and its execution price. A tolerance setting limits the adverse change the transaction accepts. For a fixed-input swap, the minimum output expresses that limit in tokens. If execution can’t meet the minimum, the swap reverts. Raising tolerance allows worse execution without improving pool liquidity.

Price impact, a moving quote, and an expired transaction describe different problems. The relevant control depends on which one applies. Expected output and minimum output also serve different purposes, so the tolerance percentage alone doesn’t describe the trade.

Does a higher tolerance reduce price impact?

No, a higher tolerance expands the accepted execution range without reducing the price movement the trade itself causes. Price impact comes from exchanging an amount against the liquidity available along the pool’s price curve. The quote already reflects the estimated effect of that trade. Slippage tolerance allows additional adverse movement between the quoted conditions and execution. A swap can therefore meet its tolerance while carrying substantial price impact.

A smaller trade usually moves the same pool less, assuming unchanged liquidity and starting conditions. A different available route can also produce a different quote. Those changes affect pricing directly. Widening tolerance changes the rejection threshold, so it doesn’t repair a poor quote or turn shallow liquidity into deeper liquidity.

Quote movement before execution

The expected output can change when other trades alter the pools your swap uses before the network executes your transaction. Liquidity additions and removals can change those conditions too. The gap includes time spent reviewing the quote, authorizing tokens when necessary, and waiting for transaction inclusion. A fast network doesn’t freeze a pool’s price during that interval.

V3 liquidity depends on the price ranges providers choose. A trade can encounter different depths as it crosses those ranges. Total pool value alone doesn’t reveal the liquidity available along the trade’s path. Liquidity provision and farming incentives explain part of that supply, but a farm’s advertised reward rate isn’t a measure of the output your swap can obtain.

Graphic: Quote movement before execution (Spookyswap slippage)
Illustration: Quote movement before execution.

View full-size image

Refreshing a quote updates the estimate. It doesn’t reserve liquidity or amend a swap you’ve already signed.

Minimum received as an output floor

The minimum received amount sets the output floor for a fixed-input swap, while expected output describes the quoted outcome. A fixed-input V3 swap reverts when its output falls below the encoded minimum. Expected output reflects the route’s estimated price impact and trading fees. The router compares token amounts, so the displayed percentage must translate into a concrete transaction parameter. Review the minimum in the output token’s units; its value in another currency can move independently.

Let Q represent positive quoted output and M represent minimum output for the same input amount. The permitted quote-relative output shortfall equals (Q - M) / Q multiplied by 100%. This reads the displayed floor without assuming how an interface converts its tolerance setting. Replacing M with actual received output gives the realized quote-relative shortfall. Keep the token, input amount, and quote snapshot unchanged when making that comparison. Comparing different trade sizes or different routes measures more than execution movement.

How can I tell whether slippage caused a failed swap?

An output-limit error shows the swap couldn’t meet its minimum output, but doesn’t prove the quote changed before execution. A generic failure message doesn’t establish the cause. V2-style routers can report INSUFFICIENT_OUTPUT_AMOUNT. V3 SwapRouter02 uses Too little received for output below the specified minimum. The wording depends on the router, and interfaces may hide the underlying message. The transaction’s error details provide more specific information than a failed button click.

Deadline expiry rejects a transaction for arriving too late, even if its output would satisfy the minimum. Some calls carry the deadline around the swap in a multicall rather than inside the swap parameters. Missing spending permission, insufficient input balance, and token transfer restrictions can cause other failures. Raising tolerance doesn’t correct those conditions. An interface error before submission also differs from a transaction the network includes and then reverts.

A pending transaction has no completed swap output yet. Its identifier alone can’t establish successful execution or a slippage failure.

Spookyswap slippage: How can I tell whether slippage caused a failed swap? - diagram

View full-size image

Adjustments for price movement and their limits

When comparing adjustments, separate changes to the trade’s pricing from changes to the conditions it accepts. A smaller input can change price impact. A narrower tolerance raises the output floor for an unchanged fixed-input quote. Each option governs part of the swap, while the pool and network determine the remaining execution conditions.

At a glance: Adjustments for price movement and their limits
Adjustment Effect on the swap Limit of your control
Narrower tolerance Raises minimum output for the same quote. Pool pricing and liquidity remain unchanged.
Wider tolerance Lowers minimum output for the same quote. Token restrictions and other failure conditions still apply.
Fresh quote Recalculates expected output from updated pool conditions. An earlier signed swap retains its original parameters.
Smaller input amount Usually reduces price impact under unchanged pool conditions. Other transactions can still move the price.
Another available route Changes the pool path and can change liquidity depth and trading fees. Availability depends on the tokens, network, and routing support.
Wallet fee adjustment, where supported Can change transaction inclusion priority. It doesn’t guarantee success or change the signed output floor.
Postponing submission Avoids accepting the present quote. Future prices and liquidity remain uncertain.

Token compatibility across swap routers

A token’s transfer behavior can prevent execution even when a wider tolerance appears sufficient to cover its nominal transfer charge. Spookyswap V3’s standard routers don’t support fee-on-transfer tokens. A compatible wrapper or customized router would involve different behavior and requirements. V2 Router02 includes dedicated methods for fee-on-transfer swaps, but their existence doesn’t establish support in every interface or route. A token contract can also restrict selling, pause transfers, or reject particular addresses. Tolerance governs the accepted swap amount; it can’t override a token’s transfer rules.

Tolerance choices under volatile or thin liquidity

The acceptable minimum output provides a concrete basis for choosing tolerance, because it states the adverse execution outcome the swap permits. Tighter settings can reject smaller adverse movements. Wider settings accept a broader output range and can let a trade succeed at a materially worse price. Neither setting supplies missing liquidity. Compare available quotes using the same input amount, token contracts, and network so the comparison describes the same trade.

Where others can observe pending swaps and influence transaction ordering, a wide tolerance can leave more room for a sandwich attack. An attacker trades ahead of the swap to worsen its price and then trades afterward to profit. The output may still satisfy the transaction’s minimum. Narrowing tolerance limits acceptable deterioration but doesn’t establish comprehensive protection against ordering attacks. Market volatility, route depth, and execution delay prevent one percentage from fitting every swap.

Reverted swaps, gas costs, and final output

A reverted swap unwinds its token exchange, while the network still charges for the computation the included transaction used. Repeated failed attempts can therefore consume native gas funds without producing output tokens. A separately completed token approval also remains effective after a later swap reverts. These costs and permissions belong to different transactions; the failed exchange doesn’t undo them.

Visual outline: Reverted swaps, gas costs, and final output (Spookyswap slippage)

View full-size image

The final received amount belongs to the successful transaction, not whichever quote the interface displays afterward. Transaction status and token transfers distinguish execution from submission. A displayed market value adds another variable because the output token’s price can change independently. Slippage tolerance limits an execution condition at the time of the swap. It doesn’t fix the token’s value after settlement or compensate for earlier failed attempts.

Where does an unused slippage allowance go?

An unused slippage allowance goes nowhere because tolerance isn’t a prepaid charge. It defines the adverse execution the transaction may accept. A swap doesn’t automatically deduct the full allowance from its output. Pool trading fees and network gas have separate mechanisms, regardless of whether execution uses any of the permitted tolerance.

Can a swap deliver more tokens than its quote?

A fixed-input swap can deliver more tokens than quoted if pool conditions move favorably before execution. Its minimum-output condition sets a floor rather than a ceiling. The transaction’s actual output records that outcome; a later refreshed quote doesn’t show what the completed swap received.

Is zero slippage tolerance a guarantee of the quoted output?

Zero tolerance doesn’t guarantee a swap will complete. It leaves no allowance for adverse movement under the interface’s calculation, so a small unfavorable change can cause rejection. Other requirements still apply, including available liquidity, spending permission, and any deadline the call enforces. Token precision also affects the encoded threshold.

Does changing tolerance alter my token approval allowance?

Changing tolerance doesn’t change an ERC-20 token approval allowance. The allowance specifies how much the approved spender may transfer. For a fixed-input swap, the output limit specifies the minimum tokens the exchange must return. Modifying either condition doesn’t automatically modify the other.

How does tolerance work when I specify the output amount?

An exact-output router call bounds the input it may spend rather than reducing the specified output target. V2-style routers and V3 SwapRouter02 both support maximum-input limits. That contract capability doesn’t establish every interface’s available modes, so the transaction’s selected swap method determines which limit applies.

Could rounding explain a small mismatch between tolerance and minimum received?

Rounding and percentage conventions can explain small differences between displayed tolerance and minimum output. Routers use integer token amounts, while interfaces may shorten decimal displays. Some calculations bound adverse price movement using a reciprocal ratio rather than subtracting a percentage directly from output. The encoded token amount determines the enforceable floor.

Will clearing wallet activity cancel a pending swap with an old tolerance?

Clearing local wallet activity doesn’t cancel a transaction the network already knows about. It can remove the wallet’s record of the pending swap without changing the signed transaction. That swap can still execute under its original conditions until it completes, fails, or a valid replacement supersedes it.

Are V3 range orders governed by the same setting as market swaps?

A V3 range order uses a liquidity position and a chosen price interval, so market-swap tolerance alone doesn’t describe its execution. The position exchanges assets as the pool price crosses its range. If the price reverses before withdrawal, its composition can change again. Liquidity creation and withdrawal can have their own amount limits.

- updated