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

# Hylo Equations

> Technical breakdown of the key equations powering Hylo V2 protocol

## Master Equation

The fundamental equation governing hyUSD's backing in Hylo V2:

$$
\text{hyUSD Supply} \times \text{hyUSD NAV} = \sum_{i}(\text{vUSD}_i \text{ Supply} \times \text{vUSD}_i \text{ NAV})
$$

This means hyUSD is backed 1:1 by the sum of all virtual stablecoins across collateral pools when collateral ratios are healthy (CR > 100%).

## Per-Asset Invariant

Each collateral pool maintains its own invariant:

$$
\text{ASSET TVL} = \text{vUSD Supply} \times \text{vUSD Price} + \text{xASSET Supply} \times \text{xASSET Price}
$$

Where vUSD is always worth \$1.

### SOL Pool

$$
\text{SOL TVL} = \text{vUSD}_{\text{SOL}}\text{ Supply} \times \$1 + \text{xSOL Supply} \times \text{xSOL Price}
$$

### BTC Pool

$$
\text{BTC TVL} = \text{vUSD}_{\text{BTC}}\text{ Supply} \times \$1 + \text{xBTC Supply} \times \text{xBTC Price}
$$

## True Asset Value

### SOL LST Pricing

For SOL LSTs, we use the **Sanctum SOL value calculator program** to determine the true LST price based on the amount of SOL held in each stake pool, avoiding market manipulation risks:

$$
\text{True LST Price} = \frac{\text{Amount of SOL in Stake Pool}}{\text{Total LST Supply}}
$$

### BTC Pricing

For wrapped BTC, we use price oracles to determine the true BTC value in USD.

## Price Oracles

To calculate USD values and maintain pegs, we use price oracles:

* **SOL/USD:** Pyth SOL/USD price oracle
* **BTC/USD:** Pyth BTC/USD price oracle
* **USDC/USD:** Pyth USDC/USD price oracle

## Net Asset Value (NAV) Calculations

### vUSD NAV

Virtual stablecoins maintain a \$1 NAV in healthy conditions:

$$
\text{vUSD NAV}_{\text{USD}} = \$1
$$

In terms of the underlying asset:

$$
\text{vUSD NAV}_{\text{ASSET}} = \frac{1}{\text{ASSET Price (USD)}}
$$

### xASSET NAV

The NAV of leverage tokens uses the excess collateral value beyond vUSD backing:

$$
\text{xASSET NAV}_{\text{USD}} = \frac{\text{ASSET TVL (USD)} - \text{vUSD Supply}}{\text{xASSET Supply}}
$$

If xASSET supply is zero, NAV defaults to \$1.

### hyUSD NAV

$$
\text{hyUSD NAV}_{\text{USD}} = \$1
$$

## Collateral Ratio Calculations

### Per-Asset Collateral Ratio

Each asset pool has its own collateral ratio:

$$
\text{CR} = \frac{\text{Total Collateral} \times \text{Collateral Price}}{\text{vUSD Supply}}
$$

### Max Mintable Stablecoin

The protocol caps stablecoin minting to prevent CR from dropping below a safety threshold:

$$
\text{Max Mintable} = \frac{\text{TVL} - \text{Target CR} \times \text{Current vUSD Supply}}{\text{Target CR} - 1}
$$

Where **Target CR** is the configured stablecoin mint threshold, which is constrained on-chain to lie within the **Neutral zone (135% – 165%)**. Minting is blocked if it would push the projected CR out of this band.

### Max Swappable Stablecoin

When converting xASSET to hyUSD within a pool (no TVL change):

$$
\text{Max Swappable} = \frac{\text{TVL}}{\text{Target CR}} - \text{vUSD Supply}
$$

### Rebalance Zones

Each pool's CR maps to one of six **rebalance zones**. The zone determines which rebalancing route is open, how rebalance pricing behaves, and which fee schedule applies. (These zones replace the former "stability mode" thresholds.)

| CR Range    | Zone         | Behavior                                                        |
| ----------- | ------------ | --------------------------------------------------------------- |
| \< 100%     | Destabilized | xASSET NAV → 0; rebalancing, P\&L settlement, and minting halt  |
| 100% – 120% | Sell Zone 2  | Sell route active; rebalance price clamped flat at max discount |
| 120% – 135% | Sell Zone 1  | Sell route active; rebalance price interpolates                 |
| 135% – 165% | Neutral      | Target band; no rebalancing routes                              |
| 165% – 175% | Buy Zone 1   | Buy route active; rebalance price interpolates                  |
| ≥ 175%      | Buy Zone 2   | Buy route active; rebalance price clamped flat at max premium   |

Zone boundaries are half-open: the lower bound is inclusive, the upper exclusive.

## xASSET Effective Leverage

The effective leverage for any xASSET:

$$
\text{xASSET Effective Leverage} = \frac{\text{ASSET TVL}}{\text{xASSET Market Cap}}
$$

Where:

$$
\text{xASSET Market Cap} = \text{xASSET NAV} \times \text{xASSET Supply}
$$

The effective leverage approaches infinity as CR approaches 100%, and approaches 1 as CR increases.

## Dynamic Collateral Routing

### Piecewise-Linear Fee Curves

Hylo uses two independent fee curves for hyUSD minting and redemption. Each curve is defined as a set of (CR, fee) control points with linear interpolation between them.

**Mint fee curve:**

* Domain: CR range bounded below by the Neutral zone threshold
* Shape: monotonically decreasing; fee is highest at the lower CR bound, falling to zero at the upper bound
* Below domain: minting is blocked (no valid fee)
* Above domain: fee clamps to zero

**Redeem fee curve:**

* Domain: wider CR range extending down toward the Destabilized threshold
* Shape: monotonically increasing; fee is zero at the lower CR bound, rising to maximum at the upper bound
* Below domain: fee clamps to zero
* Above domain: fee clamps to maximum

### Projected CR for Fee Computation

Fees are evaluated at the **projected CR**, the CR after the operation:

**Mint projected CR:**

$$
\text{CR}_{\text{projected}} = \frac{(\text{Total Collateral} + \text{Deposit}) \times \text{Price}}{\text{vUSD Supply} + \text{New vUSD}}
$$

**Redeem projected CR:**

$$
\text{CR}_{\text{projected}} = \frac{(\text{Total Collateral} - \text{Withdrawal}) \times \text{Price}}{\text{vUSD Supply} - \text{Burned vUSD}}
$$

### xASSET Fees

xASSET (levercoin) fees use a discrete table indexed by **rebalance zone**, with separate mint / redeem rates per zone:

| Zone                           | Mint / Redeem (bps, example) |
| ------------------------------ | ---------------------------- |
| `normal` (Neutral & buy zones) | 100 / 100                    |
| `sell_zone_1`                  | 50 / 400                     |
| `sell_zone_2`                  | 0 / 800                      |
| Destabilized                   | minting & redemption blocked |

See [Anti-Destabilization Fees](/technical-addendum/additional-risk-management#anti-destabilization-fees) for why this schedule rarely binds in normal operation.

## Collateral Rebalancing

### Max Sellable Collateral (Low CR)

When a pool's CR drops into the sell zone, the maximum collateral available for sale targets the sell zone inner bound (**135%** CR):

$$
\text{Max Sellable} = \frac{\text{Sell Zone CR} \cdot \text{vUSD Supply} - \text{Price} \cdot \text{Total Collateral}}{\text{Price} \cdot (\text{Sell Zone CR} - 1)}
$$

### Max Buyable Collateral (High CR)

When a pool's CR rises into the buy zone, the maximum buyable collateral targets the buy zone inner bound (**165%** CR):

$$
\text{Max Buyable} = \frac{\text{Price} \cdot \text{Total Collateral} - \text{Buy Zone CR} \cdot \text{vUSD Supply}}{\text{Price} \cdot (\text{Buy Zone CR} - 1)}
$$

### Rebalance Pricing

Rebalance prices apply a signed percentage spread to the oracle spot price:

$$
\text{Rebalance Price} = \text{Spot} \times (1 + \delta(\text{CR}))
$$

Where $\delta(\text{CR})$ interpolates linearly between two per-asset configured spreads of **opposite sign** (one at the inner bound, one at the outer bound), so it crosses zero (the unadjusted oracle price) partway through the zone. See [Rebalance Pricing](/protocol-overview/collateral-rebalancing#rebalance-pricing) for which side each bound favors and why.

Both endpoint percentages are configurable per asset, determining how aggressively the protocol prices rebalancing activity for each pool. The schedule is a fixed set of percentages rather than a function of live market data, so prices are deterministic across the zone.

## Borrow Rate for Non-Yield Assets

For collateral pools without native yield (e.g., BTC), a per-epoch borrow rate is harvested:

$$
\text{Collateral Harvested} = \text{Vault Balance} \times \text{Rate Per Epoch}
$$

The harvested collateral is converted to hyUSD and distributed between the Earn Pool and treasury according to configurable allocation parameters.

## Yield Sources by Asset Type

| Asset Type    | Yield Source         | Mechanism                                                 |
| ------------- | -------------------- | --------------------------------------------------------- |
| SOL LSTs      | Native staking yield | LST price appreciation harvested per epoch                |
| Wrapped BTC   | Borrow rate          | Configurable per-epoch rate deducted from pool collateral |
| Future assets | Variable             | Either native yield or borrow rate                        |

## Earn Pool

### LP Token NAV

$$
\text{eHYUSD NAV} = \frac{\text{hyUSD in Pool}}{\text{eHYUSD Supply}}
$$

Returns \$1 if eHYUSD supply is zero.

### Deposit

$$
\text{eHYUSD Out} = \frac{\text{hyUSD In}}{\text{eHYUSD NAV}}
$$

### Withdrawal

Pro-rata share of both hyUSD and any xASSET in the pool, with a configurable withdrawal fee applied to the hyUSD portion.

## Average Reserve Yield (SOL Pool)

$$
\text{Average SOL Reserve Yield} = \frac{\sum_{j=1}^{n} (\text{Supply}_{\text{LST}_j} \times \text{Price}_{\text{LST}_j} \times \text{APY}_{\text{LST}_j})}{\text{Total SOL In Reserve}}
$$
