Core Contracts

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

When borrower repay Reserve Assests , it doesnot go through rebalancing

Summary

Vulnerability Details

So basically what happens here is that, A borrower repay their Borrow assets.

Now all return Reserve assets are transfered to RToken address

Point is after interst and liquidity get updated, there is no rebalancing method present for those assets in RToken contract, basically those assets remain there idel

This _rebalanceLiquidity()method present inend of all crucial functions which has power to change liquidity & interst rate like deposit(), borrow(), withdraw()But absent in repay()and repayOnBehalf()

This _rebalanceLiquidity()is a crucial function which rebalances liquidity between Buffer and Curve Vault to maintain a Desired Buffer ratio.

https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/pools/LendingPool/LendingPool.sol#L375-L377

https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/pools/LendingPool/LendingPool.sol#L384-L388

Impact

Tools Used

manual review

Recommendations

_rebalanceLiquidity()should present inside repay() and repayOnBehalf() function in end.

function repay(uint256 amount) external nonReentrant whenNotPaused onlyValidAmount(amount) {
_repay(amount, msg.sender);
_rebalaceLiquidity();
}
/**
* @notice Allows a user to repay borrowed reserve assets on behalf of another user
* @param amount The amount to repay
* @param onBehalfOf The address of the user whose debt is being repaid
*/
function repayOnBehalf(uint256 amount, address onBehalfOf) external nonReentrant whenNotPaused onlyValidAmount(amount) {
if (!canPaybackDebt) revert PaybackDebtDisabled();
if (onBehalfOf == address(0)) revert AddressCannotBeZero();
_repay(amount, onBehalfOf);
_rebalanceLiquidity();
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 7 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.

Give us feedback!