# Liquidation bonus worsens position health

Does the liquidation bonus or gas compensation push post-liquidation collateral ratio below the bad-debt threshold?

_Area: DeFi oracles, liquidations and flash loans. Seen in 4 disclosed reports; latest 2025-02-05. Updated 2026-10-23._

## How it works
Liquidation is meant to restore a position's health: seize collateral, repay debt, leave the remainder safer than before. That only holds if the value taken from the borrower (repaid debt plus bonus/compensation) is small relative to the collateral freed. When the bonus is fixed and the position is already near the threshold, the bonus can exceed the margin, so the post-liquidation collateral ratio (CR/ICR) is lower than before. The assumption that "liquidating always improves health" breaks at the boundary.

## Where it shows up
- Fixed-percentage liquidation bonus or gas compensation applied to seized collateral, independent of position health.
- Bad-debt routing threshold set at exactly 100% while deductions (bonus, gas compensation, fees, penalties) are taken on top.
- Partial-liquidation paths that cap the repaid amount but still pay the full bonus rate.
- Multiple liquidation entry points (regular vs bad-debt) with guards enforced on only one.
- Deprecation/pause flags checked in one allowed-check but not the other path.

## How to review
Compute the post-liquidation ratio explicitly: for pre-liquidation ratio R and bonus b, the position worsens when R < 1/(1-b) (roughly). Check every deduction applied during liquidation is included when deciding the bad-debt threshold, not just debt vs collateral. For partial liquidation, recompute the ratio after the capped repayment plus bonus against the full-liquidation cutoff. For each liquidation entry point, confirm the same pause/deprecation/health guards apply. The invariant: liquidation must not lower the position's collateral ratio below the threshold that routes it to bad debt, and no path may pay an incentive the freed collateral cannot cover.

## Variants seen
- Deprecated markets: regular liquidation path still pays incentive on bad-debt positions because the deprecation guard sits only in liquidateBorrowAllowed [E1](https://bugbountylibrary.com/r/sherlock%3A2024-12-numa-audit%3AM-5.md).
- Fixed 10% reward makes 101-109% CR positions unhealthier after each liquidation, cascading to bad debt [E2](https://bugbountylibrary.com/r/c4%3A2023-06-lybra%3AM-20.md).
- Half-liquidation of a barely-unhealthy position plus 10% bonus crosses the full-liquidation cutoff, wiping it in a second call [E3](https://bugbountylibrary.com/r/c4%3A2023-03-polynomial%3AH-14.md).
- 0.5% gas compensation pushes ICR 100-100.5% troves into bad debt absorbed by the StabilityPool [E4](https://bugbountylibrary.com/r/cantina%3Abima_december2024%3A3.2.6.md).

## Impact and severity
Losses fall on the protocol or StabilityPool depositors rather than the borrower; repeated liquidations cascade healthy-ish positions into bad debt [E2](https://bugbountylibrary.com/r/c4%3A2023-06-lybra%3AM-20.md)[E4](https://bugbountylibrary.com/r/cantina%3Abima_december2024%3A3.2.6.md). Severity rises when the bonus is large, the threshold ignores deductions, or a second liquidation step is cheap [E3](https://bugbountylibrary.com/r/c4%3A2023-03-polynomial%3AH-14.md).

## Evidence
- E1: https://bugbountylibrary.com/r/sherlock%3A2024-12-numa-audit%3AM-5.md
- E2: https://bugbountylibrary.com/r/c4%3A2023-06-lybra%3AM-20.md
- E3: https://bugbountylibrary.com/r/c4%3A2023-03-polynomial%3AH-14.md
- E4: https://bugbountylibrary.com/r/cantina%3Abima_december2024%3A3.2.6.md
