57725 sc high alchemistv liquidate is not updating the mytsharesdeposited which makes it inflated and can cause deposits dos and liquidations malfunction that may cause protocol insolvency
Liquidations freeze and transfer user's collateral from contract, but lack _mytSharesDeposited update which makes the state variable inflated and will cause deposit DoS along with potential malfunctions in liquidations that can lead to insolvency.
Vulnerability Details
Liquidations reduce liquidated collateral (yield tokens) and transfer it from the contract to Transmuter and fees recipients. However, the state variable _mytSharesDeposited which represents global deposited amount of yield tokens is not updated. With every liquidation, it becomes more and more inflated. This will effectively cause deposit DoS because inflated _mytSharesDeposited will reach depositCap and line 369 will revert. Additionally the protocol underlying value will be inflated because it uses _mytSharesDeposited as a source of truth. This will cause protocol to appear healthy even if it's globally undercollateralized, leading to eventual insolvency.
Impact Details
During the lifecycle of the protocol, it is almost certain we will reach depositCap because of inflated _mytSharesDeposited. The check on line 369 will revert causing deposit DoS:
Additionally, the _getTotalUnderlyingValue will return inflated amount because it's using _mytSharesDeposited. This will make alchemistCurrentCollateralization argument inside calculateLiquidation inflated as well, causing this check to always return false even in cases when protocol is unhealthy:
Global undercollateralization will go unnoticed leading to even deeper undercollateralization and eventually to insolvency.