In LendingPool.sol, reserve asset depositors receive rTokens at a 1:1 ratio at deposit() function. These rTokens will accrue interest over time as mentioned in the documentation: [RToken](https://docs.raac.io/core/tokens/RToken)
However, when depositors withdraw their reserve assets, the burning of rTokens is also at 1:1 ratio. Depositors will not receive the accrued interest.
Assume this scenario whereby Alice deposited 10,000 crvUSD and is minted 10,000 rTokens via LendingPool.deposit(). After 1 month, Alice calls LendingPool.withdraw()to withdraw 10,000 crvUSD.
Reserve state is updated via ReserveLibrary.updateReserveState()
Ensure sufficient liquidity available via _ensureLiquidity()
Perform the withdrawal via ReserveLibrary.withdraw(), passing amount= 10000e18
In ReserveLibrary.withdraw(), reserve interests updated via updateReserveInterests().
Now, Rtoken is burned via RToken.burn(). Let's focus on these lines in RToken.burn()function:
Since amount passed = 10000e18, now in _burn(), 10,000 rTokens are burned.
10,000 crvUSD is safeTransfer to Alice.
As seen above, the rTokens of Alice's are burned at 1:1 ratio, instead of burning AmountScaled, which is derived as amount.rayMul(index)in Rtoken.burn()function.
All depositors will not receive their accrued interest as promised, and will experience loss of expected yield.
Manual
Burn AmountScaled rTokens instead of amount.
Alternatively, instead of having user to pass the amount of reserve asset to withdraw, logic can be updated to instead pass amount of rTokens to be burned. Function instead can calculate and safeTransfer the expected crvUSD that has accrued interest.
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.