What Is the Trade-off between Using a Short TWAP Window versus a Long TWAP Window?
A short TWAP window (e.g. 5 minutes) provides a more up-to-date and responsive price, but it is more susceptible to manipulation and flash loan attacks.
A long TWAP window (e.g. 60 minutes) is much more resistant to manipulation, as the attack would need to be sustained for a longer period.
However, a long window means the price is less reactive to legitimate, sudden market movements.