How Does a Time-Weighted Average Price (TWAP) Oracle Mitigate Flash Loan Attacks on a Derivatives Contract?

A flash loan attack can temporarily manipulate the spot price on a DEX. A TWAP oracle mitigates this by calculating the average price over a period of time, rather than using the instantaneous spot price.

This averaging smooths out short-term, artificial price spikes caused by manipulation, making it much harder for an attacker to use a flash loan to trigger an unfair liquidation or settlement.

What Is the Role of ‘Time-Weighted Average Price’ (TWAP) Oracles in Mitigating MEV in Derivatives?
What Is a Volume-Weighted Average Price (VWAP) and How Does It Differ from TWAP?
How Does a Time-Weighted Average Price (TWAP) Help Defend against Price Feed Attacks?
What Are the Trade-Offs between Using a TWAP and a Volume-Weighted Average Price (VWAP) Oracle?
What Is a “Time-Weighted Average Price” (TWAP) Oracle and Its Anti-Front-Running Benefit?
How Does a Time-Weighted Average Price (TWAP) Oracle Mitigate Price Manipulation for Derivatives?
How Does a Time-Weighted Average Price (TWAP) Oracle Enhance Security?
What Is a Time-Weighted Average Price (TWAP) Oracle?

Glossar