Uniswap V2 TWAP Oracle
Uniswap V2 stores cumulative prices.
If you subtract two cumulative values and divide by the time elapsed, you get an average price, not a manipulable spike.
🔐 Why this stops flash-loan
• Prices are averaged across multiple blocks
• Single-tx manipulation doesn’t move the oracle
• Attacks must be sustained over time → capital-inefficient