HomeCybersecurityFlash Loan Oracle Manipulation

Flash Loan Oracle Manipulation (2D)

Interactive 2D simulation of a DeFi flash-loan attack: an attacker swaps borrowed funds through a constant-product AMM pool to spike its spot price, then borrows against inflated collateral from a lending protocol -- see how a TWAP oracle defeats it.

Cybersecurity2DAdvanced60 FPS📱 Mobile-adapted⇄ 3D version
2d-cybersec-topic-59 ↗ Open standalone

This 2D diagram recreates the core mechanic behind DeFi's most infamous exploits: a flash loan used to distort a constant-product AMM's spot price for one block, tricking a lending protocol's price oracle into over-valuing collateral. Watch the pool's reserve bars shift as the attacker's swap goes through, the lending vault release borrowed funds against the inflated price, and the pool settle back down after the repay swap — then switch the oracle from raw spot price to a genuinely-computed time-weighted average and see the same attack turn unprofitable, with a live numeric comparison of how much each oracle actually moved.

⚙ Under the hood

Interactive 3D simulation of a DeFi flash-loan attack: an attacker swaps borrowed funds through a constant-product AMM pool to spike its spot price, then borrows against inflated collateral from a lending protocol -- see how a TWAP oracle defeats it.

blockchainDeFiflash loanAMMprice oraclecybersecurity

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)