flash-loan-attacks

Analyze flash loan attack vectors in DeFi protocols and outline defense patterns.

120|12|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/ccashwell/evm-cortex --skill flash-loan-attacks-ccashwell
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: flash-loan-attacks
Source: https://github.com/ccashwell/evm-cortex/tree/main/skills/flash-loan-attacks
Command: npx skills add https://github.com/ccashwell/evm-cortex --skill flash-loan-attacks-ccashwell

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Flash loan attacks threaten DeFi protocols by enabling attackers to borrow large sums atomically and manipulate governance, oracles, and liquidity pools before returning the loan.

Core Features & Use Cases

  • Governance manipulation patterns and defenses (snapshot-based voting, voting delays, and thresholds).
  • Oracle manipulation patterns and defenses (TWAP oracles, multi-source feeds, stale price protection).
  • Liquidity pool manipulation patterns and defenses (deposit/borrow separation, multi-block delay).
  • Price impact sandwich tactics and defenses (slippage checks, deadlines, robust price feeds).

Quick Start

Assess flash loan risk in your protocol and implement defenses against governance, oracle, and liquidity manipulation.

Frequently Asked Questions about flash-loan-attacks

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

FAQPage Schema
How do flash loan attacks manipulate DeFi oracles and governance systems?

Flash loan attacks manipulate DeFi oracles and governance by borrowing large capital atomically to skew asset prices or pass malicious proposals before repaying the loan. Attackers exploit protocols lacking snapshot-based voting or robust price feeds to drain liquidity pools.

What is the best way to prevent oracle manipulation in DeFi protocols?

The best way to prevent oracle manipulation is implementing TWAP oracles, using multi-source price feeds, and adding stale price protection. These defenses prevent attackers from artificially inflating or deflating asset values within a single transaction block.

How do I implement defense strategies against flash loan governance manipulation?

Implement defense strategies against flash loan governance manipulation by adopting snapshot-based voting, enforcing voting delays, and requiring minimum proposal thresholds. These mechanisms prevent attackers from utilizing atomically borrowed tokens to instantly pass malicious governance decisions.

Does separating deposit and borrow actions across multiple blocks stop flash loan attacks?

Separating deposit and borrow actions across multiple blocks stops flash loan attacks by breaking atomic execution. Implementing multi-block delays and robust slippage protections prevents attackers from manipulating liquidity pools within a single transaction.

When should I use TWAP oracles instead of spot price feeds for DeFi security?

Use TWAP oracles instead of spot price feeds whenever your protocol handles large capital deposits or borrows. TWAP oracles average prices over time, neutralizing liquidity manipulation tactics like price impact sandwiches that exploit instantaneous spot price discrepancies.