# Looping & Leverage Deep Dive

This page expands the mechanics behind **loop strategies** (leveraged CDP positions): what “leverage” means inside a Trove, how it relates to **CR**, and what usually breaks first in real usage.

{% hint style="info" %}
**Not investment advice** — Looping increases leverage and liquidation risk. This page is educational and focuses on mechanics and failure modes.
{% endhint %}

## At a glance

* A loop is: **mint USDHN → swap to collateral → add collateral → repeat**.
* Looping increases your **gross collateral exposure** but also increases your **debt**.
* The key safety metric is still **Collateral Ratio (CR)**, but it helps to also think in **equity** and **leverage** terms.
* Real outcomes depend on fees, interest, slippage, oracle pricing, and USDHN market price.

## What “looping” means (precisely)

In Hann Finance, “looping” usually refers to building a leveraged Trove by repeating:

1. mint USDHN against collateral
2. swap USDHN into more of the collateral (or a collateral wrapper)
3. add the collateral back into the same Trove

You end up with:

* **more collateral posted**
* **more USDHN debt owed**
* a **lower CR buffer** than a non-levered Trove (all else equal)

## Equity and leverage inside a Trove

We can define three values in USD terms:

* `V` = collateral value (USD)
* `D` = debt value (USDHN, plus any accrued interest/fees)
* `E` = equity (USD) ≈ `V - D` *(a simplified view)*

Then a simple “leverage” definition is:

$$
L = \frac{V}{E}
$$

Interpretation:

* `L = 1.0x` means “no leverage” (no debt).
* `L = 2.0x` means “$2 of collateral exposure per $1 of equity” (roughly).

{% hint style="warning" %}
**Important simplification** — The equality `E ≈ V - D` is a mental model. It assumes USDHN is valued at \~$1 and ignores liquidation penalties, swap fees, interest growth, and oracle vs market differences.
{% endhint %}

## CR ↔ leverage (useful conversion)

CR is:

$$
CR = \frac{V}{D}
$$

Using the simplified equity model above:

$$
L = \frac{V}{V - D} = \frac{1}{1 - \frac{D}{V}} = \frac{1}{1 - \frac{1}{CR}} = \frac{CR}{CR - 1}
$$

So, **lower CR implies higher leverage**.

### Quick table (illustrative)

| CR           | Approx leverage `L = CR/(CR-1)` |
| ------------ | ------------------------------- |
| `300% = 3.0` | `1.5x`                          |
| `200% = 2.0` | `2.0x`                          |
| `150% = 1.5` | `3.0x`                          |

This table is not a recommendation. It only shows the math relationship.

## How looping changes “distance to liquidation”

Liquidation happens when your Trove’s CR drops below the branch minimum (often called `MCR`, shown in the official UI).

If your current CR is `CR_now`, and the branch minimum is `MCR`, then a simple way to think about liquidation price distance is:

$$
P\_{liq} \approx P\_{now} \times \frac{MCR}{CR\_{now}}
$$

Meaning:

* if `CR_now` is only slightly above `MCR`, then `P_liq` is close to the current price
* looping usually reduces `CR_now`, making `P_liq` closer

For the full derivation and worked cases, see: [CDP Safety Deep Dive](https://hann-finance.gitbook.io/hann-finance/resources/deep-dives/cdp-safety).

## The three common flows (lever up / lever down / close)

### Flow A — Lever up (loop)

High-level:

1. open or start from a Trove with collateral
2. mint USDHN (keeping a CR buffer)
3. swap USDHN → collateral
4. add collateral to the Trove
5. repeat until you reach your target CR/leverage

One-click tools (Zappers) can bundle the steps, but they do not change the underlying mechanics.

### Flow B — Lever down (deleverage)

High-level:

1. withdraw or use a portion of collateral (if allowed)
2. swap collateral → USDHN
3. repay USDHN debt
4. re-check CR and repeat until risk is acceptable

### Flow C — Close the Trove

To close:

1. repay **all** USDHN debt (including any accrued interest/fees)
2. withdraw collateral and close

Key reality: if you swapped away the USDHN you minted earlier, you must obtain USDHN again later to repay.

## Worked example (numbers, but simplified)

Assume:

* initial deposit: collateral worth `$1,000`
* you aim to end at `CR = 200% = 2.0`
* ignore swap fees, interest, and price impact
* treat USDHN as `$1.00`

From the leverage conversion:

* `CR = 2.0` corresponds to `L = 2.0x`

So your end state is approximately:

* collateral value `V ≈ $2,000`
* debt `D = V/CR ≈ $2,000/2 = $1,000` (≈ `1,000` USDHN)
* equity `E ≈ V - D ≈ $1,000`

If the collateral price drops `20%`:

* `V ≈ $1,600`
* `D ≈ $1,000` (unchanged in units)
* `CR ≈ 160%`

Whether that liquidates depends on the branch’s `MCR`. That’s why looped positions are sensitive to small moves.

### Repayment cost can change even if CR math looks stable

If you owe `1,000` USDHN:

* if USDHN trades at `$1.02`, repaying costs about `$1,020`
* if USDHN trades at `$0.98`, repaying costs about `$980`

Looping usually increases debt size, which increases your sensitivity to USDHN market price when you unwind.

## Failure modes (what usually breaks first)

{% tabs %}
{% tab title="Liquidation risk (primary)" %}

* Looping reduces your CR buffer.
* Interest/fees can increase debt over time, slowly pushing CR down even if collateral price is flat.

Guardrails:

* keep a conservative CR
* watch collateral volatility and oracle update cadence
* deleverage early rather than “at the last moment”
  {% endtab %}

{% tab title="Execution risk (swaps + routing)" %}
Looping requires swaps (sometimes multiple hops).

Failure modes:

* slippage (worse fill) or `minOut` reverts
* stale quotes (deadline too long)
* thin liquidity during volatility

Guardrails:

* use realistic `minOut` and short deadlines
* start with small size to validate routes
* prefer deep liquidity routes for the loop leg

Deep dive on swap guardrails: [StableSwap Deep Dive](https://hann-finance.gitbook.io/hann-finance/resources/deep-dives/stableswap).
{% endtab %}

{% tab title="Exit friction (LSTs and wrappers)" %}
If your collateral is an LST or a wrapped receipt token, exiting may not be instant:

* unbonding delays
* redemption limits / cooldowns
* secondary market liquidity gaps

Guardrails:

* treat “exit time” as part of risk
* keep larger buffers when collateral has redemption friction
  {% endtab %}

{% tab title="USDHN peg risk" %}
USDHN can trade above or below `$1` in the market.

For looped borrowers, the practical impact is often on the **cost to repay**.
{% endtab %}
{% endtabs %}

## Practical checklist (non-numeric)

* Know your unwind path **before** you loop: “How do I get USDHN to repay?”
* Treat the UI liquidation price as a risk indicator, not a goal.
* Assume you may need to deleverage fast in a drawdown.
* If you use automation, first understand the manual flow and start small.

## Next reads

* Main guide: [Loop Strategies](https://hann-finance.gitbook.io/hann-finance/protocol/loops)
* CR math and liquidation price: [CDP Safety Deep Dive](https://hann-finance.gitbook.io/hann-finance/resources/deep-dives/cdp-safety)
* Swap guardrails and LP risk: [StableSwap Deep Dive](https://hann-finance.gitbook.io/hann-finance/resources/deep-dives/stableswap)
* One-click automation caveats: [Zapper Guide](https://hann-finance.gitbook.io/hann-finance/protocol/zapper)
