The _rebalanceLiquidity function is called at the end of deposit, withdraw, and borrow, but it is missing in finalizeLiquidation and _repay, which disrupt liquidity management.
_rebalanceLiquidity is invoked at the end of deposit, withdraw, and borrow operations:
This function ensures proper liquidity allocation by depositing excess assets into curveVault or withdrawing if needed:
However, finalizeLiquidation and _repay does not call _rebalanceLiquidity, potentially leading to imbalanced liquidity.
the LendingPool will not respect the allowed buffer assets in RTokenAddress and will hold more token than required. Which is not intended and result in lose of yield for protocol.
Manual Review
Add _rebalanceLiquidity in finalizeLiquidation and _repay to maintain proper liquidity distribution.
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.