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
-
amountOutMinimumis 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.
Keep learning this topic
Slippage
Slippage is the difference between the expected trade price and the actual execution price, often caused by liquidity, volatility, or transaction ordering.
Sandwich Attack
A sandwich attack is a front-running pattern where an attacker places one transaction before and one after a victim trade to profit from the victim's price impact.
Deadline
A deadline is an expiry timestamp or block condition after which a signed action, swap, permit, or operation is no longer valid.
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.