anguss

What Is Swap Slippage and How Does Its Output Floor Work?

If you are wiring a swap into an app, minimum output is the on-chain floor that makes the transaction revert if execution would return too few tokens. It protects users from receiving less than the amount they accepted, but a reverted transaction can still consume gas.

What does minimum output actually guarantee?

For an exact-input swap, the user fixes how many tokens to spend and sets the least they will accept in return. The transaction succeeds only if the amount calculated during execution meets that minimum; a displayed estimate by itself provides no protection.

Keep price impact and slippage separate in your explanation. Price impact is the effect the trade itself has on the pool and is reflected in the quote; slippage is the further change that can happen after the quote while the transaction waits to execute.

For example, if a quote is 2,500 USDC and the accepted tolerance is 0.4%, the output floor is 2,490 USDC. The calculation is quoted output × (1 − tolerance); pass the result in the smallest token units, accounting for the token’s decimals.

How should an integrator calculate and enforce it?

Build the floor from the same fresh quote that you show the user, then encode it in the swap call’s minimum-output parameter. When integrating the SyncSwap crypto exchange, check that the selected route’s call data carries that floor; a UI label cannot enforce it. Refresh the quote if the user changes the amount, route, or tolerance.

Choose a tolerance that reflects the trade’s conditions, rather than raising it automatically whenever a transaction fails. The useful inputs are:

  • Pool depth relative to the trade size
  • Recent volatility in the token pair
  • Number of pools in the route
  • Time between quoting and submitting

For a payment flow, show the recipient’s required amount and compare it with the minimum output, not only the estimate. If the floor falls below the payment amount, request a fresh quote or ask the user to adjust the trade. Wider tolerance can improve fill rates, but it also allows a worse execution price.

On SyncSwap, inspect the router arguments and the transaction simulation your app presents before asking for a signature. If the call reverts at the output check, refresh the quote and recalculate the floor; do not silently loosen the user’s limit.

What should you decide before shipping?

Test both outcomes: a swap that clears the floor should complete, and one that would return less should revert. Make the floor visible beside the estimate so users can understand the trade-off before confirming.

Does the floor include the pool fee?

Calculate the floor from the quoted output your route returns, after any pool fees reflected in that quote. Do not subtract the fee a second time unless the quote explicitly excludes it. Your integration should use one consistent quote source for the displayed estimate and the minimum-output calculation.

How much tolerance should an app allow?

There is no safe universal percentage. A liquid, steady pair may work with a narrow setting, while a volatile or thin route may need more room to execute. Start conservatively, make the chosen tolerance visible, and let the user decide when a wider limit is acceptable.

What happens if execution misses the floor?

The swap reverts, so the user does not receive an output below the specified minimum. The failed transaction can still incur network gas, and the pool may have changed by the time the user tries again. Fetch a new quote and ask for a new signature rather than retrying stale call data.

Should the app retry with a wider floor?

No. A wider floor changes the price the user is willing to accept, so it requires renewed consent. Show the refreshed estimate and minimum, explain why the earlier attempt failed, and let the user choose whether to submit again. That keeps retry logic from changing the trade terms silently.