Slippage Protection Auditor
When to Use
- Auditing DEX integrations, AMM interactions, swap operations
- User mentions: slippage, MEV, sandwich attack, front-running, deadline, minAmountOut, swap, Uniswap, Curve, Balancer
- Reviewing token exchange functions, liquidity operations, router integrations
- Analyzing price impact protection in DeFi protocols
Audit Workflow
IMPORTANT: Announce skill usage at the start of analysis
Begin with: "I'm using the audit-slippage skill to analyze this contract for slippage protection and MEV vulnerabilities..."
Identify swap/liquidity operations
- Search:
swap, addLiquidity, removeLiquidity, IUniswapV2Router, ISwapRouter
- Focus: minAmountOut parameters, deadline parameters, quoter usage
Check against vulnerability patterns
- Reference
reference.md for complete checklist
- Compare code against
example.md
Validate MEV exploitability
- Check access control first - grep for
onlyOwner|onlyAdmin|onlyGovernance modifiers
- Can non-privileged actors exploit via MEV?
- Can MEV bot sandwich attack?
- Calculate extractable value (% of trade)
- Check if protection exists elsewhere in call stack
- Downgrade severity if admin-only unless users affected by MEV
Generate report
- Use deliverable template below
- Include sandwich attack PoC
- Quantify MEV extraction potential
Core Vulnerability Patterns
See reference.md for full checklist. Key patterns:
- No slippage parameter (minAmountOut = 0) → 99%+ value extractable
- No expiration deadline (type(uint256).max) → delayed execution risk
- block.timestamp as deadline → zero protection
- Incorrect slippage calculation → wrong reference value
- Mismatched slippage precision → decimal scaling errors
- Hard-coded slippage → withdrawal failures during volatility
- MinTokensOut for intermediate amount → multi-hop unprotected
- On-chain slippage calculation → flash loan manipulation
- Fixed fee tier assumption → routing through wrong pool
- Slippage on token amount not USD value → market crash risk
- No slippage on liquidity ops → LP value extraction
- Flash swap repayment without slippage → overpayment risk
- Approval race on router upgrade → MEV via old router
Code examples: See example.md
Severity Criteria
Critical: Zero slippage on user-facing swaps, missing deadline, on-chain quoter-based minOut, MUST be exploitable by non-privileged actors
High: Hard-coded slippage preventing withdrawals, intermediate-hop-only protection, wrong fee tier (80%+ liquidity elsewhere), MUST be exploitable by non-privileged actors
Medium: Wrong decimal precision (user can retry), suboptimal routing, missing LP operation slippage, admin-only swap functions with cascading user MEV exposure
Low: Suboptimal slippage (token vs USD) in stable pairs, documentation issues, admin-only swap parameter issues without immediate user impact
IMPORTANT: Admin-only swap functions (onlyOwner, onlyAdmin, onlyGovernance) are MEDIUM or LOW severity unless:
- Admin swaps use user funds directly (e.g., fee collection selling user-deposited tokens)
- Missing slippage enables admin to extract value from protocol treasury holding user funds
- Admin swap parameters affect user swap routing or slippage calculations
False Positives - Do NOT Flag
- Zero slippage on internal protocol-to-protocol swaps (both sides controlled)
- block.timestamp deadline in keeper/bot functions with off-chain slippage enforcement
- Hard-coded slippage in emergency-only functions with explicit warnings
- On-chain quoter in view functions (display/estimation only)
- Fixed fee tier with documented single-pool targeting
- Admin-only swap functions (onlyOwner, onlyAdmin) swapping protocol-owned assets not derived from user funds
- Governance-controlled swaps with timelock allowing users to exit before execution
- Treasury management swaps where admin has no access to user deposits
Deliverable Format
MANDATORY: Before deliverable, verify each checklist.md item against codebase. Flag violations as findings.
Use template: templates/report-template.md
Each finding includes: severity, pattern #, file/lines, description, vulnerable code, impact (MEV extraction %), PoC with sandwich attack simulation, remediation, gas impact.
Key Principles
- User control - users specify slippage and deadline per tx
- Off-chain calculation - minAmountOut from off-chain or TWAP, never current block
- Final output protection - multi-hop must protect final amount, not intermediate
- Decimal awareness - account for token decimal differences
Output Guidelines
DO:
- Reference specific lines/functions
- Provide sandwich attack PoCs
- Quantify MEV extraction ($ or %)
- Include real-world exploit examples
DON'T:
- Flag view/pure functions (no state change)
- Report intentional designs without exploit path
- Use vague terms
- Ignore liquidity depth context
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: audit-slippage3description: Audits Solidity DEX integrations and smart contracts for slippage vulnerabilities enabling sandwich attacks including zero/missing minAmountOut parameters, block.timestamp or missing deadlines, on-chain slippage calculation via manipulable quoters, multi-hop swaps without final output protection, decimal precision mismatches between token pairs, hard-coded slippage preventing withdrawals during volatility, and fixed fee tier assumptions breaking when liquidity migrates Use when this capability is needed.4---56# Slippage Protection Auditor78## When to Use9- Auditing DEX integrations, AMM interactions, swap operations10- User mentions: slippage, MEV, sandwich attack, front-running, deadline, minAmountOut, swap, Uniswap, Curve, Balancer11- Reviewing token exchange functions, liquidity operations, router integrations12- Analyzing price impact protection in DeFi protocols1314## Audit Workflow1516**IMPORTANT: Announce skill usage at the start of analysis**1718Begin with: "I'm using the **audit-slippage** skill to analyze this contract for slippage protection and MEV vulnerabilities..."19201. **Identify swap/liquidity operations**21 - Search: `swap`, `addLiquidity`, `removeLiquidity`, `IUniswapV2Router`, `ISwapRouter`22 - Focus: minAmountOut parameters, deadline parameters, quoter usage23242. **Check against vulnerability patterns**25 - Reference `reference.md` for complete checklist26 - Compare code against `example.md`27283. **Validate MEV exploitability**29 - **Check access control first** - grep for `onlyOwner|onlyAdmin|onlyGovernance` modifiers30 - Can non-privileged actors exploit via MEV?31 - Can MEV bot sandwich attack?32 - Calculate extractable value (% of trade)33 - Check if protection exists elsewhere in call stack34 - Downgrade severity if admin-only unless users affected by MEV35364. **Generate report**37 - Use deliverable template below38 - Include sandwich attack PoC39 - Quantify MEV extraction potential4041## Core Vulnerability Patterns4243See `reference.md` for full checklist. Key patterns:44451. No slippage parameter (minAmountOut = 0) → 99%+ value extractable462. No expiration deadline (type(uint256).max) → delayed execution risk473. block.timestamp as deadline → zero protection484. Incorrect slippage calculation → wrong reference value495. Mismatched slippage precision → decimal scaling errors506. Hard-coded slippage → withdrawal failures during volatility517. MinTokensOut for intermediate amount → multi-hop unprotected528. On-chain slippage calculation → flash loan manipulation539. Fixed fee tier assumption → routing through wrong pool5410. Slippage on token amount not USD value → market crash risk5511. No slippage on liquidity ops → LP value extraction5612. Flash swap repayment without slippage → overpayment risk5713. Approval race on router upgrade → MEV via old router5859**Code examples:** See `example.md`6061## Severity Criteria6263**Critical:** Zero slippage on user-facing swaps, missing deadline, on-chain quoter-based minOut, **MUST be exploitable by non-privileged actors**64**High:** Hard-coded slippage preventing withdrawals, intermediate-hop-only protection, wrong fee tier (80%+ liquidity elsewhere), **MUST be exploitable by non-privileged actors**65**Medium:** Wrong decimal precision (user can retry), suboptimal routing, missing LP operation slippage, **admin-only swap functions with cascading user MEV exposure**66**Low:** Suboptimal slippage (token vs USD) in stable pairs, documentation issues, **admin-only swap parameter issues without immediate user impact**6768**IMPORTANT:** Admin-only swap functions (onlyOwner, onlyAdmin, onlyGovernance) are **MEDIUM or LOW severity** unless:69- Admin swaps use user funds directly (e.g., fee collection selling user-deposited tokens)70- Missing slippage enables admin to extract value from protocol treasury holding user funds71- Admin swap parameters affect user swap routing or slippage calculations7273## False Positives - Do NOT Flag7475- Zero slippage on internal protocol-to-protocol swaps (both sides controlled)76- block.timestamp deadline in keeper/bot functions with off-chain slippage enforcement77- Hard-coded slippage in emergency-only functions with explicit warnings78- On-chain quoter in view functions (display/estimation only)79- Fixed fee tier with documented single-pool targeting80- **Admin-only swap functions** (onlyOwner, onlyAdmin) swapping protocol-owned assets not derived from user funds81- Governance-controlled swaps with timelock allowing users to exit before execution82- Treasury management swaps where admin has no access to user deposits8384## Deliverable Format8586**MANDATORY:** Before deliverable, verify each `checklist.md` item against codebase. Flag violations as findings.8788Use template: `templates/report-template.md`8990Each finding includes: severity, pattern #, file/lines, description, vulnerable code, impact (MEV extraction %), PoC with sandwich attack simulation, remediation, gas impact.9192## Key Principles9394- **User control** - users specify slippage and deadline per tx95- **Off-chain calculation** - minAmountOut from off-chain or TWAP, never current block96- **Final output protection** - multi-hop must protect final amount, not intermediate97- **Decimal awareness** - account for token decimal differences9899## Output Guidelines100101**DO:**102- Reference specific lines/functions103- Provide sandwich attack PoCs104- Quantify MEV extraction ($ or %)105- Include real-world exploit examples106107**DON'T:**108- Flag view/pure functions (no state change)109- Report intentional designs without exploit path110- Use vague terms111- Ignore liquidity depth context112113---114> Converted and distributed by [TomeVault](https://tomevault.io/claim/auditmos) — claim your Tome and manage your conversions.115<!-- tomevault:4.0:skill_md:2026-04-14 -->