mizazhaider-ceh/agentarsenal/defi-threats
Claude Code and agent skill by mizazhaider-ceh/agentarsenal
- community
Checking that the SKILL.md file is still in the repository.
Use when assessing DeFi protocols for economic and technical
Install
npx vskill@latest install mizazhaider-ceh/agentarsenal/defi-threatsSKILL.md
The same SKILL.md was published earlier as mizazhaider-ceh/agentarsenal/defi-threats.
DeFi attackers do not break code, they break assumptions: that prices are fair, that liquidity is deep, that voters are honest. This skill covers authorized assessment of DeFi threat models: mapping the economic assumptions, testing them on forks, and reviewing the mitigations. Test on local mainnet forks, never against live protocols.
Quick Workflow
- Map the money flows: deposits, borrows, swaps, liquidations, and
fees, with the contracts involved.
- List every external dependency: oracles, DEX pools, and other
protocols it composes with.
- Identify the economic assumptions: price sources, liquidity depth,
and honest majority assumptions.
- Test flash loan attacks on a fork: borrow, manipulate, profit,
repay, all in one transaction.
- Test oracle manipulation: move the price source and see what the
protocol does.
- Review MEV exposure: can transactions be sandwiched or frontrun for
profit.
- Check governance: can an attacker buy votes and change the rules.
- Report each broken assumption with the fork test that broke it.
1. Fork based testing setup
2. Oracle manipulation test pattern
3. Flash loan attack surface checklist
Edge cases
- The fork drifts from mainnet state. Pin the block number and note
it; results are valid for that state.
- Mitigations exist but have parameters (TWAP window, deviation
thresholds). Test the boundary values, not just the happy path.
- The protocol is upgradeable. Economic review must cover the admin's
power too, not just the current logic.
- Composability: the protocol is safe alone but dangerous combined
with another protocol's feature. Test the composition.
Escalation
- Attack unprofitable on the fork due to gas or slippage: compute the
capital threshold where it becomes profitable and report that.
- Logic too complex for manual review: use symbolic execution or
fuzzing (Foundry invariant tests) on the critical invariants.
- Governance risk found: hand to dao-governance-risks for the deep
review.
Detection and defender view
DeFi defenders monitor mempools for attack transactions, oracles for deviations, and admin actions for surprises. They defend with TWAP oracles, borrow caps, pause mechanisms, and bug bounties sized to the TVL. The durable lesson from every major DeFi hack is that economic assumptions need the same rigor as code: document them, test them adversarially, and monitor them live.
Key references
- SWC Registry: oracle and access weaknesses.
- Major incident post mortems: oracle manipulation case studies.
- Flash loan attack literature and mitigations.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/blockchain/defi-threats/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/mizazhaider-ceh/agentarsenal/defi-threats)