Concentrated Liquidity Manager Auditor
When to Use
- Auditing CLM protocols, Uniswap V3 position managers, liquidity management
- User mentions: CLM, concentrated liquidity, Uniswap V3, rebalance, TWAP, maxDeviation, position manager, liquidity deployment
- Analyzing liquidity rebalancing, TWAP protections, fee collection
- Reviewing router integrations, approval management
Audit Workflow
IMPORTANT: Announce skill usage at the start of analysis
Begin with: "I'm using the audit-clm skill to analyze this contract for concentrated liquidity manager vulnerabilities..."
Scan for CLM operations
- Search:
rebalance, mint, addLiquidity, TWAP, maxDeviation, twapInterval, router, approve, collectFees, protocolFee
- Focus: liquidity deployment, TWAP validation, approval management, fee updates
Check against vulnerability patterns
- Reference
reference.md for complete checklist
- Compare code against
example.md
Validate exploitability
- Check access control first - grep for
onlyOwner|onlyAdmin|onlyGovernance modifiers
- Can non-privileged actors exploit CLM vulnerabilities?
- Can liquidity be deployed without TWAP checks?
- Can owner manipulate TWAP parameters?
- Do rounding errors accumulate stuck tokens?
- Are old approvals revoked on router updates?
- Can fees be changed retrospectively?
- Verify no compensating protections exist
- Downgrade severity if admin-only unless enables rug pull or sandwich attack
Generate report
- Use deliverable template below
- Include sandwich attack analysis and PoC
- Rank by severity
Core Vulnerability Patterns
See reference.md for full checklist. Key patterns:
- Forced unfavorable liquidity deployment → missing TWAP checks in some functions allow sandwich attacks
- Owner rug-pull via TWAP parameters → setting ineffective maxDeviation/twapInterval disables protection
- Tokens permanently stuck → rounding errors accumulate tokens that can never be withdrawn
- Stale token approvals → router updates don't revoke previous approvals
- Retrospective fee application → updated fees apply to previously earned rewards
Code examples: See example.md
Severity Criteria
Critical: Missing TWAP checks in liquidity deployment enabling sandwich attacks, owner can disable TWAP protection to rug users, MUST be exploitable by non-privileged actors
High: Tokens permanently stuck from rounding errors, stale approvals allowing old router to drain funds, MUST be exploitable by non-privileged actors
Medium: Retrospective fee application on earned rewards, suboptimal TWAP parameters, admin-only rebalance configuration issues with cascading user MEV exposure
Low: Gas inefficiencies in rebalancing, missing events for parameter changes, admin-only parameter issues without immediate user impact
IMPORTANT: Admin-only CLM functions (onlyOwner, onlyAdmin, onlyGovernance) are MEDIUM or LOW severity unless:
- Admin can disable TWAP protection to sandwich user deposits/withdrawals
- Missing validation in TWAP parameter setters enables owner rug pull
- Admin router updates leave stale approvals allowing fund drainage
False Positives - Do NOT Flag
- Protocols with trusted admins explicitly documented
- Test environments with simplified TWAP logic
- Functions only callable by trusted contracts
- Intentional dust accumulation with withdrawal mechanism
- Manual approval management by governance
- Admin-only rebalance functions (onlyOwner, onlyAdmin) with TWAP checks and documented trusted operator
- Governance-controlled TWAP parameter updates with bounds validation (minDeviation, maxDeviation)
- Admin router updates that properly revoke old approvals before setting new ones
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, sandwich attack analysis, PoC, remediation.
Key Principles
- TWAP everywhere - all liquidity deployment must check TWAP
- Parameter bounds - maxDeviation/twapInterval must have min/max limits
- Zero dust - no token accumulation in contracts
- Approval hygiene - revoke old approvals before new ones
- Fee immutability - fees cannot change for earned rewards
Output Guidelines
DO:
- Reference specific lines and functions
- Provide sandwich attack scenarios
- Show PoCs with price manipulation
- Calculate rounding error accumulation
- Identify all liquidity deployment paths
DON'T:
- Report missing TWAP in view functions (not exploitable)
- Flag intentional dust with withdrawal mechanism
- Ignore parameter validation (critical for protection)
- Miss indirect liquidity deployment paths
1---2name: audit-clm3description: Audits Solidity concentrated liquidity manager (CLM) protocols for vulnerabilities including forced unfavorable liquidity deployment via missing TWAP checks, owner rug-pull via TWAP parameter manipulation, tokens permanently stuck from rounding errors, stale token approvals after router updates, and retrospective fee application on previously earned rewards (project)4license: MIT5---67# Concentrated Liquidity Manager Auditor89## When to Use10- Auditing CLM protocols, Uniswap V3 position managers, liquidity management11- User mentions: CLM, concentrated liquidity, Uniswap V3, rebalance, TWAP, maxDeviation, position manager, liquidity deployment12- Analyzing liquidity rebalancing, TWAP protections, fee collection13- Reviewing router integrations, approval management1415## Audit Workflow1617**IMPORTANT: Announce skill usage at the start of analysis**1819Begin with: "I'm using the **audit-clm** skill to analyze this contract for concentrated liquidity manager vulnerabilities..."20211. **Scan for CLM operations**22 - Search: `rebalance`, `mint`, `addLiquidity`, `TWAP`, `maxDeviation`, `twapInterval`, `router`, `approve`, `collectFees`, `protocolFee`23 - Focus: liquidity deployment, TWAP validation, approval management, fee updates24252. **Check against vulnerability patterns**26 - Reference `reference.md` for complete checklist27 - Compare code against `example.md`28293. **Validate exploitability**30 - **Check access control first** - grep for `onlyOwner|onlyAdmin|onlyGovernance` modifiers31 - Can non-privileged actors exploit CLM vulnerabilities?32 - Can liquidity be deployed without TWAP checks?33 - Can owner manipulate TWAP parameters?34 - Do rounding errors accumulate stuck tokens?35 - Are old approvals revoked on router updates?36 - Can fees be changed retrospectively?37 - Verify no compensating protections exist38 - Downgrade severity if admin-only unless enables rug pull or sandwich attack39404. **Generate report**41 - Use deliverable template below42 - Include sandwich attack analysis and PoC43 - Rank by severity4445## Core Vulnerability Patterns4647See `reference.md` for full checklist. Key patterns:48491. Forced unfavorable liquidity deployment → missing TWAP checks in some functions allow sandwich attacks502. Owner rug-pull via TWAP parameters → setting ineffective maxDeviation/twapInterval disables protection513. Tokens permanently stuck → rounding errors accumulate tokens that can never be withdrawn524. Stale token approvals → router updates don't revoke previous approvals535. Retrospective fee application → updated fees apply to previously earned rewards5455**Code examples:** See `example.md`5657## Severity Criteria5859**Critical:** Missing TWAP checks in liquidity deployment enabling sandwich attacks, owner can disable TWAP protection to rug users, **MUST be exploitable by non-privileged actors**60**High:** Tokens permanently stuck from rounding errors, stale approvals allowing old router to drain funds, **MUST be exploitable by non-privileged actors**61**Medium:** Retrospective fee application on earned rewards, suboptimal TWAP parameters, **admin-only rebalance configuration issues with cascading user MEV exposure**62**Low:** Gas inefficiencies in rebalancing, missing events for parameter changes, **admin-only parameter issues without immediate user impact**6364**IMPORTANT:** Admin-only CLM functions (onlyOwner, onlyAdmin, onlyGovernance) are **MEDIUM or LOW severity** unless:65- Admin can disable TWAP protection to sandwich user deposits/withdrawals66- Missing validation in TWAP parameter setters enables owner rug pull67- Admin router updates leave stale approvals allowing fund drainage6869## False Positives - Do NOT Flag7071- Protocols with trusted admins explicitly documented72- Test environments with simplified TWAP logic73- Functions only callable by trusted contracts74- Intentional dust accumulation with withdrawal mechanism75- Manual approval management by governance76- **Admin-only rebalance functions** (onlyOwner, onlyAdmin) with TWAP checks and documented trusted operator77- Governance-controlled TWAP parameter updates with bounds validation (minDeviation, maxDeviation)78- Admin router updates that properly revoke old approvals before setting new ones7980## Deliverable Format8182**MANDATORY:** Before deliverable, verify each `checklist.md` item against codebase. Flag violations as findings.8384Use template: `templates/report-template.md`8586Each finding includes: severity, pattern #, file/lines, description, vulnerable code, sandwich attack analysis, PoC, remediation.8788## Key Principles8990- **TWAP everywhere** - all liquidity deployment must check TWAP91- **Parameter bounds** - maxDeviation/twapInterval must have min/max limits92- **Zero dust** - no token accumulation in contracts93- **Approval hygiene** - revoke old approvals before new ones94- **Fee immutability** - fees cannot change for earned rewards9596## Output Guidelines9798**DO:**99- Reference specific lines and functions100- Provide sandwich attack scenarios101- Show PoCs with price manipulation102- Calculate rounding error accumulation103- Identify all liquidity deployment paths104105**DON'T:**106- Report missing TWAP in view functions (not exploitable)107- Flag intentional dust with withdrawal mechanism108- Ignore parameter validation (critical for protection)109- Miss indirect liquidity deployment paths