Missing update totalUsage timely when lenders deposit funds into the lending pool. This will cause the incorrect utilization rate and borrow rate.
In LendingPool, users deposit funds to earn some interest. In deposit, the total liquidity will increase because of the deposit. So we need to trigger updateInterestRatesAndLiquidity
to update the latest utilization rate/borrow rate/liquidate rate. In the next time period, we will use the updated currentUsageRate/currentLiquidityRate to calculate the borrowers' interest.
The utilization rate is related with totalLiquidity
and totalUsage
. In deposit, we update the totalLiquidity
, but we don't get the latest totalUsage
. This will cause that the calculated utilization rate is less than expected. Borrowers will pay less interest than expected, and lenders will lose some expected interest.
For example:
Alice deposits 1000 crvUSD in timestamp X.
Bob borrows 200 crvUSD in timestamp X + 100.
Cathy deposits 1000 crvUSD in timestamp X + 200. Assume there are 2 crvUSD's borrowing interest generated between timestamp X + 100 and timestamp X + 200. After cathy's deposit, the utilization rate should be (200 + 2)/ (200 + 2 + 2000). But in current implementation, the utilization rate is (200)/(200 + 2000)
.
Borrowers can pay less interest than expected. And lenders will lose some expected interest.
Manual
Get the latest totalUsage according to the debt token.
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.