The _repay function in the LendingPool contract does not call _rebalanceLiquidity(), leading to an imbalance between the reserve liquidity buffer and the Curve Vault. This omission breaks the invariant for desired ratio between the pool and the vault.
The _repay function processes debt repayments without rebalancing liquidity between the reserve and Curve Vault.
_rebalanceLiquidity() is only called in the borrow function, creating asymmetric behavior.
This breaks the expected invariant for ratio.
Excess liquidity remains in the reserve instead of being deposited in the Curve Vault.
The invariant ensuring 20% liquidity in the reserve and is violated.
Liquidity is rebalanced when borrowing but not when repaying, leading to inconsistent liquidity conditions.
Prerequisites:
Liquidity buffer ratio: 20% (20_00 in basis points)
Borrowing calls _rebalanceLiquidity(), but repayment does not.
Scenario:
A user borrows a large amount of reserve assets and _rebalanceLiquidity() moves excess liquidity to the Curve Vault.
The same user repays the loan - Liquidity increases in the reserve, but _rebalanceLiquidity() is not called.
Excess liquidity remains idle instead of being deposited back into the vault.
Manual review
Add _rebalanceLiquidity() at the end of _repay() to ensure liquidity remains balanced after repayments.
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.