The ThunderLoan function "getCalculatedFee" calculates the token value based on the AMM spot price, which is vulnerable to a flash loan attack. When the oracle price is manipulated, calling ThunderLoan's "flashloan" function can result in an exchange rate that is significantly higher than before. As a result, an attacker can redeem tokens to gain more profit.
Calculating a token's value based solely on the AMM protocol and without any known update method can be risky. To address this issue, consider the following steps:
Calculate the token's price using a reliable source. Implement a TWAP (Time-Weighted Average Price) oracle or utilize a Chainlink oracle for accurate price data.
Calculate the token value based on an anti-flashloan formula. Alpha Finance's formula, as outlined in their blog (https://blog.alphafinance.io/fair-lp-token-pricing), can serve as a valuable reference for ensuring fair LP token pricing.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.