Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: medium
Valid

Repayments do not rebalance liquidity, leading to miss on yield

Vulnerability Details

All protocol functions that deposit or withdraw underlying asset call _rebalanceLiqudiity(). This is so the protocol can deposit on the CRV Vault the desired % of liquidity to gain extra yield.

However the repay() does alter the amount of underlying assets on the system, by adding more, yet it does not rebalance the liquidity. It moves assets as borrowers transfer back the debt in the underlying token asset, see here.

Impact

Repayments won't and should deposit funds in the CRV Vault if needed, missing on extra yield until someone else executes a non-repayment action.

Recommendations

Add _rebalanceLiquditiy() at the end of LendingPool::_repay().

function _repay(uint256 amount, address onBehalfOf) internal {
// code..
+ _rebalanceLiquidity();
emit Repay(msg.sender, onBehalfOf, actualRepayAmount);
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Validated
Assigned finding tags:

LendingPool::finalizeLiquidation or repay doesn't call _rebalanceLiquidity, leaving excess funds idle instead of depositing them in Curve vault for yield

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.