amm-dex

Analyze AMM and DEX smart contracts for security vulnerabilities.

1|1|Updated Feb 18, 2026
One-click install
npx skills add https://github.com/Apegurus/solidity-argus --skill amm-dex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: amm-dex
Source: https://github.com/Apegurus/solidity-argus/tree/main/skills/protocol-patterns/amm-dex
Command: npx skills add https://github.com/Apegurus/solidity-argus --skill amm-dex

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses critical security vulnerabilities inherent in Automated Market Makers (AMMs) and Decentralized Exchanges (DEXs), helping developers build and audit more robust DeFi protocols.

Core Features & Use Cases

  • Vulnerability Identification: Detects common attack vectors like price manipulation, MEV exploitation, LP accounting flaws, and reentrancy.
  • Security Best Practices: Provides checklists and code examples for secure implementation of AMM features such as TWAPs, slippage protection, and LP token management.
  • Use Case: A developer building a new DEX can use this Skill to review their swap logic, ensuring that their implementation correctly handles slippage, maintains the k invariant, and is protected against common MEV strategies.

Quick Start

Use the amm-dex skill to review the security of the provided Uniswap V2-like contract.

Frequently Asked Questions about amm-dex

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

FAQPage Schema
How do I audit AMM and DEX smart contracts for security vulnerabilities?

To audit AMM and DEX smart contracts, you must analyze swap logic for price manipulation, MEV exploitation, LP accounting flaws, and reentrancy. This skill provides checklists and code examples to identify these attack vectors in protocols like Uniswap, Curve, and Balancer.

What are common security vulnerabilities in DeFi automated market makers?

Common security vulnerabilities in DeFi automated market makers include price manipulation, MEV exploitation, LP accounting flaws, and violations of swap invariants like the constant product formula. Reentrancy attacks specific to protocols like Uniswap and Balancer are also critical risks.

How do I prevent MEV and price manipulation in Uniswap V2-like contracts?

To prevent MEV and price manipulation in Uniswap V2-like contracts, implement slippage protection, use Time-Weighted Average Price (TWAP) oracles, and ensure swap logic correctly maintains the k invariant. This skill provides guidance on these secure implementation patterns.

Does this DEX security review cover Curve and Balancer protocols?

Yes, this DEX security review covers Curve and Balancer protocols. It analyzes protocol-specific swap invariants, LP accounting mechanisms, and reentrancy vectors inherent to these automated market makers, ensuring robust protection against targeted DeFi exploits.

What are the best practices for managing LP tokens and slippage in DEXs?

Best practices for managing LP tokens and slippage in DEXs include implementing robust slippage protection mechanisms, secure LP token accounting, and verifying swap invariant maintenance. This skill offers code examples and checklists to enforce these security patterns.