When the users call the function LendingPool::repay
to repay there borrowed amount than they have to pay way higher interest then they should be.
User called borrow and he borrowed 10000
tokens at the usageIndex= 1.05
.
Now calls repay function with 11000
as amount, and the current usageIndex = 1.09
Call execution will go as LendingPool::repay => _repay => DebtToken.burn
If we look at the burn function
It first calculates the userBalance = balance * usageIndex = 10000 * 1.09 = 10,900
.
If amount > userBalance
then amount = userBalance = 10,900
.
Then this amount of DebtToken in burnt and the this amount
variable is returned to the LendingPool::repay
.
Then the returned value is stored by amountScaled
and this amount of asset tokens has been sent by the user to the RToken
address as the debt.
But due to miscalculation the user has to pay very high interest, as the interest the user has to pay is =
10000(1.09(Index during Repayment) -1.05(index During Borrowing)) = 0.04 * 10,000 = 400
, and user has payed interest as 900
.
Loss for the Borrowers as they are paying way higher interest due to incorrect calcualtions.
Manual review
Interest IS applied through the balanceOf() mechanism. The separate balanceIncrease calculation is redundant/wrong. Users pay full debt including interest via userBalance capping.
Interest IS applied through the balanceOf() mechanism. The separate balanceIncrease calculation is redundant/wrong. Users pay full debt including interest via userBalance capping.
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.