# CDP Safety Deep Dive

This page is for borrowers. It expands the key math and the most common misunderstandings: **CR**, **liquidation price**, and **repayment**.

{% hint style="info" %}
**Not investment advice** — Borrowing against volatile collateral is risky. This page is educational.
{% endhint %}

## At a glance

* A Trove is “collateral posted + USDHN debt owed”.
* Your liquidation risk is mostly about **Collateral Ratio (CR)**.
* “Liquidation price” is CR math solved for the collateral price at the minimum CR.
* Your debt is in **USDHN units**. Selling the USDHN you minted does not remove the obligation to repay.

## The variables (plain)

| Symbol       | Meaning                           | Notes                           |
| ------------ | --------------------------------- | ------------------------------- |
| `C`          | collateral amount (e.g., 10 KAIA) | unit depends on the collateral  |
| `P`          | collateral price (USD per unit)   | typically an oracle price       |
| `V = C × P`  | collateral value (USD)            | changes when `P` changes        |
| `D`          | debt (USDHN)                      | can increase with fees/interest |
| `CR = V / D` | collateral ratio                  | higher is safer                 |

## CR ↔ liquidation price — five common cases (worked)

Two formulas are enough for most borrower questions:

$$
CR = \frac{C \times P}{D}
$$

$$
P\_{liq} = \frac{MCR \times D}{C}
$$

Where:

* `MCR` is the minimum collateral ratio for the collateral branch (shown in the official UI).
* `P_liq` is the collateral price at which your Trove hits `MCR` (the UI “liquidation price”).

Assume (illustrative numbers, not protocol parameters):

* `MCR = 150% = 1.5`
* `C = 10`
* `P = $2`
* `D = 10`

Baseline:

* `CR = (10 × 2) / 10 = 200%`
* `P_liq = (1.5 × 10) / 10 = $1.50`

Now the five cases:

| Case | What changes                                | New CR                               | New `P_liq`                     | What to notice                                           |
| ---- | ------------------------------------------- | ------------------------------------ | ------------------------------- | -------------------------------------------------------- |
| 1    | **Collateral price drops**: `P: $2 → $1.60` | `CR: 200% → 160%`                    | unchanged (`$1.50`)             | Market/oracle moves change **CR**, not **`P_liq`**       |
| 2    | **Borrow more**: `D: 10 → 15`               | `CR = (10×2)/15 ≈ 133.3%`            | `P_liq = (1.5×15)/10 = $2.25`   | More debt raises your liquidation price                  |
| 3    | **Repay debt**: `D: 10 → 8`                 | `CR = (10×2)/8 = 250%`               | `P_liq = (1.5×8)/10 = $1.20`    | Repaying lowers your liquidation price                   |
| 4    | **Add collateral**: `C: 10 → 12.5`          | `CR = (12.5×2)/10 = 250%`            | `P_liq = (1.5×10)/12.5 = $1.20` | Adding collateral lowers your liquidation price          |
| 5    | **USDHN market price moves**                | (protocol CR math usually unchanged) | unchanged                       | Your *cost to close* can change even if `P_liq` does not |

{% hint style="warning" %}
**Oracle vs market** — Protocol safety checks typically use an oracle price for `P`. Markets can move faster than the oracle. Under volatility, your real liquidation risk can change before the UI refreshes.
{% endhint %}

## How USDHN market price affects your real repayment cost

Your debt is denominated in **USDHN units**, but your “cost to close” depends on the market price when you buy back USDHN.

Example (ignoring fees/interest):

* you owe `1,000` USDHN
* if USDHN trades at `$1.02`, buying back costs about `$1,020`
* if USDHN trades at `$0.98`, buying back costs about `$980`

Peg deviations can help or hurt borrowers depending on when they repay.

## Repayment reality: debt is an obligation, not a balance

If you mint `1,000` USDHN:

* you now **owe `1,000` USDHN** (plus any fees/interest that accrue)
* your wallet might contain `1,000` USDHN, or you might swap/sell it — the debt is unchanged

Closing a Trove requires you to obtain USDHN later to repay.

## What can make debt grow over time?

Depending on the collateral branch and configuration, debt may increase due to:

* borrowing fees
* interest (rate-based borrowing)
* liquidation-related penalties if you get liquidated

The official UI should show your current debt and any rate/fee settings.

## Borrower checklist (practical, non-numeric)

* Use the UI liquidation price as a **risk indicator**, not a target.
* Keep a buffer for fast moves (collateral price drops and UI lag).
* Remember you will need USDHN later to repay.
* Understand redemptions if you use advanced rate/strategy features.

## Next reads

* Basic flow: [Borrowing & Liquidation](https://hann-finance.gitbook.io/hann-finance/protocol/borrowing-and-liquidation)
* Peg mechanics: [Redemptions & Risk](https://hann-finance.gitbook.io/hann-finance/protocol/redemptions-and-risk)
* Full risk framing: [Risk Disclosure](https://hann-finance.gitbook.io/hann-finance/risks/risk-disclosure)
