57510 sc high stale locked collateral tracking during price appreciation causes disproportionate redemption losses

Submitted on Oct 26th 2025 at 20:28:35 UTC by @Smartkelvin for Audit Comp | Alchemix V3arrow-up-right

  • Report ID: #57510

  • Report Type: Smart Contract

  • Report severity: High

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

  • Impacts:

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

Description

Brief/Intro

The Alchemix V3 protocol tracks locked collateral (rawLocked) in yield token terms but fails to update these values when the yield token's exchange rate appreciates. When redemptions occur, the _sync() function calculates each user's proportional share of redemption costs based on stale rawLocked values before updating them to reflect current prices. This causes users to pay significantly more collateral during redemptions than their fair share, with losses amplifying as yield token prices increases

Vulnerability Details

The vulnerability exists in the _sync() function in AlchemistV3.sol, specifically in the order of operations:

 function _sync(uint256 tokenId) internal {
    Account storage account = _accounts[tokenId];
    
    // STEP 1: Calculate collateral removal based on STALE rawLocked
    uint256 collateralToRemove = PositionDecay.ScaleByWeightDelta(
        account.rawLocked,  // ← Stale value from old price
        _collateralWeight - account.lastCollateralWeight
    );
    account.collateralBalance -= collateralToRemove;
    
    // STEP 2: Process redemptions and debt updates
    // ... redemption logic ...
    
    // STEP 3: Update rawLocked to reflect current price (TOO LATE)
    account.rawLocked = convertDebtTokensToYield(account.debt) 
                        * minimumCollateralization / FIXED_POINT_SCALAR;
    
    // Update checkpoints
    account.lastCollateralWeight = _collateralWeight;
    // ...
}

the core issue is that the _sync function uses stale RawLocked before updating

Impact Details

Direct Financial Loss:

  • Users lose collateral in excess of their proportional share during redemptions

  • Loss scales with:

    • Magnitude of yield token price appreciation

    • Time between syncs

    • Amount of locked collateral

    • Number of redemptions

mitigation

Update rawLocked before using in calculations

Proof of Concept

Proof of Concept

Was this helpful?