Skip to main content
Rails employs two core risk management mechanisms: Liquidation and Proactive Order Cancellation. Both operate on top of the cross-margin model, where your entire account equity serves as shared collateral across all open positions.

Cross-Margin Mode

All perpetual futures positions on Rails use cross-margin mode. Unrealized profits from one position can support others, but a decline in any position affects the entire account’s health. Account health is measured by the cross-margin ratio:
crossMarginRatio = totalMaintenanceMargin / accountEquity
See Position Metrics for the component formulas.

Liquidation

Liquidation is triggered when crossMarginRatio reaches 100% — meaning your account equity has fallen to exactly the minimum required to hold all open positions.

Liquidation Process

When the threshold is reached:
  1. All open orders are immediately cancelled.
  2. All positions are closed simultaneously at the best available market price.
  3. Any remaining funds after covering losses are returned to your balance.

Estimated Liquidation Price

Rails displays a per-position liquidation price estimate. See Position Metrics for the formula. In cross-margin mode this is an estimate that changes dynamically as other positions are opened or closed, index prices move, or funding payments accrue.

How to Avoid Liquidation

  • Deposit additional funds to increase account equity.
  • Reduce position size to lower total maintenance margin.
  • Set a stop-loss to automatically close a position before it deteriorates further.

Proactive Order Cancellation

A resting order that fills under deteriorated market conditions can push maintenance margin above account equity instantly. To prevent this, Rails cancels risky orders before they are matched.

How It Works

The system computes a simulated cross-margin ratio assuming all qualifying open orders are executed:
simulatedCrossMarginRatio = simulatedMaintenanceMargin / accountEquity
If this ratio reaches 90%, all orders that would increase net position exposure are cancelled. Orders that reduce position size (including reduceOnly orders) are never cancelled by this mechanism.

Which Orders Are Included

Only orders that would increase your net position exposure contribute to simulatedMaintenanceMargin. The system exempts offsetting/closing orders oldest-first up to the current position size; any remaining quantity that would open new exposure is included.
Order TypeIncluded in simulation?
Increases position size✅ Yes
reduceOnly order❌ No
Fully offsets existing position❌ No
Partially increases net exposure✅ Excess quantity only

Thresholds at a Glance

RatioTrigger
crossMarginRatio ≥ 100%Liquidation — all positions closed
simulatedCrossMarginRatio ≥ 90%Proactive cancellation — risk-increasing orders cancelled