Submitted by Trust, also found by shung and immeas
FeeHelper.sol#L58-L72
The volatile fee component in TJ is calculated using several variables, as described here. Importantly, Va (volatility accumulator) = Vr (volatility reference) + binDelta:
$v_a(k) = v_r + |i_r - (activeId + k)|$
Vr is calculated depending on time passed since last swap:
Below is the implementation:
The critical issue is that when the time since last swap is below filterPeriod, Vr does not change, yet the last swap timestamp (_fp.time) is updated. Therefore, attacker (TJ competitor) can keep fees extremely high at basically 0 cost, by swapping just under every Tf seconds, a zero-ish amount. Since Vr will forever stay the same, the calculated Va will stay high (at least Vr) and will make the protocol completely uncompetitive around the clock.
The total daily cost to the attacker would be  (TX fee (around $0.05 on AVAX)  + swap fee (0) ) * filterPeriodsInDay (default value is 1728) = $87.
Attacker can make any TraderJoe pair uncompetitive at negligible cost.
Add this test in LBPair.Fees.t.sol:
Manual audit, foundry
Several options:
I argue for HIGH severity because I believe the impact to the protocol is that most users will favor alternative AMMs, which directly translates to a large loss of revenue. AMM is known to be a very competitive market and using high volatility fee % in low volatility times will not attract any users.
Alex the Entreprenerd (judge) decreased severity to Medium and commented:
0x0Louis (Trader Joe) acknowledged and commented:
Alex the Entreprenerd (judge) commented:
