DeFiFoundrySolidity
16,653 OP
View results
Submission Details
Severity: medium
Invalid

Insufficient liquidity in Transmuter causes false loss realization

Summary

The _freeFunds function attempts to release a specified amount (_amount) of funds from the transmuter. If the transmuter has insufficient liquidity, it releases only the available funds, creating a potential discrepancy between the requested and released amounts. This difference is treated as a loss, which is passed on to the withdrawer. This mechanism risks realizing a "false loss" due to temporary liquidity shortages, negatively impacting the withdrawer's balance.

https://github.com/Cyfrin/2024-12-alchemix/blob/82798f4891e41959eef866bd1d4cb44fc1e26439/src/StrategyMainnet.sol#L136-L143

Impact

  1. False Loss Realization: The withdrawer may bear an artificial loss caused by temporary liquidity constraints in the transmuter, not due to actual underlying asset performance or default.

  2. User Dissatisfaction: Users experiencing reduced withdrawals due to liquidity shortages may lose trust in the protocol, perceiving it as unfair or inefficient.

Recommendations

  1. Rollback on Insufficient Liquidity: Modify the _freeFunds function to revert the transaction if the transmuter cannot release the full _amount. This ensures no false losses are realized and allows the user to retry later when liquidity is restored.

    function _freeFunds(uint256 _amount) internal override {
    uint256 totalAvailable = transmuter.getUnexchangedBalance(address(this));
    require(totalAvailable >= _amount, "Insufficient liquidity in transmuter");
    transmuter.withdraw(_amount, address(this));
    }
Updates

Lead Judging Commences

inallhonesty Lead Judge
5 months ago

Appeal created

inallhonesty Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
inallhonesty Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.