> For the complete documentation index, see [llms.txt](https://spreads-finance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://spreads-finance.gitbook.io/docs/spreads-stretch-wstrc/how-looping-works.md).

# How looping works

<figure><img src="/files/GYWhpCz1D2TfIkcbQDvd" alt=""><figcaption></figcaption></figure>

### Overview

The STRC Loop System builds a leveraged **wSTRC/USDC** position on **Morpho V2 Fork** deployed on the Ink chain and operated by Spreads Admin Team. Users deposit USDC, and the system iteratively borrows, swaps via CoW Protocol, wraps, and supplies collateral until the target leverage is reached. An unwind flow reverses the position safely

**Supported leverage targets:** 2x, 3x, 3.5x

**Target health factor:** 1.20 (for 2x / 3x), 1.10 (for 3.5x)\
**Protocol:** Morpho V2 Fork on Ink

**Swap venue:** CoW Protocol\
**Collateral:** wSTRC - **Debt asset:** USDC

### How It Works

#### Loop (Entry)

1. User deposits USDC
2. Initial swap: USDC → STRC via CoW
3. Wrap STRC → wSTRC, supply as collateral on the lending market
4. Borrow USDC against collateral (capped by health factor)
5. Swap borrowed USDC → STRC → wrap → supply
6. Repeat until target leverage is hit&#x20;

<br>

<figure><img src="/files/YZQJCq6BAH81827l3673" alt=""><figcaption></figcaption></figure>

#### Unwind (Exit)

1. Snapshot wallet balances (delta-based safety)
2. Withdraw wSTRC from Morpho within HF safety bounds
3. Unwrap wSTRC → STRC
4. Swap STRC → USDC via CoW
5. Repay USDC debt
6. Repeat until target reached (full close or partial deleverage to 1x / 2x / 3x)

<figure><img src="/files/GCY4ya1rL06JIkPvhpT9" alt=""><figcaption></figcaption></figure>

### Worked Example — $1,000 at 3x

**Goal:** $2,000 total debt, $3,000 total collateral.

| Iter | Action                          | Collateral | Debt   | Borrow This Step |
| ---- | ------------------------------- | ---------- | ------ | ---------------- |
| 0    | Swap $1,000 USDC → STRC         | —          | —      | —                |
| 1    | Supply wSTRC, borrow            | \~$1,000   | $0     | $717             |
| 2    | Supply, borrow                  | \~$1,717   | $717   | $514             |
| 3    | Supply, borrow                  | \~$2,231   | $1,231 | $369             |
| 4    | Supply, borrow                  | \~$2,600   | $1,600 | $264             |
| 5    | Supply, borrow (debt-cap binds) | \~$2,864   | $1,864 | $136             |

### Minimum Deposit

**Constraint:** every CoW swap must be ≥ $10.

At iteration `k`, the borrow equals `deposit × q^k`. For small deposits, later iterations drop below the $10 minimum

For 3x at HF=1.20: iteration 5 borrow = `D × 0.189`. Solving `D × 0.189 ≥ 10` gives `D ≥ $53`. In practice the search lands near **\~$110** because the debt cap shortens the loop
