The depositors of reserve assets (crvUSD) in the LendingPool do not earn any interest in their deposits. This is in stark contrast to the documentation which suggests that a "user's deposit in the Reserve Pool accrues interest over time".
Depositor deposits x amount of reserve assets --> Depositor waits till a lot of interest is accrued --> Depositor withdraws the reserve assets but receive only the amount they originally deposited.
Depositors deposit reserve assets (crvUSD) into the LendingPool and receive RTokens. The docs mention the following point:
The RToken is an implementation of the interest-bearing token for the RAAC lending protocol. It represents a user's deposit in the Reserve Pool and accrues interest over time using an index-based system similar to Aave's AToken.
This is not the case because as we will learn, the depositor will only get back the tokens they have deposited without gaining any interest in the deposits.
To understand this, let's look at the sequence of actions a depositor will take.
Firstly, they will deposit their tokens using the deposit function:
This function calls the ReserveLibrary::deposit function as follows:
Code 1 shown above transfers the reserve asset from the depositor into the contract, and line 2 calls the RToken::mint function. Let's look at the mint function below:
As shown above in line 3, the amount of RTokens minted is the amount variable passed directly into the mint function. The amount in turn is equal to the amount of reserve asset (crvUSD) tokens transferred into the contract.
As time passes, the depositor would want to withdraw their tokens using the withdraw function. The LendingPool::withdraw function calls the ReserveLibrary::withdraw function:
This function calls the RToken::burn function as shown below:
Let's look at the burn function above in more detail, we have the following observations:
Line 1 gives the total RTokens owned by the user.
Line 2 gives the actual amount of reserve assets the depositor needs to receive.
Line 3 burns the amount of RTokens of the user.
Line 4 transfers the reserve assets to the user. But the amount transferred is the amount and not the amountScaled.
Therefore, the amount of RTokens burned is equal to the amount of reserve assets transferred to the user. This transfer does not include any interest earned by the depositor.
The major impact of this is that none of the depositors receive any form of interest. The LendingPool only serves as an account with 0% interest but with additional risks of possibly losing all their investments.
Manual Review
The amountScaled should be transferred instead of the amount in the RToken::burn function.
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.