Core Contracts

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

The `repay` and `finalizeLiquidation` functions does not rebalance liquidity

Summary

The repay and finalizeLiquidation functions in LendingPool contract do not rebalance liquidity after that assets are transferred into the lending pool

Vulnerability Details

The LendingPool has a rebalance liquidity feature that rebalances liquidity between the buffer and the Curve vault to maintain the desired buffer ratio.

  • When a user deposit -> the liquidity is rebalanced after transferring assets

  • When a user withdraws -> Ensure sufficient liquidity is available Before assets are transferred and rebalance liquidity after withdrawal

  • When a user borrows -> Ensure sufficient liquidity is available Before assets are transferred and rebalance liquidity after borrowing

  • When a user repays -> fails to rebalance liquidity after transferring assets

  • When liquidation occurs -> fails to rebalance liquidity after transferring assets

Impact

The liquidity is not rebalanced, the crvUSDC deposited within the repay or finalizeLiquidation functions will remain in the Lending pool contract, and the pool may have more than the desired buffer into the contract which is not optimal

Tools Used

Manual Review

Recommendations

Add this after _repay and finalizeLiquidation function

+ // Rebalance liquidity
+ _rebalanceLiquidity();
Updates

Lead Judging Commences

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