H-1: Withdraw limit overstates liquidity when branch CCR headroom is tight
Summary:
The strategy advertises withdrawable liquidity through maxWithdraw() and maxRedeem() that it cannot actually free because BaseLenderBorrower.availableWithdrawLimit() ignores the branch CCR constraint enforced by Strategy._maxWithdrawal(). Under TCR < CCR, a strict withdraw() path can revert, while Yearn's default redeem() path can instead burn shares, repay strategy debt, and return little or no collateral to the withdrawing user.
Description:
The write path is CCR-aware:
Strategy._maxWithdrawal()caps collateral release by branch headroom aboveCCR;- when branch
TCR < CCR, that headroom becomes0.
That collateral lock is imposed by Liquity and is expected behavior at the protocol layer; the strategy cannot and should not bypass it.
The view path is not:
BaseLenderBorrower.availableWithdrawLimit()ignoresStrategy._maxWithdrawal();
Yearn's maxWithdraw() and maxRedeem() trust availableWithdrawLimit(). During BaseLenderBorrower._liquidatePosition() the strategy first withdraws BOLD from the lender and repays debt, then attempts to free collateral. If _maxWithdrawal() is 0, the debt reduction succeeds but the collateral withdrawal does not. A loss-intolerant path such as withdraw(..., maxLoss) can therefore revert, while the default three-argument redeem() accepts full loss and can complete as a debt-only exit. The repository's own tests already show this stressed-state behavior.
Impact:
High. During TCR < CCR, a withdrawing user can lose most or all redemption value while the strategy still repays shared debt for the benefit of remaining shareholders and continues to overstate exit liquidity to integrators and UIs.
Recommendation:
Make availableWithdrawLimit() a conservative upper bound on what can actually be freed. In practice:
- incorporate the same
CCR-aware cap used by_maxWithdrawal(); or - revert cleanly in states where debt can be repaid but collateral cannot be released.
The strategy should not socialize debt repayment onto the withdrawing user without releasing collateral.
Developer Response:
Acknowledged. They can withdraw but with a loss, true. Users should use yearn's maxLoss.