Skip to main content

What is slippage in DeFi?

Slippage is the allowed difference between the expected output and the minimum you will accept. In Enso, set it in basis points on the Route or Bundle request, and do not also set minAmountOut.

J
Written by Javier Diaz

Slippage is the allowed difference between the expected output of a trade and the minimum you will still accept. In Enso, you set slippage in basis points on the Route or Bundle request — for example, "50" is 0.5%. Do not also set minAmountOut; choose one protection method.

Definition

While a quote is built and then signed, prices can move. Slippage protection sets a floor under the output. If execution would fall below that floor, the transaction can revert instead of filling at a worse price.

How it works

  1. The routing API simulates the path and returns an expected output.

  2. You send a slippage tolerance in basis points, or an absolute minAmountOut.

  3. You show both the expected and the protected minimum to the user.

  4. If the user wants a different tolerance, requote; do not edit the returned transaction.

A tighter tolerance protects the user more and can fail more often in moving markets. Widen it only with the user’s consent.

How Enso does this

Set slippage (or minAmountOut) on POST https://api.enso.build/api/v1/shortcuts/route. The response includes simulated amountOut and, when available, minAmountOut. priceImpact is also returned from simulation. For Solana-destination routes, use slippage in the request; those requests do not accept minAmountOut, though the response can include a calculated minimum. See DeFi and Swap Routing and the FAQ.

FAQ

What is a basis point?

One basis point is 0.01 percentage points, so 50 bps is 0.5% and 100 bps is 1%.

What if the swap reverts on slippage?

Rebuild the quote, and increase slippage only with the user’s consent, or retry later. Do not remove protection.

Related articles

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

  • How do I set slippage on an Enso route?

  • Why did the transaction fail on-chain after I got a quote?

  • How do I add a same-chain swap to my app?

  • What if my quote expired?

Sources

Did this answer your question?