What is Slippage?
Slippage is the difference between the expected price of a trade and the actual execution price — caused by pool liquidity depth, trade size, and price movements between submission and execution.
WHY IT MATTERS
Slippage is the gap between what you expect and what you get. On a DEX, large trades relative to pool depth cause more slippage — the constant product formula means each unit bought raises the price of the next unit.
Slippage tolerance settings let you define the maximum acceptable deviation. If actual slippage exceeds your tolerance, the transaction reverts. Setting it too low means transactions frequently fail; too high means you accept worse prices.
Slippage protection is critical for agent-executed trades. Without proper limits, an agent might execute trades at terrible prices, especially in low-liquidity pools or during high volatility.
HOW POLICYLAYER USES THIS
PolicyLayer can enforce slippage limits on agent trades — ensuring agents don't execute swaps with excessive price impact. This protects against both accidental large-trade slippage and potential manipulation of low-liquidity pools.