> For the complete documentation index, see [llms.txt](https://quintes.gitbook.io/quintes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://quintes.gitbook.io/quintes/core-mechanisms/liquidation.md).

# Liquidation

Liquidation is the critical process that ensures the Quintes Protocol remains solvent at all times — guaranteeing that the total value of collateral in the system always exceeds the value of the circulating QNT.

When the value of your collateral decreases or the value of your QNT debt increases, your vault may become unsafe. The protocol tracks this using the **Health Factor (HF)**.

***

### Health Factor (HF)

The **Health Factor** represents the safety of a user's vault:

$$
HF = \frac{Collateral\ Value \times Collateral\ Factor}{Debt\ Value}
$$

* ✅ **HF > 1.0** → Safe vault
* ⚠️ **HF < 1.0** → Eligible for liquidation

If your vault becomes unsafe, part of your collateral may be liquidated to restore safety.

> 💡 **Tip:** A higher Health Factor means your vault can better withstand price drops in your collateral or growth in your QNT debt.

***

### Why Partial Liquidation?

The Quintes Protocol uses a **Partial Liquidation Model** instead of full liquidations to provide a more sustainable and user-friendly experience.

| Risk                     | Description                                                                          |
| ------------------------ | ------------------------------------------------------------------------------------ |
| **Insolvent Vaults**     | Inefficient liquidations can leave unhealthy vaults that threaten protocol solvency. |
| **Poor User Experience** | Full liquidations are punitive and discourage participation.                         |
| **Economic Exploits**    | Overly harsh liquidation rules can be gamed, exposing protocol funds to risk.        |

Partial liquidation solves these problems by liquidating **only the minimum debt required** to restore a vault to safety.

***

### Key Concepts

| Term                              | Description                                                                                         |
| --------------------------------- | --------------------------------------------------------------------------------------------------- |
| **Health Factor (HF)**            | Represents the safety of a user's vault.                                                            |
| **Liquidation Threshold (LT)**    | A vault becomes liquidatable when HF < 1.                                                           |
| **Target Health Factor (THF)**    | Governance-defined safe level after liquidation (e.g., 1.25).                                       |
| **Collateral Factor (CF)**        | Percentage of collateral value that can be borrowed.                                                |
| **Total Liquidation Penalty (p)** | A governance-set fee (e.g., 5%) charged on liquidated value, split between liquidator and protocol. |

> 🧠 **Note:** The **Target Health Factor (THF)** determines how much collateral must be restored. Higher THF = more conservative safety margin.

***

### Liquidation Process

#### **1. Trigger**

A vault’s **HF drops below 1**, typically due to:

* 📉 Collateral price decline
* 📈 Increase in QNT’s value (debt side)

***

#### **2. Liquidator Action**

An external **liquidator** repays part of the vault’s **QNT debt**, denoted as `x`.

***

#### **3. Debt Cancellation**

The protocol **burns** the repaid QNT amount `x`, permanently removing it from circulation.

***

#### **4. Collateral Seizure & Fee Distribution**

Collateral worth `x × (1 + p)` is seized from the vault.

* **Liquidator Reward:** `x × (1 + liquidator_bonus)`
* **Protocol Reserve:** `x × protocol_surcharge`

This ensures liquidators remain incentivized and the protocol reserve grows sustainably.

***

### Partial Liquidation Formula

To calculate how much QNT debt (`x`) must be repaid to restore a vault to the **Target Health Factor (THF)**:

$$
THF = \frac{(c - x(1 + p)) \times CF}{d - x}
$$

Solving for x:

$$
x = \frac{(THF \times d) - (c \times CF)}{THF - ((1 + p) \times CF)}
$$

Where:

* `x` = QNT debt to repay
* `THF` = Target Health Factor (e.g., 1.25)
* `d` = Current debt
* `c` = Current collateral value
* `CF` = Collateral Factor
* `p` = Total Liquidation Penalty (e.g., 0.05)

> 💡 **Example:** If THF = 1.25 and CF = 0.5, the formula ensures your vault is restored to a safe HF of 1.25 after liquidation.

***

### Full Liquidation Fallback

In extreme undercollateralization, a vault can reach a point of no return, where partial liquidation can no longer restore safety.

This condition is defined as:

$$
c \leq d \times (1 + p)
$$

If this is true:

* Partial liquidation is **disabled**.
* Vault becomes eligible for **full liquidation**.

> ⚠️ **Warning:** This state represents **critical insolvency** — the vault’s collateral is no longer sufficient to cover even the minimal debt after penalties.

***

### Example Scenario

| Parameter            | Symbol | Value     |
| -------------------- | ------ | --------- |
| Collateral Value     | c      | 195 (ETH) |
| Debt                 | d      | 100 (QNT) |
| Collateral Factor    | CF     | 0.5       |
| Target Health Factor | THF    | 1.25      |
| Liquidation Penalty  | p      | 0.05 (5%) |

#### Step 1 — Check Vault Health

$$
HF = \frac{195 \times 0.5}{100} = 0.975 \quad \text{(Unsafe)}
$$

#### Step 2 — Calculate Required Repayment

$$
x = \frac{(1.25 \times 100) - (195 \times 0.5)}{1.25 - ((1 + 0.05) \times 0.5)} \ x = \frac{27.5}{0.725} = 37.93
$$

#### Step 3 — Execute Partial Liquidation

* Liquidator repays **37.93 QNT** → burned by protocol.
* Protocol seizes **37.93 × 1.05 = 39.83** worth of ETH.

#### Step 4 — Post-Liquidation State

| Metric               | Value                               |
| -------------------- | ----------------------------------- |
| Remaining Collateral | 195 − 39.83 = **155.17 ETH**        |
| Remaining Debt       | 100 − 37.93 = **62.07 QNT**         |
| New HF               | (155.17 × 0.5) / 62.07 = **1.25** ✅ |

> ✅ The vault is now **restored to safety** at the target Health Factor (THF = 1.25).

<br>
