L-1: Missing slippage protection for liquidators
Description:
PR#187 introduces partial refunds for borrowers during liquidation. The refund amount depends on position health: closer to external liquidation means lower refunds, while liquidator incentives increase as positions become riskier for intermediate vault LPs.
Liquidators must now refund borrowers part of the collateral, but there is no function argument allowing liquidators to set a maximum acceptable refund amount.
Impact:
Low. Liquidators cannot protect against potentially unfavourable refund amounts.
Recommendation:
Add a uint256 maxBorrowerRefund argument to liquidate() and revert if the computed refund exceeds it.
Developer Response:
Acknowledged. We expect the liquidator to do these checks outside Twyne core protocol.