Skip to main content
The slippage guard puts a floor under an op’s output: output ≥ simulated × (10000 − bps) / 10000, where simulated is the value the compile’s simulation measured. If the output at execution is lower, the transaction reverts. For a resource output, the compile result reports the floor as amount.minimum (basis guard). A handle output is checked on chain but reports no minimum.

When to use it

Attach it to an output that has no floor of its own: lifi.zap amountOut, a core.call result graduated with core.asResource, or the Uniswap ops’ liquidity port. Don’t attach it to lifi.swap or lifi.bridge: their amountOut already carries a minimum (providesMinimum: true), so set slippage in the op’s config instead. A guard on such a port, or on a future output, fails the compile with guard_error. For other bounds, see the guard catalog.

Config

Example

Deposit 1,000 USDC into Aave v3 and revert unless at least 99% of the simulated aEthUSDC arrives:
See Build a same-chain flow for interpreting guard failures and choosing tolerances.