For the complete documentation index, see llms.txt. This page is also available as Markdown.

Margin, Liquidation and Leverage

This section explains all risk management mechanisms on Rails in detail.

Efficient risk management is vital to maintaining portfolio health on Rails. This guide covers everything you need to know about navigating our core margin framework: selecting the right margin mode for your strategy, understanding dynamic liquidation calculations, utilizing leverage effectively, and managing the automated safeguards engineered to protect your account capital.

You can find all calculations detailed in our Trading Metrics guide here.

Explore each section below:

Margin Modes

Rails supports two margin modes: Cross-Margin (default) and Isolated Margin, each with it's own collateral pool and liquidation mechanics:

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 fluctuates in real-time with the market, your cross-margin equity is continuously updated. Additionally, any positions in isolated margin mode are excluded from the cross-margin pool.

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.

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 as shown below.

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.

Once completed, your position will update accordingly:

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.

Removing Margin

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 floor ensures the position retains enough collateral to remain open at its current leverage.

Adjusting Leverage

Increasing the leverage on an isolated position lowers your required margin, which increases excess margin. The released margin is not automatically returned to 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.

Liquidation

Liquidation is triggered when an account (in cross-margin mode) or position (in isolated margin mode) can no longer meet the minimum margin requirement:

Margin Mode
Liquidation Condition

Cross margin

Cross-Margin Equity falls below Total Maintenance Margin (i.e., your cross-margin ratio reaches 100%).

Isolated margin

Isolated Position Equity falls below the Position’s Maintenance Margin.

Liquidation Price

Rails displays an estimated liquidation price, which is the estimated price at which liquidation may be triggered if all other variables remains constant.

In cross-margin mode, the liquidation price shown for any individual position is an estimate and will change dynamically because:

  • Opening, closing, or modifying any cross margin position affects Total Maintenance Margin.

  • Changes in the index price of any held asset affect unrealized P&L and therefore Cross-Margin Equity.

  • Funding rate payments accrue to or from your balance over time.

  • Changes to isolated positions (e.g. adding margin, partial closes) affect your Cross-Margin Balance.

In isolated margin mode, the liquidation price for a position is more predictable since its equity is self-contained, but will shift if you add or remove margin from the position.

Liquidation price is calculated as shown below:

Liquidation Price=PindexS×Available MarginQ×(1MMR×S)\text{Liquidation Price} = P_{index} - \frac{{S} \times \text{Available Margin}}{\left|\text{Q}\right| \times \left(1 - \text{MMR} \times S\right)}

Where Available Margin\text{Available Margin} is dependent on Margin Mode Used:

  • In Cross-Margin: Available Margin=Cross Margin BalanceTotal Cross Maintenance Margin\text{Available Margin} = \text{Cross Margin Balance} - \text{Total Cross Maintenance Margin}

  • In Isolated Margin: Available Margin=Isolated Position EquityMaintenence Marginposition\text{Available Margin} = \text{Isolated Position Equity} - \text{Maintenence Margin}_{position}

Note: If the liquidation price of your position is less than or equal to zero, no liquidation price is displayed.

You can view the estimated liquidation price for each open position as shown below:

Liquidation Process & Avoiding Liquidation

A different liquidation process applies depending on the margin mode used:

Cross-margin liquidation is triggered when your cross-margin ratio reaches 100%, at which point:

  1. All open orders on cross margin positions are immediately cancelled.

  2. All cross margin positions are closed simultaneously by the liquidation engine at the best available market price.

  3. Any remaining funds after covering losses are returned to your balance

Cross-Margin Ratio
Account Status

< 100%

Healthy

≥ 100%

Liquidation triggered - all positions closed

When your simulated cross-margin ratio reaches 90%, any open orders will be proactively cancelled and you will be notified via email.

To avoid liquidation in cross-margin mode, we recommend:

  • depositing additional funds to raise your Total Balance and your cross-margin equity.

  • reducing your position size to lower your Total Maintenance Margin.

  • switching a position to isolated margin to uncouple it, and free up cross-margin collateral.

  • setting a stop-loss trigger order on open positions to automatically close them if the market moves against you.

In both cases, a liquidation fee may apply. See our current pricing & fees for more information.

Proactive Order Cancellation

Note: Proactive Order Cancellation applies in cross-margin mode only.

To mitigate the risk of immediate post-fill liquidations caused by market volatility, Rails utilizes a preventative risk safety mechanism called the Proactive Order Cancellation system. Instead of evaluating account health strictly after an execution, the system dynamically models risk asynchronously upon order book updates.

The system calculates a Simulated Cross-Margin ratio for your account by assuming all eligible open orders are executed:

Simulated Cross-Margin Ratio=Simulated Maintenance MarginCross Margin Equity\text{Simulated Cross-Margin Ratio} = \frac {\text{Simulated Maintenance Margin}}{\text{Cross Margin Equity}}

and

Simulated Maintenance Margin=Position Maintenance Margin +(Selected Order Value×MMR)\text{Simulated Maintenance Margin} = \text{Position Maintenance Margin } + (\text{Selected Order Value} \times MMR)

Where:

  • Position Maintenance Margin\text{Position Maintenance Margin} = the maintenance margin required for your current open positions.

  • Selected Order Value\text{Selected Order Value} = the notional value of open orders that would increase your net position exposure.

  • MMRMMR = Maintenance Margin Rate = 0.05

Order Cancellation Trigger

The Simulated Cross-Margin Ratio assesses the risk of pending orders and cancels those considered too risky before execution. When the 90% threshold is met, the system cancels qualifying orders to reduce the projected maintenance margin requirement, thereby lowering the account's risk profile.

Simulated Cross-Margin Ratio
Action

< 90%

No action. Orders remain active.

≥ 90%

All orders that would increase position exposure are cancelled.

If filling a resting order would simulate a cross-margin ratio of ≥ 90%, that order is cancelled proactively, protecting your account from the risk of an immediate post-fill liquidation.

Note:

  • Orders that reduce position size, including reduce-only orders, are not canceled by this mechanism.

  • Open orders on isolated margin positions that increase position size are included, as that margin is moved from the cross-margin balance into isolation position margin and may trigger liquidation. Proactive cancellation guards against this by treating position-increasing isolated orders as a simulated draw on cross margin equity.

  • You will be able to see cancelled orders for 7 days after cancellation.

Example:

Suppose you hold a 1 BTC Long position with two sell orders a 0.6 BTC Sell placed first, and a 0.8 BTC Sell placed second (1.4 BTC total).

The system exempts closing orders oldest-first up to the position size (1 BTC):

  • 0.6 BTC Sell (oldest) → fully exempted.

  • 0.8 BTC Sell (newer) → 0.4 BTC exempted to reach the 1 BTC position size; the remaining 0.4 BTC would open a net short and is included in Selected Order Value\text{Selected Order Value}.

What is 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 independently per market:

Changing Leverage

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

Selecting a new leverage multiplier only updates the parameter for that specific market.

Updating your leverage selection dynamically recalculates within the order panel prior to submitting your trade.

Last updated

Was this helpful?