Skip to main content

Can a TWAP Oracle Be Manipulated, and If So, What Are the Common Attack Vectors?

Yes, a TWAP oracle can be manipulated, although it is more difficult and costly to do so compared to a simple price oracle. The most common attack vector is to artificially inflate or deflate the price of an asset on a decentralized exchange (DEX) over a sustained period.

This can be achieved by executing a series of large trades to move the price in the desired direction. Another attack vector is to use a flash loan to borrow a large amount of capital and manipulate the price for a short period, although this is less effective against TWAP oracles with longer time periods.

What Is the Optimal Balance between a TWAP Oracle’s Lag and Its Resistance to Manipulation?
How Can a DeFi Protocol Detect and Respond to a TWAP Oracle Manipulation Attack in Real-Time?
Can a Difficulty Adjustment Be Manipulated?
How Can the Cost of Manipulating a TWAP Oracle Be Calculated?