L-1: Reducing `maxTwyneLTV` can retroactively liquidate existing positions
Summary:
When maxTwyneLTVs is lowered by governance or when the vault implementation is updated, positions that were healthy under the previous parameter may become immediately liquidatable.
Description:
In _collateralScaledByLiqLTV1e8(), the effective liquidation LTV is capped at Math.min(twyneLiqLTV, twyneVaultManager.maxTwyneLTVs(address(intermediateVault))). This value is read from twyneVaultManager at query time, meaning any reduction to maxTwyneLTVs takes effect immediately for all existing positions.
A borrower who opened a position at an LTV just below the previous maxTwyneLTV would find their position suddenly above the new threshold, making them liquidatable. The same applies if the vault implementation is upgraded and the new logic changes how twyneLiqLTV interacts with maxTwyneLTVs.
Impact:
Low. This requires a governance action to reduce maxTwyneLTVs, which is a privileged operation. However, the absence of a buffer or time-delay mechanism means the effect on existing borrowers is immediate and potentially severe.
Recommendation:
Consider implementing a time-delayed parameter change or a grace period during which existing positions are evaluated against the old maxTwyneLTV while new positions use the updated value. Additionally, assess the effects of upgrading the implementation over existing collateral vaults.
Developer Response:
Fixed in PR#239.
yAudit: Before deploying the ramp-down feature, verify no existing vault has twyneLiqLTV > maxTwyneLTVs on-chain, as those vaults would have already had their effective LTV reduced instantly by a prior maxTwyneLTVs change and the ramp mechanism cannot retroactively protect them.