Treasury swap slippage: set a floor through execution
Set a treasury swap’s minimum price from its quote, then give the protocol enough time to find liquidity that meets it. The useful decision is not “how much slippage is normal?” but how far execution may move from the estimate before you prefer a refund to a worse fill.
A quote is a reference, not an execution promise.
For a cross-chain swap, the deposit must be confirmed on its source chain before validators can witness it and trigger execution. During that wait, prices and available liquidity can change; for a multi-pool route, each leg adds another point where the realised output may differ from the estimate.
Chainflip’s JIT AMM gives liquidity providers time to update range and limit orders before a witnessed deposit is swapped. That competition can improve execution, but the final pool price is not known when you initiate the transfer. A quote therefore helps set your acceptance floor; it does not guarantee the floor will be met.
For a treasury operator, the floor should reflect the instruction’s purpose. If the swap must deliver at least a defined amount to fund another transaction, use that amount as the constraint. If execution is opportunistic and a short delay is acceptable, a tighter floor can make a refund preferable to converting at a price the treasury did not intend to accept.
Use the two protections for different price risks.
Minimum-price protection compares execution with the quote. In the JavaScript SDK, you can set slippageTolerancePercent, which derives the minimum from the quote’s estimatedPrice, or provide minPrice directly. These options are mutually exclusive: use the percentage when the quote is your reference, and an explicit minimum when the treasury instruction already specifies a hard output floor.
Get Tommy Defi’s stories in your inbox
Join Medium for free to get updates from this writer.
Live-price protection compares execution with the global oracle price instead. It is available only for asset pairs whose quote supplies a recommendedLivePriceSlippageTolerancePercent; when available, it can stop a swap whose pool execution has drifted too far from the index even if the original quote has also become stale. The quote-relative and oracle-relative percentages have different reference prices, so treating them as interchangeable can quietly weaken the control.
In practice, I’d start with the quote’s recommended slippage tolerance, retry duration, and — where offered — live-price tolerance, then compare those values with the treasury’s own maximum acceptable loss. The SDK accepts tolerances from 0 to 100 percent, but that range is an input constraint, not a sensible operating range. A 0.5% tolerance is a useful illustrative setting for arithmetic, not a universal recommendation: pair volatility, trade size, route depth, and execution delay determine the right value.
Choose a retry window that matches the decision.
The retry duration says how long the protocol may wait for execution to satisfy the protection before refunding the deposit. State Chain blocks are six seconds each, so 100 blocks is ten minutes; the SDK also accepts a duration in minutes and provides a quote’s recommendedRetryDurationMinutes. A short window limits how long treasury capital is tied up, while a longer one gives liquidity providers more time to offer an acceptable price.
For example, suppose a quote estimates 0.25 BTC from a fixed input and the treasury accepts 0.5% quote-relative slippage. The floor implied by that percentage is 0.24875 BTC before considering costs charged outside the AMM layer. If that floor is missed, the swap can wait within its retry window; if it is still missed at expiry, the source asset is refunded rather than swapped below the minimum.
The common mistake is to set a tight minimum and a very short deadline, then interpret the refund as a failed protocol rather than an unmet instruction. Fix that by deciding first how long the treasury can wait and how much price movement it will accept, then setting the retry duration and floor together. A longer window does not make the floor looser; it changes the time available to meet it.
Check the refund path and the costs outside the floor.
The protection is checked at the AMM level; deposit and broadcast fees, as well as broker fees, are outside that price check. A result that clears the AMM floor can therefore still deliver less net value than a treasury’s all-in estimate. Include those charges when deciding the economic minimum, and confirm the refund address is valid on the source chain before depositing.
For native Chainflip swaps, these controls matter because the protocol moves native assets across chains while execution waits for source-chain confirmation and liquidity updates. One edge case is live-price protection: an unsupported pair may reject that parameter, so only pass it when the quote supplies its recommendation. For DCA swaps, the minimum applies per chunk; earlier chunks may complete even if a later chunk is refunded.
Before acting, ask yourself: if this swap has not met its price floor by the deadline, would a refund still be better for the treasury than accepting a worse fill?




