For recurring treasury swaps, set slippage as a hard loss bound on each transaction, calibrated to the pair’s observed quote-to-inclusion movement and the business cost of a failed payment. Keep the bound tight for deep stablecoin markets, widen it only when measured volatility or execution delay justifies the risk, and re-quote before retrying a failed swap.
- Slippage tolerance sets the minimum output for a fixed-input swap; it does not remove price impact already present in the quote.
- Use basis points, pair-specific limits and a maximum quote age instead of one permissive global percentage.
- On failure, pay the gas cost as an execution expense, refresh the route and check transaction status before sending again.
Set the floor from the pair’s execution behavior
Choose the tolerance from observed adverse movement between quote generation and on-chain inclusion, then cap it at the treasury’s maximum acceptable execution loss. A practical starting policy might allow 10–30 basis points for a deep stablecoin pair and 50–100 basis points for a more volatile pair, but these are test bands, not universal safe values.
Budgeting for what ParaSwap swap integration costs is a procurement decision; the slippage floor is a per-trade risk limit. For treasury flows, I would measure quote-to-inclusion movement by chain, pair, trade size and time-to-inclusion, then set limits from a high percentile of adverse movement while keeping a separate hard ceiling. ParaSwap is relevant here because route selection can change with trade size, so a tolerance calibrated for a small test swap may be wrong for a payout batch.
Translate basis points into a minimum receipt
For a fixed-input swap, the contract must receive at least the quoted output multiplied by (10,000 minus tolerance in basis points) divided by 10,000. With a quoted receipt of 50,000 USDC and a 30-basis-point tolerance, the minimum is 49,850 USDC; a lower result reverts the swap rather than delivering a worse fill.
On ParaSwap SDK transaction builds, slippage is expressed in basis points: 50 means 0.50%, not 50%. Keep the input amount fixed for a sell, pass the tolerance when building the transaction, and inspect the resulting minimum output before signing; for a fixed-output buy, the corresponding bound limits the maximum input instead.
Separate price impact from execution slippage
Slippage tolerance covers movement after the quote, while price impact is already reflected in the quoted amount. Raising tolerance does not improve a poor route; it permits execution farther below that route’s quoted receipt, potentially exposing the swap to adverse ordering or a sudden liquidity change.
For example, if a scheduled payout batch quotes 50,000 USDC with 0.8% price impact and the treasury’s maximum total loss is 1%, a 100-basis-point tolerance is too loose: it can permit the full additional 1% movement after the quote. I would first reduce the batch size or compare routes, then set a tighter execution bound that leaves room for measured inclusion movement within the remaining loss budget.
Re-quote after expiry or a failed transaction
Set a short quote-age policy and discard the route when it exceeds it; a 10–20 second maximum can be a reasonable initial configuration for a busy production flow, subject to measured latency on the target chain. A transaction deadline is a separate on-chain expiry, and should be long enough for normal inclusion but short enough to prevent execution against stale assumptions.
If the transaction reverts at the minimum-output check, the swap did not occur, but the sender still spent gas. Check the receipt and nonce before retrying: a pending transaction may still execute, while a confirmed revert needs a fresh quote, a newly built transaction and a new risk check. Treat repeated failures as a signal to pause that pair or batch size and recalibrate from execution data.
A reliable treasury policy makes slippage a measured per-pair loss limit and refreshes the quote whenever execution conditions change.