ThunderLoan::getCalculatedFee derives the fee from the borrowed token's WETH value, not from the borrowed amount:
The effective fee rate is therefore s_flashLoanFee * price / 1e18, i.e. 0.3% * (tokenPriceInWeth / 1e18). That equals the intended 0.3% only for a token trading exactly 1:1 with WETH. Every token priced below 1 WETH — every stablecoin, the in-scope USDC, and the vast majority of ERC20s — pays a fee far below 0.3%, so liquidity providers earn almost nothing on those markets. This is a formula-level design flaw, independent of the spot-price manipulation vector and independent of dust-amount rounding.
Likelihood: High
Applies to every allowed token not priced at ~1 WETH, on every flash loan — essentially all real tokens, with no attacker action required.
Impact: Medium
LP fee revenue is systematically undercharged (by ~3,300x for a dollar-priced token), undermining the protocol's core yield promise and mispricing the service.
For a token priced at 0.0003 WETH (a realistic dollar-ish token vs ETH), borrowing 100 tokens yields a fee about 3,300x smaller than the intended 0.3% — no manipulation, ordinary borrow size:
Charge the fee as a flat percentage of the borrowed amount (fee = amount * s_flashLoanFee / s_feePrecision), matching how flash-loan fees work elsewhere (e.g. Aave). If a value-denominated fee is genuinely intended, normalize by token decimals and drop the extra s_feePrecision division so the effective rate is a stable 0.3% regardless of the token's WETH price.
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.