defi-amm-security

Audit Solidity AMM contracts for reentrancy and oracle manipulation vulnerabilities.

1|Updated Apr 6, 2026
One-click install
npx skills add https://github.com/vrcms/everything-qwen-code --skill defi-amm-security-vrcms
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: defi-amm-security
Source: https://github.com/vrcms/everything-qwen-code/tree/main/.qwen/skills/defi-amm-security
Command: npx skills add https://github.com/vrcms/everything-qwen-code --skill defi-amm-security-vrcms

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the high-risk vulnerabilities inherent in decentralized finance (DeFi) automated market maker (AMM) contracts, preventing common exploits like reentrancy, oracle manipulation, and inflation attacks.

Core Features & Use Cases

  • Vulnerability Checklist: Provides a comprehensive review framework for swap, deposit, and withdrawal flows.
  • Hardened Patterns: Offers secure, industry-standard implementations for share math, slippage protection, and access control.
  • Use Case: Use this when auditing a new liquidity pool contract to ensure that internal accounting is protected against donation attacks and that all entrypoints follow the Checks-Effects-Interactions (CEI) pattern.

Quick Start

Use the defi-amm-security skill to audit the current liquidity pool contract for reentrancy and oracle manipulation vulnerabilities.

Frequently Asked Questions about defi-amm-security

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit a Solidity AMM contract for reentrancy and oracle manipulation vulnerabilities?

To audit a Solidity AMM contract for reentrancy and oracle manipulation, use a security checklist that verifies Checks-Effects-Interactions ordering on swap functions, validates manipulation-resistant oracle usage, and reviews internal share math accounting to prevent donation and inflation attacks.

What security checks are needed for liquidity pool deposit and withdrawal flows?

Security checks for liquidity pool deposit and withdrawal flows must verify slippage protection mechanisms, enforce access control on admin functions, and ensure share math is hardened against inflation attacks and donation exploits that drain pool reserves.

How does Checks-Effects-Interactions pattern prevent AMM smart contract exploits?

The Checks-Effects-Interactions pattern prevents AMM smart contract exploits by requiring all state changes and internal accounting updates to occur before any external token transfers, blocking reentrancy attacks from malicious swap or withdrawal callbacks.

When do I need manipulation-resistant oracle usage in DeFi swap functions?

Manipulation-resistant oracle usage in DeFi swap functions is needed whenever pool pricing relies on external price feeds, preventing attackers from artificially skewing spot prices within a single transaction to extract value from swaps or interconnected lending protocols.

Can I use this security checklist for auditing existing liquidity pool admin controls?

Yes, this security checklist audits existing liquidity pool admin controls by verifying that access restrictions on privileged functions are properly enforced, preventing unauthorized parameter changes or emergency withdrawals that could compromise protocol integrity.

What is the best way to harden AMM share math against inflation attacks?

The best way to harden AMM share math against inflation attacks is implementing industry-standard secure patterns that lock initial liquidity deposits, validate share calculations against donation vectors, and ensure internal accounting strictly tracks legitimate depositor balances.