57972 sc high liquidation doesn t update mytsharesdeposited

Submitted on Oct 29th 2025 at 17:58:27 UTC by @OxPhantom for Audit Comp | Alchemix V3arrow-up-right

  • Report ID: #57972

  • Report Type: Smart Contract

  • Report severity: High

  • Target: https://github.com/alchemix-finance/v3-poc/blob/immunefi_audit/src/AlchemistV3.sol

  • Impacts:

    • Temporary freezing of funds for at least 24 hour

    • Smart contract unable to operate due to lack of token funds

Description

Brief/Intro

During liquidation, MYT is transferred from the Alchemist to the Transmuter, but _mytSharesDeposited is not decremented. This inflates the Alchemist TVL used elsewhere, double‑counts assets with the Transmuter, produces an overly lenient bad‑debt ratio, and can prematurely DoS deposits via the depositCap check.

Vulnerability Details

In the liquidation flow, MYT collateral is sent to the Transmuter without reducing _mytSharesDeposited:

// _doLiquidation(...)
amountLiquidated = convertDebtTokensToYield(liquidationAmount);
feeInYield = convertDebtTokensToYield(baseFee);

// update user balance and debt
account.collateralBalance = account.collateralBalance > amountLiquidated
    ? account.collateralBalance - amountLiquidated : 0;
_subDebt(accountId, debtToBurn);

// send liquidation amount - fee to transmuter (no _mytSharesDeposited update here)
TokenUtils.safeTransfer(myt, transmuter, amountLiquidated - feeInYield);

neither in the _forceRepay flow:

Yet, Alchemist TVL is derived from _mytSharesDeposited:

Deposits rely on _mytSharesDeposited to enforce depositCap:

Meanwhile, Transmuter’s bad‑debt ratio counts both Alchemist TVL and Transmuter‑held MYT, so if _mytSharesDeposited isn’t reduced, the same units are double‑counted in the denominator:

Contrast: in redemption flows the contract does decrement _mytSharesDeposited after transferring MYT out, so liquidation behavior is inconsistent with redemption.

Impact Details

  • Overly lenient bad‑debt ratio: inflated denominator (double‑counted TVL) reduces haircuts in Transmuter redemptions, overpaying claimants in stressed conditions.

  • Deposit DoS: _mytSharesDeposited remains artificially high; deposit() can revert prematurely on _mytSharesDeposited + amount <= depositCap, blocking new deposits.

References

https://github.com/alchemix-finance/v3-poc/blob/a192ab313c81ba3ab621d9ca1ee000110fbdd1e9/src/AlchemistV3.sol#L871-L880 https://github.com/alchemix-finance/v3-poc/blob/a192ab313c81ba3ab621d9ca1ee000110fbdd1e9/src/AlchemistV3.sol#L369 https://github.com/alchemix-finance/v3-poc/blob/a192ab313c81ba3ab621d9ca1ee000110fbdd1e9/src/Transmuter.sol#L219-L226 https://github.com/alchemix-finance/v3-poc/blob/a192ab313c81ba3ab621d9ca1ee000110fbdd1e9/src/AlchemistV3.sol#L760-L780

Proof of Concept

Proof of Concept

This POC demonstrate the issue after a liquidation yield token are transfered to the transmuter however the total underlying value doesn't change.

Was this helpful?