Tooluck logoTooluck
SKILL.md

defi-attack-patterns

Agent skill fromyaklang/hack-skills

DeFi attack pattern playbook. Use when analyzing flash loan attacks, price oracle manipulation, MEV sandwich attacks, governance exploits, bridge vulnerabilities, and token standard edge cases in decentralized finance protocols.

How to install defi-attack-patterns

install defi-attack-patterns
# install the hack-skills pack with the skills CLI
npx skills add yaklang/hack-skills

# or add only this skill to Claude Code: copy the folder

skills/defi-attack-patterns/

# into

~/.claude/skills/defi-attack-patterns/ (all projects)

.claude/skills/defi-attack-patterns/ (one project)

skills/defi-attack-patterns/SKILL.md

MITFull file
1# SKILL: DeFi Attack Patterns — Expert Attack Playbook
2
3> **AI LOAD INSTRUCTION**: Expert DeFi exploitation techniques. Covers flash loan mechanics, oracle manipulation (spot vs TWAP), MEV extraction (sandwich, JIT, liquidation), precision loss attacks, governance exploits, bridge vulnerabilities, and token standard pitfalls. Base models often miss the single-transaction atomicity constraint of flash loans and the distinction between spot price and TWAP manipulation.
4
5## 0. RELATED ROUTING
6
7- [smart-contract-vulnerabilities](../smart-contract-vulnerabilities/SKILL.md) for underlying Solidity vulnerability patterns (reentrancy, integer overflow, delegatecall)
8- [deserialization-insecure](../deserialization-insecure/SKILL.md) when targeting off-chain bridge relayer or indexer infrastructure
9
10---
11
12## 1. FLASH LOAN ATTACKS
13
14### 1.1 Mechanism
15
16Flash loans provide uncollateralized borrowing within a single transaction. The entire borrow → use → repay cycle must complete atomically; if repayment fails, the transaction reverts as if nothing happened.
17
18| Provider | Max Amount | Fee |
19|---|---|---|
20| Aave V3 | Pool liquidity per asset | 0.05% (can be 0 for approved borrowers) |
21| dYdX | Pool liquidity | 0 (uses internal balance manipulation) |
22| Uniswap V3 | Pool liquidity per pair | 0.3% (swap fee tier) |
23| Balancer | Pool liquidity | Protocol-configurable |
24
25### 1.2 Price Oracle Manipulation
26
27```
281. Flash borrow 100,000 WETH
292. Swap 100,000 WETH → TOKEN on AMM_A
30…

Excerpt shown under the repository's MIT license.

More skills in hack-skills

Keep exploring

Similar skill repositories

thedotmack /

claude-mem
116k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

CCCXGHGM+135 skills

pbakaus /

impeccable
108k

The design vocabulary for your coding agent. Steer with polish and bolder, review with critique and audit, catch AI slop before it ships.

2 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates