The LendingPool
contract's _repay
function doesn't rebalance liquidity after processing repayments. By skipping the _rebalanceLiquidity()
call, the protocol can't maintain its (initial)required 20% liquidity buffer, resulting in either idle capital or insufficient liquidity.
The vulnerability exists in the _repay
function where liquidity rebalancing is not performed after repayment processing:
The _rebalanceLiquidity
function maintains the protocol's liquidity buffer through two critical flows:
The _rebalanceLiquidity
function manages liquidity distribution between instant-access reserves and CurveVault deposits. It maintains a 20% buffer ratio by either deploying excess funds to CurveVault or withdrawing from it when reserves fall below the threshold.
By not calling the _rebalanceLiquidity
function, the protocol's liquidity buffer mechanism breaks during repayments, creating two problems.
First, excess funds sit idle in the rToken instead of generating yield, and second, the protocol can't guarantee it has enough liquidity to cover withdrawals since it's not maintaining its required buffer ratio between rToken and funds deposited into CurveVault.
Manual Review
Add the _rebalanceLiquidity()
call after updating interest rates in the _repay
function:
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.