Slippage
Display the signed minimum net output and preserve the accepted transaction through execution.
Slippage tolerance
Slippage is the difference between the quoted and executed outcome as market conditions change. Price impact describes how the trade itself affects the price through available liquidity. A slippage limit does not bound price impact, remove trading fees or guarantee a successful transaction.
The SDK’s slippageBps is an integer from 0 to 9999, with a default of 50. Pass it in the swap or prepareDelegatedSwap request, then display and confirm the returned terms.
Tolerance
slippageBps
0.1%
10
0.5% (SDK default)
50
1%
100
A lower tolerance allows less deterioration but can cause more reverts. A higher tolerance permits worse execution. Let users make that choice explicitly; do not raise it automatically after a failure. The SDK default is not a recommendation for every token or market.
Minimum net output
Apply the tolerance after the aggregator custom fee. Underlying pool, curve and Hook fees are already reflected in the route output. All amounts are token base units; calculate with bigint and round down at each division.
const grossOutput = 1003n;
const customFeeBps = 333n;
const slippageBps = 50n;
const customFee = grossOutput * customFeeBps / 10000n; // 33
const expectedNetOutput = grossOutput - customFee; // 970
const minimumNetOutput = expectedNetOutput * (10000n - slippageBps) / 10000n; // 965For this example the expected net output is 970 units and the minimum is 965. At small amounts, rounding by one base unit can materially affect the displayed percentage; always show the minimum in token units as well as the chosen tolerance. Fees and tolerance are separate settings; see Fees for the current fee policy and allocation.
Preserve the confirmed result
The quote and signed minimum returned by swap() belong to the same transaction. Display prepared.expectAmountOut, prepared.tx.amountOutMin, recipient and fee terms before confirmation. Submit that accepted result without another quote request.
For delegated swaps, show prepared.expectAmountOut and BigInt(prepared.raw.amount_out_min) from prepareDelegatedSwap() before the payer signs. The SDK validates the built transaction against these prepared terms. Retain the full prepared object unchanged through signing and build.
A new result can have different amounts even with the same tolerance. If the plan expires, call swap() again (or prepare and sign again for delegated execution), display the replacement terms and obtain new acceptance. Do not silently replace a confirmed plan or lower its minimum.
Invalidate confirmation whenever tokens, amount, accounts, recipient, network, routing, fees or tolerance change. Never rewrite signed calldata.
Amount direction
Arc Aggregator currently supports fixed-input swaps only. The input amount stays fixed, while the slippage limit protects the minimum output the user receives.
Failure and settlement
A minimum-output failure stops the swap; a reverted on-chain transaction can still consume gas. Refresh the quote and let the user reconsider the trade. If submission timed out, resolve the existing transaction before retrying.
The minimum is a lower bound, not the amount guaranteed to be received. Show the actual output after a successful receipt, keeping expected output, minimum output and settled output distinct. See Transaction Safety for validation, expiry and receipt handling.
Last updated
Was this helpful?