Skip to main content

Slippage

Slippage tolerance protects you from receiving significantly less than expected due to price movements during transaction execution.

Overview

When bridging tokens, the actual amount received may differ from the quoted amount due to:
  • Market price fluctuations
  • Liquidity depth changes
  • Transaction delays
Slippage tolerance sets the maximum acceptable difference between quoted and received amounts.

Slippage Constraints

The SDK enforces strict slippage boundaries:

Preset Values

Common slippage values for quick selection:

Setting Slippage

In Constructor (Default)

Set a default slippage for all quotes:
The constructor uses decimal format (0.005 = 0.5%) for backward compatibility, while quote parameters use percentage format (0.5 = 0.5%).

Per-Request Override

Override slippage for individual quotes:

Quote Response Fields

The quote includes slippage-related information:

Example Output

For a 100 USDC bridge with 0.5% slippage:

Slippage Selection Guide

For stable pairs (USDC/USDT):
Stablecoin bridges typically experience minimal price movement.

Building a Slippage Selector

Error Handling

The SDK throws InvalidSlippageError for out-of-range values:

Slippage and Price Impact

Slippage tolerance is different from price impact:
If price impact exceeds your slippage tolerance, the transaction will revert. Consider increasing slippage or reducing trade size for high-impact trades.

Best Practices

  1. Start with 0.5% - The default works for most transactions
  2. Use presets - 0.1%, 0.5%, 1.0% cover common scenarios
  3. Increase for large trades - Larger trades may need higher slippage
  4. Consider market conditions - Volatile markets need higher tolerance
  5. Warn on high values - Alert users when slippage exceeds 1%

React Example

Next Steps

Quotes

Generate quotes with slippage

Execution

Execute transactions