> ## Documentation Index
> Fetch the complete documentation index at: https://docs.batt.farm/llms.txt
> Use this file to discover all available pages before exploring further.

# Bad debt

> How the SP, JIT liquidation, and redistribution handle liquidated debt.

[한국어로 읽기](https://docs.batt.farm/liquidation-waterfall.md)

Bad debt is debt that cannot be fully recovered from collateral. A position can become eligible for liquidation before it has bad debt. Liquidation aims to settle the debt before a collateral shortfall grows.

batt's liquidation design follows the order **SP → JIT → redistribution**.

## Settlement order

```mermaid theme={null}
%%{init: {"htmlLabels": false, "fontFamily": "Arial, sans-serif", "flowchart": {"htmlLabels": false}, "themeVariables": {"fontFamily": "Arial, sans-serif"}}}%%
flowchart TD
  A["Position eligible for liquidation"] --> B["SP: use deposited KRW*"]
  B --> C{"Debt remaining?"}
  C -->|"No"| D["Settlement complete"]
  C -->|"Yes"| E["JIT: source funds at liquidation"]
  E --> F{"Debt remaining?"}
  F -->|"No"| D
  F -->|"Yes"| G["Redistribute collateral and debt"]
```

This is batt's intended settlement order. The implementation still needs to be checked to confirm when each step applies, its exceptions, and the calls that execute it. Other protocols based on Liquity v2 may use a different order.

## 1. Stability Pool

The SP uses KRW\* deposited in advance to offset liquidated debt. Any debt it cannot cover moves to the next stage. See [Stability Pool](https://docs.batt.farm/en/stability-pool.md) for changes to pool assets and depositor returns.

## 2. JIT liquidation

JIT liquidators supply funds at liquidation to repay debt left after the SP. See [JIT liquidation](https://docs.batt.farm/en/jit-liquidation.md) for the conditions they need to execute a trade.

## 3. Redistribution

After the SP and JIT stages, batt transfers any remaining collateral and debt to other positions under the protocol's rules. The debt is transferred to those borrowers, not cancelled.

If your position receives a redistribution, you can end up with more collateral and more debt without taking out a new loan. Compare the value of the collateral you receive with the debt added to your position.

## Remaining risks

| Participant | Possible impact |
| - | - |
| Liquidated borrower | Collateral disposal and liquidation costs |
| SP depositor or JIT liquidator | Falling collateral prices and sale costs |
| Borrower receiving redistribution | Collateral and debt transferred from other positions |
| KRW\* holder | Reduced confidence in collateral backing and deviation from the peg |

A sharp price decline can coincide with insufficient SP funds, few JIT liquidators, and thin collateral liquidity. Losses can remain after every stage. Redistribution moves the exposure to other positions; it does not eliminate it.

[Monitor your collateral ratio](https://docs.batt.farm/en/manage-position.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.