Skip to main content

What Is a “Time-Weighted Average Price” (TWAP) Oracle and Its Anti-Front-Running Benefit?

A TWAP oracle calculates the price of an asset by averaging its price over a specified period of time. This method makes the price feed highly resistant to front-running and flash loan attacks.

Since a single, momentary price manipulation (like a front-runner's preemptive trade) will have a minimal effect on the long-term average, it becomes unprofitable for attackers to attempt to manipulate the price feed for a quick profit.

How Is a ‘Time-Weighted Average Price’ (TWAP) Used in Settlement?
What Is a Time-Weighted Average Price (TWAP) Oracle, and Why Is It Used in Derivatives?
How Does a TWAP Oracle Differ from a Volume-Weighted Average Price (VWAP) Oracle?
How Does a Time-Weighted Average Price (TWAP) Oracle Mitigate Flash Loan Attacks?