# Margin Framework

Flash Trade's margin system uses two key parameters to manage risk and enable leveraged trading across different asset pools. Understanding these requirements is essential for maintaining healthy positions and avoiding liquidations.

### Overview

The margin framework consists of two main components:

* **Minimum Initial Margin** - Minimum collateral required to open a position
* **Minimum Maintenance Margin** - Minimum collateral required to keep a position open

These parameters vary by pool type to reflect different risk profiles and market conditions.

***

### Margin Requirements by Pool

| Pool                     | Assets              | Min Init. Margin    | Min Maint. Margin     | Max Leverage |
| ------------------------ | ------------------- | ------------------- | --------------------- | ------------ |
| **Crypto (Pool 1)**      | BTC, ETH, SOL       | 1% of position size | 0.2% of position size | 100x / 500x  |
| **Synthetic (Pool 2)**   | FX, Metals, Oil     | 1% of position size | 0.5% of position size | 100x / 200x  |
| **Solana Beta (Pool 3)** | JUP, JTO, RAY, etc. | 2% of position size | 1.0% of position size | 50x / 100x   |

#### Understanding the Numbers

{% columns %}
{% column width="41.66666666666667%" %}
**Initial Margin (Opening Positions)**:

* **Pool 1**: 1% = 100x maximum leverage
* **Pool 2**: 0.5% = 100x maximum leverage
* **Pool 3**: 5% = 50x maximum leverage
  {% endcolumn %}

{% column %}
**Maintenance Margin (Keeping Positions Open)**:

* **Pool 1**: 0.2% = 500x effective leverage at liquidation
* **Pool 2**: 0.25% = 200x effective leverage at liquidation
* **Pool 3**: 1.0% = 100x effective leverage at liquidation
  {% endcolumn %}
  {% endcolumns %}

***

### High Volatility Flag Impact

During periods of high market volatility, Flash Trade's pricing engine activates special risk management protocols that affect collateral valuation and position management.

{% columns %}
{% column %}

#### Collateral Valuation During Volatility

When the **High Volatility Flag** is active (as defined in the Price Engine section):

> **Conservative Pricing**: The lower bound of Pyth's confidence interval determines your collateral value, providing extra protection against rapid price movements.
> {% endcolumn %}

{% column %}

#### Position Pricing During Volatility

During High Volatility Flag periods, position pricing follows conservative principles:

> **Risk-Minimizing Approach**: Prices used for opening/closing positions and liquidation calculations will **maximize liabilities and minimize assets** for traders.
> {% endcolumn %}
> {% endcolumns %}

***

### Position-Specific Volatility Rules

{% tabs %}
{% tab title="Long Positions" %}
When holding long positions during High Volatility Flag periods:

**Price Impact**:

* **Lower bound** of Pyth's confidence interval is used for both:
  * Collateral valuation (discounted value)
  * Current PnL calculation (reduced profits)

**Liquidation Risk**:

* Double impact from discounted collateral AND reduced PnL
* If combined effect drops below maintenance margin → **Liquidation triggered**

{% hint style="info" %}

#### **Example Scenario**:

Long SOL Position: $100 collateral, $150 current price\
Pyth Price: $150 ± $10 confidence interval\
High Volatility Flag: Uses $140 (lower bound)\
Result: Both collateral and PnL calculated at $140
{% endhint %}
{% endtab %}

{% tab title="Short Positions" %}
When holding short positions during High Volatility Flag periods:

**Price Impact**:

* **Upper bound** of Pyth's confidence interval is used as a premium
* This increases the effective price affecting your position's PnL
* Higher effective prices reduce short position profitability

**Liquidation Risk**:

* If the adjusted pricing causes collateral to fall below maintenance margin → **Liquidation triggered**
* **Stablecoin depegs** compound this risk by reducing collateral value below $1

{% hint style="info" %}

#### **Example Scenario**:

Short ETH Position: $2,000 entry price\
Pyth Price: $1,950 ± $50 confidence interval\
High Volatility Flag: Uses $2,000 (upper bound)\
Result: No profit recognition despite favorable market move
{% endhint %}
{% endtab %}
{% endtabs %}

### Risk Management Implications

{% tabs %}
{% tab title="For Long Positions" %}

| Risk Factor               | Impact                   | Mitigation                   |
| ------------------------- | ------------------------ | ---------------------------- |
| **Discounted Collateral** | Reduced margin buffer    | Monitor confidence intervals |
| **Lower Bound PnL**       | Conservative profit calc | Plan for volatility periods  |
| **Double Discount**       | Accelerated liquidations | Use conservative leverage    |
| {% endtab %}              |                          |                              |

{% tab title="For Short Positions" %}

| Risk Factor             | Impact                | Mitigation                 |
| ----------------------- | --------------------- | -------------------------- |
| **Price Premiums**      | Reduced profitability | Monitor volatility flags   |
| **Stablecoin Depegs**   | Collateral value loss | Use diversified collateral |
| **Upper Bound Pricing** | Earlier liquidations  | Maintain higher margins    |
| {% endtab %}            |                       |                            |
| {% endtabs %}           |                       |                            |

### Best Practices

{% stepper %}
{% step %}

#### Margin Management

* **Maintain Buffer**: Keep collateral well above minimum requirements
* **Monitor Volatility**: Watch for High Volatility Flag activation
* **Size Appropriately**: Use lower leverage during uncertain periods
  {% endstep %}

{% step %}

#### Risk Monitoring

* **Track Confidence Intervals**: Large intervals indicate higher risk periods
* **Position Health**: Regularly check how volatility pricing affects your positions
* **Liquidation Distance**: Calculate margin to liquidation under worst-case pricing
  {% endstep %}

{% step %}

#### Strategic Considerations

* **Volatility Timing**: Consider closing positions before volatile events
* **Collateral Quality**: Prefer stable collateral during uncertain periods
* **Leverage Scaling**: Reduce leverage when confidence intervals widen
  {% endstep %}
  {% endstepper %}

***

### Technical Details

{% tabs %}
{% tab title="Margin Calculation Formula" %}
Position Health = (Collateral Value + Unrealized PnL) / Position Size

Where during High Volatility Flag:

* Collateral Value = Lower Bound of Confidence Interval
* Unrealized PnL = Calculated using bounds that minimize trader assets
  {% endtab %}

{% tab title="Liquidation Trigger" %}
Liquidation occurs when:\
Adjusted Position Health < Maintenance Margin Requirement

For Pool 1: Health < 0.2% of position size\
For Pool 2: Health < 0.25% of position size\
For Pool 3: Health < 1.0% of position size
{% 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://docs.flash.trade/flash-trade/flash-trade-protocol/perpetuals-specifications/margin-framework.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.
