The mint
function in the DebtToken contract incorrectly calculates interest using a linear formula Δbalance = balance * (index_current - index_last)
, while the protocol's documentation explicitly states that debt should accrue using compounding interest. This discrepancy results in incorrect interest calculations, leading to financial inefficiencies for the protocol and unfair treatment of users
The issue is located in the mint function of the DebtToken contract. Specifically, the calculation of balanceIncrease is implemented as follows:
This formula calculates interest linearly, as it multiplies the scaledBalance
by the difference between the current and previous indices (index - lastIndex)
. However, the protocol's documentation states:
"While the debt accruing is compounding, the liquidity rate is linear."
This indicates that debt should accrue using compounding interest, not linear interest.
Financial Loss for the Protocol:
The protocol will overcharge interest on debt, leading to increased costs for the protocol. This could result in reduced profitability and financial instability.
Calculation proofs:
Unfair Outcomes for Users:
Borrowers will pay more interest than they should, which may discourage borrowing and reduce the protocol's usage. This creates an unfair disadvantage for users.
Manual code review.
To fix this issue, replace the linear interest calculation with a compounding interest formula. Update the balanceIncrease
calculation as follows:
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.