# Wrong state update in `liquidationType1` call

liquidationType1 credits liquidation yield to abondUSDaPool instead of usdaGainedFromLiquidation, so redeemYields liquidation ratio stays zero and yield accounting breaks.

- Payout: Audit contest
- Severity: high
- Program: Autonomint
- Found by: 0x37
- Disclosed: 2024-11-26
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2024-11-autonomint-judging/issues/1021
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-11-autonomint%3AH-34
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:reward-distribution

**Target:** borrowLiquidation.liquidationType1 / Treasury accounting
**Root cause:** liquidationType1 calls treasury.updateAbondUSDaPool(returnToAbond, true) instead of updateUSDaGainedFromLiquidation, so usdaGainedFromLiquidation never accrues.
**Steps:**
1. Read liquidationType1 in borrowLiquidation.sol: it computes returnToAbond and calls `treasury.updateAbondUSDaPool(returnToAbond, true)`.
2. Read BorrowLib.redeemYields: it computes `usdaToAbondRatioLiq = treasury.usdaGainedFromLiquidation() * RATE_PRECISION / abond.totalSupply()`.
3. Observe usdaGainedFromLiquidation is never incremented by liquidation, so usdaToAbondRatioLiq is always 0.
4. Confirm liquidation yield instead inflates abondUSDaPool, skewing the non-liquidation ratio in redeemYields.
**How found:** Code reading of liquidationType1 versus redeemYields revealed the wrong treasury setter was invoked, leaving usdaGainedFromLiquidation permanently zero.
**Insight:** When two parallel accounting pools exist (abondUSDaPool vs usdaGainedFromLiquidation), trace every writer of each state variable against every reader; a single wrong setter silently zeroes a whole yield stream.

