In LendingPool
, the tokenomics is: user deposit with RWA as liquidity and get RTokens in return, withdrawing RWA by burning RTokens. For borrowers, they borrower by providing NFT via depositNFT
, if there are sufficient amount of collateral (NFT deposited), they will be granted a loan of RWA, alongside with DebtTokens marking how much they owe. There is also usage index, which represents the borrowed index, and expected to constantly increasing. When borrower repays their owed amount, based on the index difference, they shall be charged with the interests accrued in the mean time. However, no interests are charged, and causing loss for LPs, and the protocol.
In LendingPool::_repay
We see amount
is passed in for burn
, and this is the same which user is repaying. In DebtToken
:
balanceIncrease
is used to calculate the supposedly interests accrued, but this variable is not applied to amount
. It's returned at the end of function, but not used aynwhere in _repay
.
Also we see at the end of _repay
, amountScaled
amount of tokens are transferred, which is just amount
, meaning user only paid back principles, but not interests.
Interets are not collected, causing loss for LPs and protocol.
Manual review
Also add increaseBalance
to amount
to account for interests
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.