What Are the Best Practices for Setting the TWAP Time Period for Different Types of DeFi Applications?
For lending protocols, a longer TWAP period (e.g. 1-2 hours) is recommended to prevent flash loan-based price manipulation and wrongful liquidations.
For decentralized exchanges, a shorter TWAP period (e.g. 10-30 minutes) is more appropriate to ensure that the displayed prices are relatively close to the current market price.
For derivatives and synthetic asset protocols, a balance must be struck, often using a medium-length TWAP (e.g. 30-60 minutes) to balance accuracy with security.
The choice should always be guided by a thorough risk assessment of the specific application.