# Account can not be liquidated when price fall by 99%.

Taurus liquidation math computes surcharge on uncapped collateral amount, so a 99% price crash makes surcharge exceed collateral and reverts liquidation.

- Payout: Contest reward
- Severity: medium
- Program: Taurus
- Credited: roguereddwarf
- Disclosed: 2023-02-08
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2023-03-taurus-judging/issues/61
- Library page: https://bugbountylibrary.com/r/sherlock%3A2023-03-taurus%3AM-3
- Tags: domain:web3 impact:dos kind:contest platform:sherlock sev:medium tech:solidity technique:source-review vuln:accounting-error vuln:dos vuln:liquidation

**Target:** BaseVault liquidation logic (_calcLiquidation)
**Root cause:** liquidationSurcharge is computed from collateralToLiquidateWithoutDiscount (uncapped) while collateralToLiquidate is capped to account collateral, so at extreme price drops surcharge exceeds collateralToLiquidate and the subtraction underflows.
**Steps:**
1. Set oracle price to 1% of original via `glpOracle.updatePrice(PRECISION.mul(1).div(100))`
2. Confirm account unhealthy via `getAccountHealth(user)` returns false
3. Get `liqAmt = getMaxLiquidation(user)` and mint/approve TAU to liquidator
4. Call `gmxVault.connect(liquidator).liquidate(user.address, liqAmt, 0)`
5. Observe revert with panic 0x11 (underflow) at `collateralToLiquidate - liquidationSurcharge`
**How found:** Code review of _calcLiquidation noticed surcharge derived from uncapped collateralToLiquidateWithoutDiscount while collateralToLiquidate is capped to account collateral; reasoned that extreme price crash makes surcharge larger, then wrote a Foundry/Hardhat test with 99% price drop to confirm underflow revert.
**Insight:** When a fee/surcharge is computed from a pre-cap intermediate value but subtracted from a post-cap value, extreme inputs invert the inequality; test liquidation paths at 99%+ price drops and check every subtraction of derived amounts.
