Liquidity providers in LendingPool do not earn any interest due to a logic error when burning rToken
The protocol uses liquidity index to track interest accrual in the lending pool, identical to how Curve finance does it. It works the following way:
User provides 100 USDC at index = 2 and receives 100/2 = 50 rUSDC
At index = 3 user has accrued 50% in interest and decides to withdraw
Withdrawal amount = rTokens * index = 50 * 3 = 150 USDC
However this model is not implemented correctly since liquidity providers receive the lent asset in a 1:1 ratio to their rToken
Let's observe RToken.burn
We can see that the input amount of rToken is burnt and also sent the same amount in USDC. Let's run a simple example:
LP deposits 100 USDC at index 2, receives 50 rUSDC
LP withdraws 50 rUSDC at index 3, receives 50 USDC when they should've received 150 USDC
LP lost 50 USDC from their own money and 50 USDC unpaid interest
The liquidity provider earned no interest but also lost funds
Loss of funds, broken core functionality
Use amountScaled in the safeTransfer method instead of amount
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.