Skip to the article
Crypto Daybook

Markets, chains and policy news

Chainflip slippage controls give integrators two price limits

Chainflip integrators can set a quote-based minimum, an oracle-based price limit and a refund deadline, then use the SDK’s quote recommendations to tune each swap.

Crypto Daybook Newsroom3 min read

Chainflip integrators can protect swaps with a minimum price, an optional live-price limit and a deadline for refunds. These controls give users a choice: wait for the trade to meet its price limit, or get the source asset back if it does not. Integrators need to set the limits when they request a deposit channel, so the protection applies to the swap rather than just the displayed quote.

For readers new to the route, this guide to how a Chainflip swap moves assets explains the basic flow. The slippage settings fit into that flow at the point where a user commits funds and the network attempts the trade.

How does Chainflip’s minimum price work?

The minimum price sets the least favorable execution price the user will accept, based on the quote. In Chainflip’s JavaScript SDK, an integrator can pass that limit directly as minPrice, or set slippageTolerancePercent and let the SDK calculate it from the quote’s estimatedPrice. The request must use one of those options, not both.

If liquidity cannot meet the minimum, the swap waits until the retry period ends. If the price still does not qualify, the deposit is refunded to the specified address on the source chain. That means the interface should explain both the limit and where a refund will go. It should also avoid presenting the quoted output as guaranteed: the minimum protects the user’s floor, while a worse quote or too-short retry window can mean no swap takes place.

What does live-price protection add?

Live-price protection compares the execution price with the asset pair’s global index price, an oracle-based reference price. It can help keep an execution competitive as the market moves after the quote. The quote may include a recommended live-price tolerance; the SDK only supports this control for pairs where that recommendation is available.

This is a separate check from the quote-based minimum. The minimum sets a floor against the original quote; the live-price setting limits how far execution can deviate from the index price. A swap must satisfy the applicable limits to execute. If the market moves beyond a limit, it can wait for a qualifying price until the deadline, then refund. The checks happen at the AMM level and do not include deposit or broadcast fees, so the displayed output should account for those fees separately.

How should integrators choose the settings?

Start with the values returned by the quote, then make the trade-offs clear to users. The SDK provides a recommended slippage tolerance and retry duration based on current market conditions. A wider tolerance can reduce refunds but accepts a less favorable price; a narrower one sets a firmer floor but can leave a swap waiting. Retry duration controls how long the network tries before refunding. One State Chain block is six seconds; the SDK also accepts the recommended duration in minutes.

  • Use the quote’s recommended tolerance as the initial minimum, rather than a fixed value for every asset pair.
  • Pass either a percentage tolerance or a direct minimum price, and either a retry duration in blocks or in minutes.
  • Show the refund destination and explain that a limit can prevent execution.
  • Enable live-price protection only when the quote supplies a recommendation for that pair.

For longer or split trades, a live-price limit can keep execution tied to current market conditions while the quote-based floor guards against an unfavorable move from the original estimate. The practical choice is to use the quote’s recommendations as defaults, then show the user what each limit can mean: execution at an acceptable price, or a refund after the wait.