# Tranching

Credit Vaults can **optionally** activate a tranching mechanism to allow users to tailor their lending experience to various risk appetites.

<details>

<summary>Senior class</summary>

This class offers **intrinsic protection on funds**, given by Junior deposits. \
Senior Tranche LPs intrinsically **have a first lien on the underlying assets**, i.e., they are first in line to be repaid in case of default (hack or loss of funds).

</details>

<details>

<summary>Junior class</summary>

This class offers a **greater yield** by dragging more exposure to the underlying yield.\
Junior Tranche LPs have a second lien or no lien at all in case of default (hack or loss of funds).

The Junior class is designed to receive a higher share of yield compared to the Senior one, to proportionally compensate for the higher risk taken.

</details>

### Yield split

The Tranching feature relies on a unique mechanism that manages the return distribution dynamically conditional to the liquidity deposited on each side (Senior, Junior) of the Credit Vault.

* **Senior class** receives most of the underlying yield when liquidity is low on the Junior side (low coverage), or receives a guaranteed minimum portion of the underlying yield when Junior liquidity is high (high coverage)
* **Junior class** receives outperforming APYs, no matter the Senior class liquidity

<details>

<summary>Formulae</summary>

#### Liquidity ratios <a href="#liquidity-ratios" id="liquidity-ratios"></a>

First, we define the Senior and Junior TVL ratios as

$$\text{TVL ratio}*{Sr} = \frac{\text{Liquidity}*{Senior}}{\text{Liquidity}\_{Senior + Junior}}$$

$$\text{TVL ratio}*{Jr} = \frac{\text{Liquidity}*{Junior}}{\text{Liquidity}\_{Senior + Junior}}$$

#### Senior and Junior yields <a href="#senior-and-junior-yields" id="senior-and-junior-yields"></a>

The Senior return can be calculated as

$$\text{APY}*{Sr} = \text{Base APY} \times \text{Yield share}*{Sr} \qquad \tag{1}$$

where the *Base APY* is the underlying Tranches yield and the *Yield share* of the Senior side is a piecewise function conditional to the liquidity on the Senior tranche.

$$\text{Yield share}*{Sr} =  \begin{dcases}  99% & \text{if } \text{TVL ratio}*{Sr} \geq 99%  \         \          \dfrac{\text{Liquidity}*{Senior}}{\text{Liquidity}*{Senior + Junior}} & \text{if } \text{TVL ratio}*{Sr} > 50%  \         \         50% & \text{if } \text{TVL ratio}*{Sr} \leq 50%  \     \end{dcases}$$

The Junior return can be calculated as

$$\text{APY}*{Jr} = \frac{(\text{Base APY} - \text{APY}*{Sr}) \times \text{TVL ratio}*{Sr}}{\text{TVL ratio}*{Jr}} + \text{Base APY} \qquad \tag{2}$$

When Senior liquidity represents 50-99% of the funds in the Tranche, we use Equation (1) to compute the Yield share of the Senior side.&#x20;

Alternatively, we use some fixed percentages. There are two **hedge cases**:

1. The majority of the vault's liquidity lying on the Senior side (more than 99%)
2. Less than half of the vault's liquidity lying on the Senior side (less than 50%)

$$\text{Yield share}*{Sr} =      \begin{dcases}         99% & \text{if } \dfrac{\text{Liquidity}*{Senior}}{\text{Liquidity}*{Senior + Junior}} \geq 99%  \         \         50% & \text{if } \dfrac{\text{Liquidity}*{Senior}}{\text{Liquidity}\_{Senior + Junior}} \leq 50%  \     \end{dcases}$$

In the first case, we set the Yield share of the Senior class equal to 99% while in the second case, we set it equal to 50%. These two hedge cases link to the principle that

> * **Senior class** receives most of the underlying yield when liquidity is low on the Junior side (low coverage), or receives a guaranteed minimum portion of the underlying yield when Junior liquidity is high (high coverage)
> * **Junior class** receives outperforming APYs, no matter the Senior class liquidity

The *guaranteed minimum portion*, aka the *Yield share* of the Senior Tranches, has been set to half the *Base APY* (see HC#2) when the Senior liquidity is smaller than the Junior one.

#### Senior coverage and Junior overperformance <a href="#senior-coverage-and-junior-overperformance" id="senior-coverage-and-junior-overperformance"></a>

The formulas of the Senior coverage provided by the Junior counterparty and the Junior boosted yield vs the underlying return are

$$\text{Coverage}*{Sr} = \frac{\text{Liquidity}*{Junior}}{\text{Liquidity}\_{Senior}}$$

$$\text{Overperformance}*{Jr} = \frac{\text{APY}*{Jr}}{\text{Base APY}}$$

The Senior coverage should not be confused with the overall Tranche coverage that is computed in proportion to the whole tranche TVL

$$\text{Tranche coverage} = \frac{\text{Liquidity}*{Junior}}{\text{Liquidity}*{Tranche}}$$

</details>

### Yield and loss scenarios <a href="#liquidity-ratios" id="liquidity-ratios"></a>

Let's assume to have a Credit Vault generating a 10% yield (base APY), where users deposit 10,000,000 DAI split as follows: 70% on the Senior class, and 30% on the Junior class.

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

#### **Standard case**

Between 50 and 99% of the total vault's liquidity lying on the Senior side

| Side   | Liquidity     | Expected APY |
| ------ | ------------- | ------------ |
| Senior | 8,000,000 DAI | 8%           |
| Junior | 2,000,000 DAI | 18%          |

The Senior Yield share is equal to 80%. Senior funds coverage is 25% and the Junior overperformance vs base APY is 1.8x. The Tranche coverage is 20%.&#x20;

#### **Hedge case #1**

Majority of the total vault's liquidity lies on the Senior side (≥ 99%). See the [#formulae](#formulae "mention") section.&#x20;

| Side   | Liquidity     | Expected APY |
| ------ | ------------- | ------------ |
| Senior | 9,999,900 DAI | 10%          |
| Junior | 100 DAI       | 20%          |

The Senior Yield share is set to 99% (HC#1). Senior funds coverage is 0% and the Junior overperformance vs base APY is 1.99x. The Tranche coverage is 0% as well.

#### **Hedge case #2**

Less than half of the total vault's liquidity lies on the Senior side (≤ 50%). See the [#formulae](#formulae "mention") section.&#x20;

| Side   | Liquidity     | Expected APY |
| ------ | ------------- | ------------ |
| Senior | 4,000,000 DAI | 5%           |
| Junior | 6,000,000 DAI | 13%          |

The Senior Yield share is set to 50% (HC#2). Senior funds coverage is 150% and the Junior overperformance vs base APY is 1.33x. The Tranche coverage is 60%.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pareto.credit/product/credit-vaults/tranching.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
