DeFi

Slippage Tolerance

Slippage tolerance is the maximum execution difference a user accepts between an expected quote and the actual on-chain result.

Slippage tolerance says how much worse the final result can be before the transaction should fail.

Slippage Tolerance Explained in Detail

Slippage tolerance is a bound on execution quality. For an exact-input swap, it is often amountOutMinimum. For an exact-output swap, it is often amountInMaximum.

The same idea applies to vault deposits, withdrawals, and share conversions.

Smart contract example

require(amountOut >= amountOutMinimum, "too much slippage");

The transaction reverts if execution is worse than the user's limit.

Slippage Tolerance in Auditing

Without slippage checks, users can receive worse execution after price movement, MEV, sandwiching, fees, or manipulated preview values.

Auditors check that user-facing flows include minimum output, maximum input, and a deadline where needed.

Red flags in code

  • amountOutMinimum is zero.

  • Exact-output swaps omit maximum input.

  • Vault deposits omit minimum shares.

  • Deadline is missing or effectively infinite.

  • Quotes are read from spot state and trusted after state changes.

How to test or review it

  • Move price between quote and execution.

  • Simulate sandwich-like transaction ordering.

  • Test minimum output and maximum input boundaries.

  • Check deadlines and recipients.

  • Apply the same thinking to vault shares and redemption assets.

Practice this in real audit scenarios

Definitions help, but auditors need reps. SCH turns concepts like Slippage Tolerance into exploit labs, code review habits, and report-writing practice.

Start the free trial or see the full smart contract auditing course.

Sources