ManagedLeveragedVault::increaseLeverage() fails when the debt is closed to the limit
Summary
ManagedLeveragedVault::increaseLeverage() will revert when the protocol is close to the max debt as it needs to borrow more than the debt allows in order for the ICR to reach the target.
Vulnerability Detail
ManagedLeveragedVault::increaseLeverage() check is too strict requiring that the final ICR is very close to the target:
_checkInvariantICR(getCurrentDenICR(), getTargetICR(), Tolerance.ABOVE);Thus, it will not be possible to increase the leverage, even if this change would bring it closed to the target ICR.
Impact
Smaller leverage than intended.
Code Snippet
Tool Used
Manual Review
Recommendation
Allow the ICR to be higher than the target as long as it is above it.