> For the complete documentation index, see [llms.txt](https://help.rails.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.rails.xyz/trading/perpetuals/margin-modes.md).

# Margin Modes

{% hint style="info" %}
All calculations are located in our [Perps Metrics guide](/trading/perpetuals/perps-metrics-guide.md). Try our [Risk Engine Simulator](https://rails.xyz/demos) to further understand how Margin & Liquidation work on Rails.
{% endhint %}

Rails supports two margin modes: **Cross-Margin** (default) and **Isolated Margin**, each with its own collateral pool and [liquidation](/trading/perpetuals/liquidation.md) mechanics:

{% tabs %}
{% tab title="Cross Margin Mode (Default)" %}
In **cross-margin mode**, your entire cross-margin equity acts as shared collateral across all cross margin positions. Unrealized profits from one position can help support another, but deterioration in any position affects the entire account’s health.

Because unrealized P\&L updates as the mark price moves, your cross-margin equity and liquidation buffer update continuously. Additionally, any positions in isolated margin mode are excluded from the cross-margin pool.

<figure><img src="/files/0pKyMSNzxFJ0dZBwic6O" alt="" width="375"><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Isolated Margin Mode" %}
In **isolated margin mode**, each position has its own dedicated margin pool. The collateral allocated to an isolated position is used exclusively for that position and has no effect on cross margin positions or other isolated positions.

* When creating or increasing an isolated position, the order margin is added to the Isolated Position Margin and is therefore **excluded from your Cross-Margin balance**.
* When partially closing an isolated position, the same proportion of margin is **released back to your Cross-Margin Balance**, and the realized P\&L from the closed portion is also added to Cross-Margin Balance.

<figure><img src="/files/FfpPkidYriTKeMx2YjWs" alt="" width="375"><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

{% hint style="info" %}
Increasing leverage increases risk by scaling down your Initial margin requirement (freeing up order margin in cross-margin and reducing upfront capital allocation in isolated margin) but directly compresses your risk buffer by amplifying both your potential returns and your sensitivity to adverse price movements.
{% endhint %}

## Adjusting Isolated Position Margin:

Once a position is open in isolated margin mode, you can manually add or remove margin to tune the position’s risk profile.

### Adding Margin

To add additional margin to your open isolated position, first find the pen icon ![](/files/NYYycb7lPYSOnJEIGhME) as shown below.

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

{% columns %}
{% column width="41.66666666666667%" %}
You'll be defaulted to the **Increase** margin modal. Entering an amount will display summary information about how your position margin, account margin, and more importantly your liquidation price, will change.

Select the **Increase Margin** button when you're ready to proceed.
{% endcolumn %}

{% column width="58.33333333333333%" %}

<figure><img src="/files/H5zDRAWJgfkGuIorlOXb" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

Once completed, your position will update accordingly:

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

{% hint style="info" %}
Available margin changes as the market moves. If you select 100%, you may need to adjust the amount or select 100% again if the market moves against you.
{% endhint %}

{% hint style="warning" %}
Increasing margin on an isolated-margin position decreases its risk of liquidation, but may increase the risk of liquidation on any cross-margin positions. This is because the margin is taken from your [cross-margin equity](/trading/perpetuals/perps-metrics-guide.md#cross-margin-equity) which impacts your [cross-margin ratio](/trading/perpetuals/perps-metrics-guide.md#cross-margin-ratio).
{% endhint %}

### Removing Margin

{% columns %}
{% column width="41.66666666666667%" %}
When decreasing additional margin from a position, the modal will show you any margin amount that is available to remove from your isolated position.

Select the **Decrease Margin** button when you're ready to proceed, and your position will be updated accordingly.

The [required margin](/trading/perpetuals/perps-metrics-guide.md#maintenance-margin) floor ensures the position retains enough collateral to remain open at its current leverage.
{% endcolumn %}

{% column width="58.33333333333333%" %}

<figure><img src="/files/2LpGl8qWzeQQM327PiAZ" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

{% hint style="warning" %}
Removing margin decreases [isolated position equity](/trading/perpetuals/perps-metrics-guide.md#isolated-position-equity) and reduces the buffer between the liquidation price and the mark price. Always verify the updated liquidation price before confirming changes, and use with caution.
{% endhint %}

## Adjusting Leverage

Leverage allows you to control larger notional positions with less upfront capital. Increasing leverage scales down your initial margin requirements across both margin modes, amplifying both your potential returns and your sensitivity to adverse price movements.

On Rails, leverage is selectable up to 5x and is configured per market:

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

To adjust your leverage multiplier for a specific market, use the leverage selector located within the order panel:

{% columns %}
{% column width="66.66666666666666%" %}

<figure><img src="/files/gS9odeW7C5bz4fS1IfDr" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column width="33.33333333333334%" %}
{% hint style="info" %}
Adjusting the leverage multiplier is only available through the order panel, and only for that specific market.
{% endhint %}
{% endcolumn %}
{% endcolumns %}

Increasing leverage on an isolated position lowers your [required margin](/trading/perpetuals/perps-metrics-guide.md#maintenance-margin), which increases [excess margin](/trading/perpetuals/perps-metrics-guide.md#excess-margin). The released margin is **not** automatically returned to [cross-margin balance](/trading/perpetuals/perps-metrics-guide.md#cross-margin-balance); it remains in isolated position margin until you explicitly remove it. Decreasing leverage has the opposite effect — it raises your required margin.

{% hint style="warning" %}
Increasing leverage reduces the buffer between the liquidation price and the mark price. Always verify the updated liquidation price before confirming changes, and use with caution.
{% endhint %}
