Skip to main content

How Can a DeFi Protocol Detect and Prevent a Flash Loan-Induced Price Manipulation Attempt?

Protocols can implement checks that reject transactions where the price change between the current block and the previous block exceeds a certain threshold. They can also use "pre-flight checks" within the transaction to ensure the loan is repaid and the price is not drastically different at the end.

Utilizing TWAP oracles is the most robust preventative measure against single-block price spikes.

How Do Cross-Chain TWAP Oracles Attempt to Mitigate Manipulation Risks?
What Is a “Flash Loan” and How Is It Used in Conjunction with Oracle Manipulation?
What Is the Role of Time-Weighted Average Price (TWAP) in DeFi Oracles?
Can a Deviation Threshold Be Bypassed by a Flash Loan Attack?