Skip to main content

How do I set slippage on an Enso route?

Pass slippage in basis points on the Route request and show expected and minimum output from the response. Do not also set minAmountOut.

J
Written by Javier Diaz

Pass slippage in basis points on the Route request, then show the expected and minimum output from the response. Do not also set minAmountOut.

Definition

Slippage is the tolerance between the quoted output and the worst fill you will accept. On Enso, you send that tolerance as slippage in basis points — for example, "50" for 0.5% — and the API calculates minAmountOut for you.

How it works

  • Choose a tolerance in basis points and include it in the quote request.

  • Review amountOut (expected) and minAmountOut (protected minimum) on the quote screen, along with priceImpact when it is present.

  • Submit the returned tx unchanged. Do not edit calldata to change the floor.

  • If the on-chain result would fall below the minimum, the transaction should revert. Request a fresh quote rather than raising slippage automatically without the user.

How Enso does this

On POST https://api.enso.build/api/v1/shortcuts/route, set slippage as a string in basis points, and do not send minAmountOut in the same request. Solana destination routes require slippage and reject an explicit minAmountOut, though the response can still include the calculated minimum. See DeFi and Swap Routing and the FAQ.

FAQ

Can I set both slippage and minAmountOut?

No. Use one or the other. If you need an exact floor on a route that accepts it, set minAmountOut alone.

What happens if slippage is too tight?

The transaction can revert on-chain even after a successful quote. Fetch a new quote and ask the user to review the updated minimum before they sign again.

Related articles

  • What is minAmountOut?

  • What is slippage in DeFi?

  • What if slippage is too tight and the swap reverts?

  • What is price impact?

  • How do I show a quote before the user signs?

Sources

Did this answer your question?