Platform: Code4rena
Start Date: 14/10/2022
Pot Size: $100,000 USDC
Total HM: 12
Participants: 75
Period: 9 days
Judge: GalloDaSballo
Total Solo HM: 1
Id: 171
League: ETH
Rank: 35/75
Findings: 1
Award: $69.50
🌟 Selected for report: 0
🚀 Solo Findings: 0
69.4984 USDC - $69.50
https://github.com/code-423n4/2022-10-traderjoe/blob/79f25d48b907f9d0379dd803fc2abc9c5f57db93/src/LBPair.sol#L452 https://github.com/code-423n4/2022-10-traderjoe/blob/79f25d48b907f9d0379dd803fc2abc9c5f57db93/src/LBPair.sol#L453
The LBPair
contract's flashLoan
method allows borrowers to borrow funds in an atomic flashloan. The borrowed tokens must be returned along with a fee. This fee is however only distributed to liquidity providers of the currently active price range in the pair also referred to as "bin", that is despite the borrower being able to use funds deposited for other bins. Depending on the liquidity in the active bin a borrower could also atomically move the price to a price range in which they're the only liquidity provider to achieve a very low practical borrowing cost.
pendingFees
.Manual review.
Add global fee accumulator for tokens X and Y track fees accruing globally to all liquidity providers of a given pool. In the flashLoan
method update the global accumulator rather than the bin specific accumulator to ensure that the fee is fairly shared across all liquidity providers proportional to their contribution.
#0 - Shungy
2022-10-23T22:04:01Z
I find this finding to be valid.
Duplicate: https://github.com/code-423n4/2022-10-traderjoe-findings/issues/136
I believe it can be higher severity as the exploit path is practical and protocol fee loss is a loss. A finding can still be high risk without being critical.
Disclaimer: I submitted the same finding, hence increase of severity would benefit me.
#1 - GalloDaSballo
2022-10-26T17:02:55Z
#2 - c4-judge
2022-11-13T17:19:48Z
GalloDaSballo marked the issue as satisfactory
#3 - c4-judge
2022-11-16T21:50:20Z
GalloDaSballo marked the issue as not a duplicate
#4 - c4-judge
2022-11-16T21:50:50Z
GalloDaSballo marked the issue as duplicate of #136