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.