58110 sc low morphoyearnogwethstrategy will always report strategy loss

Submitted on Oct 30th 2025 at 18:02:54 UTC by @Django for Audit Comp | Alchemix V3arrow-up-right

  • Report ID: #58110

  • Report Type: Smart Contract

  • Report severity: Low

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

  • Impacts:

    • Protocol insolvency

    • Contract fails to deliver promised returns, but doesn't lose value

Description

Brief/Intro

The strategy contracts within the AlchemixV3 system are designed to report when a strategy has incurred a loss to indicate the change to the redemption rate due to the bad debt. However, due to incorrect order of token balance checks, the event StrategyDeallocationLoss will be emitted every time the funds are deallocated from the strategy.

Vulnerability Details

See the _deallocate() function in the MorphoYearnOGWETHStrategy.sol contract:

function _deallocate(uint256 amount) internal override returns (uint256) {
        vault.withdraw(amount, address(this), address(this));
        uint256 wethBalanceBefore = TokenUtils.safeBalanceOf(address(weth), address(this));
        uint256 wethBalanceAfter = TokenUtils.safeBalanceOf(address(weth), address(this));
        uint256 wethRedeemed = wethBalanceAfter - wethBalanceBefore;
        if (wethRedeemed < amount) {
            emit StrategyDeallocationLoss("Strategy deallocation loss.", amount, wethRedeemed);
        }

The wethBalanceBefore is calculated the line before wethBalanceAfter is calculated. The vault.withdraw() call should be in the middle of these two calls to accurately calculate the balance difference.

Impact Details

The strategy will report a loss on every deallocation, leading to confusion around the protocol incurring bad debt and the resulting redemption rate.

Proof of Concept

Proof of Concept

forge test --mt test_strategy_always_emits_deallocation_loss -vv

Was this helpful?