Slippage
Set slippage tolerance, display minimum received and understand settlement.
Slippage tolerance limits how far execution may move against the prepared trade. Set it during preparation and display the signed minimum returned by the service.
Slippage and minimum received
10
0.1%
50
0.5%
100
1%
Pass the user's selected tolerance explicitly when preparing. The server returns the signed minimum in tx.amountOutMin / execution.plan.minAmountOut. Display this value in output-token units; do not deduct slippage from it again. If execution cannot satisfy the signed minimum, the swap reverts.
The setting is named slippageBps on swap(), swapAllowance() and swapPermit2(). The SDK accepts integers from 0 to 10000; omitting it leaves the service default in control.
Review the fresh expected output and signed minimum after every preparation. In Permit2, the minimum is validated against signed calldata after signing and build; see Delegated Swaps.
A lower tolerance limits adverse price movement but can cause more reverts; a higher tolerance permits a worse price. Never raise it automatically after failure. Changes require fresh preparation and, in Delegated mode, a new signature.
The API's exact-input formula applies to expected net recipient output after custom fees:
minAmountOut = expectedAmountOut * (10000 - slippageBps) / 10000
Use integer base units and multiply before dividing; division rounds down. For example, 1001 output units at 50 bps produce a minimum of 995 units. The SDK sends the setting unchanged and checks consistency of the response and signed calldata; it does not recompute this formula to enforce the requested tolerance. Display the returned signed minimum and compare it with the terms your application is willing to accept.
Slippage protection is separate from price impact, gas fees and custom fees. Do not deduct the fee again from the signed minimum.
Positive slippage
Positive-slippage treatment is bound through settlementPolicyHash. The SDK exports settlement-policy hashing utilities, but high-level prepared results do not provide a complete human-readable policy snapshot. Do not infer that all favorable price movement accrues to the recipient or derive the policy solely from a display quote.
Simulation reports userAmountOut for the chain state at the time of the call, not a guaranteed future or mined settlement amount.
See Fees for custom-fee settings and output amounts before and after fees.
Last updated
Was this helpful?