# DSM Scenario Analysis

Scenario Analysis

<figure><img src="/files/bHHW5L5n5Ae1rbziKBJV" alt=""><figcaption><p>Dual Stability Mechanism Tree</p></figcaption></figure>

{% hint style="success" %}
The Dual Stability Mechanism (DSM) operates based on a straightforward logic that revolves around two key questions:

1. **What is the market price of USC?**
   * This determines whether USC is trading above, at, or below its $1 peg in the market.
2. **What is the state of the protocol’s reserves with respect to the USC market cap?**
   * This assesses whether the reserves are in excess, balanced (equilibrium), or in deficit relative to the total supply of USC.

By answering these questions, the DSM dynamically adjusts the supply of USC and manages the protocol's reserves to maintain stability, solvency, and the $1 peg across different market conditions.
{% endhint %}

According to the combination of the market price of USC and the state of the protocol’s reserves, arbitrage opportunities are defined and executed internally by the protocol. Below is a detailed description of each scenario within the Dual Stability Mechanism (DSM):

### Above $1

{% tabs %}
{% tab title="Excess Reserves" %}

<figure><img src="/files/l34BvQSWpqny2ClUDDOa" alt=""><figcaption><p>State of Excess Reserves and Above $1 </p></figcaption></figure>

{% hint style="success" %}
**Arbitrage Contract Steps**&#x20;

1. **Mint `deltaUSC`**:
   * The protocol mints the amount of USC needed to bring the market price back to $1, known as `deltaUSC`.
2. **Swap `deltaUSC` for ETH**:
   * The minted `deltaUSC` is swapped for ETH on the open market. Since USC is trading above $1, the amount of ETH received (`ethAmountReceived`) is greater than the equivalent value of `deltaUSC` in USD terms (`deltaInUSD`).
3. **Swap `deltaInETH` for CHI**:
   * The delta in ETH (`deltaInETH`) is then swapped for CHI tokens.
4. **Burn `chiAmountReceived`**:
   * The CHI tokens received from the swap are burned, reducing the total supply of CHI and increasing its scarcity.
5. **Reward `ethAmountReceived - deltaInETH` to Arbitrage Contract**:
   * The difference between the ETH received from the initial USC swap and the `deltaInETH` is rewarded to the arbitrage contract as a profit.
     {% endhint %}

{% hint style="info" %}
**Effect:**

1. **USC Spot Price retains the `targetPrice` of $1**:
   * This adjustment helps align the market price of USC with its intended $1 peg, ensuring stability within the protocol.
2. **`uscTotalSupplyValue` rises towards `reserveValue`**:
   * The total supply value of USC increases, bringing it closer to the reserve value.
     {% endhint %}
     {% endtab %}

{% tab title="Equilibrium Reserves " %}

<figure><img src="/files/cyZDlyqzMd0Fk6cBEupw" alt=""><figcaption><p>State of Equilibrium Reserves and Above $1</p></figcaption></figure>

{% hint style="success" %}

#### Arbitrage Contract Steps:

1. **Mint `deltaUSC`**:
   * The protocol mints the required amount of USC, known as `deltaUSC`, to address the price discrepancy.
2. **Swap `deltaUSC` for ETH**:
   * The minted `deltaUSC` is swapped for ETH on the market. Since USC is trading above $1, the amount of ETH received (`ethAmountReceived`) is greater than the equivalent value of `deltaUSC` in USD terms (`deltaInUSD`).
3. **Add `deltaInETH` to `ReserveHolder`**:
   * The deltaInETH is added to the ReserveHolder, contributing to the protocol's reserves and supporting the system's stability.
4. **Reward `ethAmountReceived - deltaInETH` to Arbitrage Contract**:
   * The difference between the ETH received from the swap (`ethAmountReceived`) and the `deltaInETH` is rewarded to the arbitrage contract as profit.
     {% endhint %}

{% hint style="info" %}
**Effect:**

1. **USC Spot Price retains the targetPrice of $1**:
   * This adjustment helps align the market price of USC with its intended $1 peg, ensuring stability within the protocol.
2. **`uscTotalSupplyValue` rises together with the `reserveValue`**:
   * The total supply value of USC increases at the same rate as the protocol's reserves, maintaining a balanced and stable system.
     {% endhint %}
     {% endtab %}

{% tab title="Deficit Reserves" %}

<figure><img src="/files/SKLfJu2ITRzXfjCW8bLz" alt=""><figcaption><p>State of Deficit Reserves and Above $1</p></figcaption></figure>

{% hint style="success" %}
**Arbitrage Contract Steps**&#x20;

* **Mint `deltaUSC`**:
  * The protocol mints the required amount of USC, referred to as `deltaUSC`, to address the price discrepancy.
* **Swap `deltaUSC` for ETH**:
  * The minted `deltaUSC` is swapped for ETH on the market. Since USC is trading above $1, the amount of ETH received (`ethAmountReceived`) is greater than the equivalent value of `deltaUSC` in USD terms (`deltaInUSD`).
* **Add deltaInETH to ReserveHolder**:
  * The `deltaInETH`, representing the value of ETH equivalent to `deltaUSC`, is added to the `ReserveHolder`, strengthening the protocol's reserves.
* **Reward `ethAmountReceived - deltaInETH` to Arbitrage Contract**:
  * The difference between the ETH received from the swap (`ethAmountReceived`) and `deltaInETH` is allocated as a reward to the arbitrage contract, providing an incentive for maintaining the stability of USC.
    {% endhint %}

{% hint style="info" %}
**Effect:**

1. **USC Spot Price retains the `targetPrice` of $1**:
   * This adjustment helps align the market price of USC with its intended $1 peg, ensuring stability within the protocol.
2. **`uscTotalSupplyValue` rises together with the `reserveValue`**:
   * The total supply value of USC increases at the same rate as the protocol's reserves, strengthening the protocol's collateral and ensuring a stable, well-supported system.
     {% endhint %}
     {% endtab %}
     {% endtabs %}

### At $1

{% tabs %}
{% tab title="Excess Reserves" %}

<figure><img src="/files/QPwnTOVBNem4teXwThlh" alt="" width="563"><figcaption><p>tate of Excess Reserves and At $1</p></figcaption></figure>

{% hint style="success" %}
**Arbitrage Contract Step:**&#x20;

* **Mint `reserveDiff` in USC and Deposit in the Arbitrage Contract**:
  * The protocol mints USC equal to the `reserveDiff` (the difference between the reserve value and the USC supply) and deposits it into the arbitrage contract.
    {% endhint %}

{% hint style="info" %}
**Effect:**

* **`uscTotalSupplyValue` rises towards `reserveValue`**:
  * The total supply value of USC increases, aligning it to the reserve value, which enhances the stability and balance of the protocol.
    {% endhint %}
    {% endtab %}

{% tab title="Deficit Reserves (1)" %}

<figure><img src="/files/t9yasucOR1bUh5TAIn8q" alt="" width="563"><figcaption><p>State of Deficit Reserves and At $1 (Solvency)</p></figcaption></figure>

{% hint style="success" %}
**Arbitrage Contract Step (`reserveDiffInUsc ≤ totalMintedUsc`):**

1. **Burn `totalMintedUsc` from the Arbitrage Contract**:
   * The protocol burns the `totalMintedUsc` held in the arbitrage contract, reducing the circulating supply of USC.
     {% endhint %}

{% hint style="info" %}
**Effect**:

* **`uscTotalSupplyValue` decreases towards `reserveValue`**:
  * The total supply value of USC decreases, bringing it to the same level as the reserve value, which helps restore balance and stability within the protocol.
    {% endhint %}
    {% endtab %}

{% tab title="Deficit Reserves (2)" %}

<figure><img src="/files/7OU7crWBQqcaKbcbaTZi" alt="" width="563"><figcaption><p>State of Deficit Reserves and At $1 (Insolvency)</p></figcaption></figure>

{% hint style="success" %}
**Arbitrage Contract Steps (Assuming`totalMintedUsc = 0`):**

1. **Mint `≈ reserveDiff` in CHI**:
   * The protocol mints an amount of CHI approximately equal to the `reserveDiff`, which represents the shortfall in the reserves relative to the USC supply.
2. **Swap `chiToCoverEth` for ETH and Add ETH to `ReserveHolder`**:
   * The minted CHI is swapped for ETH, and the obtained ETH is added to the `ReserveHolder`, boosting the protocol’s reserves.
     {% endhint %}

{% hint style="info" %}
**Effect:**

* **`reserveValue` rises towards `uscTotalSupplyValue`**:
  * The value of the protocol’s reserves increases, bringing it to the same level as the total supply value of USC, thereby enhancing the stability and solvency of the system
    {% endhint %}
    {% endtab %}
    {% endtabs %}

### Below $1

{% tabs %}
{% tab title="Excess Reserves" %}

<figure><img src="/files/fCc3fPlo6NQlleA36lDn" alt="" width="563"><figcaption><p>State of Excess Reserves and Below $1</p></figcaption></figure>

{% hint style="success" %}
**Arbitrage Contract Steps:**

1. **Redeem `deltaETH` from Reserves**:
   * The protocol redeems the required amount of ETH, referred to as `deltaETH`, from the reserves.
2. **Swap `deltaETH` for USC**:
   * The redeemed `deltaETH` is swapped for USC. Since USC is trading below $1, the amount of USC received (`uscAmountReceived`) is greater than the equivalent value of `deltaETH` in USD terms (`deltaUsd`).
3. **Set `uscAmountToFreeze = deltaUsd`**:
   * The protocol sets the amount of USC to freeze (`uscAmountToFreeze`) equal to the value of `deltaUsd`, ensuring a calculated reduction in circulating supply.
4. **Maintain `uscAmountToFreeze` as Reward**:
   * The `uscAmountToFreeze` is maintained as a reward mechanism, helping generation of revenues within the system.
5. **Reward `uscAmountReceived - uscAmountToFreeze` to Arbitrage Contract**:
   * The difference between the `uscAmountReceived` and `uscAmountToFreeze` is rewarded to the arbitrage contract, providing an incentive for participating in the stabilisation process.
     {% endhint %}

{% hint style="info" %}
**Effect:**

* **`reserveValue` decreases towards `uscTotalSupplyValue`**:
  * The value of the protocol’s reserves decreases, bringing it closer to the total supply value of USC. This adjustment helps restore balance between the reserves and the circulating USC supply, ensuring the stability of the system.
    {% endhint %}
    {% endtab %}

{% tab title="Equilibrium Reserves " %}

<figure><img src="/files/9oFdQ9dk3Iv5dBpKCnUk" alt="" width="563"><figcaption><p>State of Equilibrium Reserves and Below $1</p></figcaption></figure>

{% hint style="success" %}
**Arbitrage Contract Steps:**

1. **Redeem `deltaETH` from Reserves**:
   * The protocol redeems the required amount of ETH, referred to as `deltaETH`, from the reserves.
2. **Swap `deltaETH` for USC**:
   * The redeemed `deltaETH` is swapped for USC. Since USC is trading below $1, the amount of USC received (`uscAmountReceived`) is greater than the equivalent value of `deltaETH` in USD terms (`deltaUsd`).
3. **Set `uscAmountToBurn = deltaUsd`**:
   * The protocol sets the amount of USC to burn (`uscAmountToBurn`) equal to the value of `deltaUsd`, reducing the circulating supply.
4. **Burn `uscAmountToBurn`**:
   * The protocol burns the `uscAmountToBurn`, effectively decreasing the total supply of USC.
5. **Reward `uscAmountReceived - uscAmountToBurn` to Arbitrage Contract**:
   * The difference between `uscAmountReceived` and `uscAmountToBurn` is rewarded to the arbitrage contract, providing an incentive for participating in the stabilisation process.
     {% endhint %}

{% hint style="info" %}
**Effect:**

* **`reserveValue` and `uscTotalSupplyValue` lower at the same rate**:
  * Both the reserve value and the total supply of USC decrease simultaneously, maintaining a balanced relationship between them and ensuring continued stability within the protocol.
    {% endhint %}
    {% endtab %}

{% tab title="Deficit Reserves" %}

<figure><img src="/files/W1z4Mv4qbP1ZD8oJTS9P" alt="" width="563"><figcaption><p>State of Deficit Reserves and Below $1</p></figcaption></figure>

{% hint style="success" %}

#### Arbitrage Contract Steps:

1. **Mint `≈ deltaUSD` in CHI and Swap it for ETH**:
   * The protocol mints an amount of CHI approximately equal to `deltaUSD` and swaps it for ETH.
2. **Swap `ethAmountFromChi` for USC**:
   * The ETH obtained from the CHI swap (`ethAmountFromChi`) is then swapped for USC. Since USC is trading below $1, the amount of USC received (`uscAmountReceived`) is greater than the equivalent value of `deltaUSD`.
3. **Set `uscAmountToBurn = deltaUSD`**:
   * The protocol sets the amount of USC to burn (`uscAmountToBurn`) equal to `deltaUSD`, which helps reduce the circulating supply of USC.
4. **Burn `uscAmountToBurn`**:
   * The protocol burns the `uscAmountToBurn`, thereby decreasing the total supply of USC.
5. **Reward `uscAmountReceived - uscAmountToBurn` to Arbitrage Contract**:
   * The difference between `uscAmountReceived` and `uscAmountToBurn` is rewarded to the arbitrage contract, incentivising the stabilisation process.
     {% endhint %}

{% hint style="info" %}
**Effect:**

* **`uscTotalSupplyValue` decreases towards `reserveValue`**:
  * The total supply value of USC decreases, moving closer to the reserve value, which helps restore balance and stability within the protocol.
    {% endhint %}
    {% endtab %}
    {% endtabs %}


---

# 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://chi-protocol.gitbook.io/chi-docs/concepts/dual-stability-mechanism-dsm/dsm-scenario-analysis.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.
