Coin-Level Metrics
| Cross-Exchange Margin Mode | Per-Exchange Margin Mode | |
|---|---|---|
| Exchange | USDT, BNB, BTC, ETH, SOL, XRP, USDC, KRAKEN_USD, and HYPERLIQUID_USDC serve as cross-exchange margin currencies and can be shared as margin across different exchanges. | Each exchange now supports more currencies (e.g., BTC, ETH, USDT, USDC, XRP, BNB, SOL) as per-exchange margin. You can choose the most suitable currency based on your needs and manage risk independently. |
| Coin Balance | Actual spot quantity | Same as left |
| Available Balance | = Coin Balance - Frozen Spot - Σ(Initial margin of isolated contract orders) - Σ(Isolated contract margin); where Frozen Spot is the amount frozen by spot open orders | Same as left |
| Coin Unrealized PnL | = Σ(Unrealized PnL of cross-margin contract positions + Unrealized PnL of leveraged positions) | Same as left |
| Liability | = ABS( MIN( Available Balance + Cross Unrealized PnL, 0)) | Same as left |
| Coin Equity | = Coin Balance + Cross Unrealized PnL - Σ(Initial margin of isolated contract orders) - Σ(Isolated contract margin); 0 for non-margin currencies | Same as left |
| Contract Initial Margin of the Coin | = Σ(Initial margin of cross-margin contracts + Initial margin of cross-margin contract open orders, across settlement currencies) | Same as left |
| Contract Maintenance Margin of the Coin | = Σ(Maintenance margin of cross-margin contracts, across settlement currencies) | Same as left |
| Borrowing Initial Margin of the Coin | = Σ(Initial margin of leveraged positions + Initial margin of leveraged open orders) + Liability / Coin Leverage Multiple | = Liability / Coin Leverage Multiple |
| Borrowing Maintenance Margin of the Coin | = Σ(Maintenance margin of leveraged positions) + Liability × Borrowing Maintenance Margin Rate | = Liability × Borrowing Maintenance Margin Rate |
Account-Level Metrics
| Cross-Exchange Margin Mode | Per-Exchange Margin Mode | |
|---|---|---|
| Description | In this mode, all exchanges are unified into a single account-level dataset | In this mode, each exchange has its own account-level dataset, calculated separately |
| Business | Spot, USDT-margined contracts, Cross leverage | Spot, USDT-margined contracts |
| Total Margin Balance | = Σ(Positive coin equity of margin currencies × Index price × Tiered discount rate) + Σ(Negative coin equity of margin currencies × Index price) - Spot open order losses | Same as left |
| Total Initial Margin | = Σ(Total initial margin of the coin × USDT-denominated index price of the coin + Total borrowing initial margin of the coin × USDT-denominated index price of the coin) | Same as left |
| Total Maintenance Margin | = Σ(Total maintenance margin of the coin × USDT-denominated index price of the coin) | Same as left |
| Total Initial Margin Rate | = Total Margin Balance / Total Initial Margin. Used to determine whether to automatically cancel orders. | Same as left |
| Total Maintenance Margin Rate | = Total Margin Balance / Total Maintenance Margin. Used to determine whether to trigger liquidation. | Same as left |
| Account Total Available Margin | = Total Margin Balance - Account Initial Margin. The remaining available margin after deducting the initial margin already in use. | Same as left |
Cross Margin vs. Isolated Margin
| Cross Margin | Isolated Margin | |
|---|---|---|
| Margin | Cross-margin positions in the current cross-exchange account share the account's available margin | Each position is allocated margin separately and does not share margin with other positions in the current cross-exchange account |
| Risk Scope | Losses from a single position consume the available margin of the cross-exchange account and affect other cross-margin positions in the account | Losses from a single position are usually limited to the margin allocated to that position and do not consume margin from other positions |
| PnL Offset | The unrealized PnL of cross-margin positions in the current cross-exchange account is combined into the account equity, jointly affecting the account's overall margin rate | Each position's PnL is calculated independently and is not shared or offset against other positions |
| Liquidation Trigger | Liquidation is triggered based on the overall margin rate of the current cross-exchange account | Liquidation is triggered when Isolated Margin + Unrealized PnL ≤ Position Maintenance Margin |
| Liquidation Impact | When triggered, one or more cross-margin positions in the current cross-exchange account may be reduced or liquidated | When triggered, only the corresponding position is processed; other positions are not affected |
Cross-Exchange Account Liquidation Risk Control Process
1. Automatic Order Cancellation
When the Total Initial Margin Rate falls below 100%, the system will automatically cancel open orders to reduce the initial margin occupied by open orders. Cancellation is performed sequentially: spot orders are canceled first, and contract orders are canceled last, according to the following rules:
- Cancel spot buy orders, starting with the largest order value.
- Cancel leveraged open orders, starting with those occupying the largest initial margin.
- When canceling contract open orders, first cancel position-opening orders without an existing position; if there are none, cancel position-increasing orders with an existing position, starting with those occupying the largest initial margin.
During sequential cancellation, after each order is canceled, the system re-checks whether the Initial Margin Rate is ≥ 100%. Once the condition is met, the cancellation process stops.
When the account's Total Initial Margin Rate is below 100%, the account's available margin balance is negative. You cannot increase positions and can only place closing orders, because closing orders do not occupy initial margin.
2. Forced Liquidation
For cross-margin liquidation, when the Total Maintenance Margin Rate ≤ 100%, the system initiates the forced liquidation process. If MMR > 100%, the liquidation process is terminated. The process is as follows:
- Cancel all open orders in parallel.
- For leveraged positions, begin closing positions in the following priority order: long positions first, then short positions, followed by liquidity ranking. A liquidation fee is charged.
- For positions in hedge mode, directly hedge the smaller position at the mark price. A liquidation fee is charged.
- For each contract position, begin downgrading the risk limit tier, ordered by liquidity. Once the tier has been downgraded enough to bring MMR to a safe level, submit all position-reducing orders to the exchange until MMR is safe or all positions are at Tier 1. A liquidation fee is charged.
- After all contract positions have been reduced to the first risk tier, the system may continue forced liquidation to reduce positions in order to minimize user losses. Liquidation stops when MMR > 100%, or the system may take over the positions directly and settle them at the bankruptcy price without charging a liquidation fee. After the internal system takeover account assumes the positions, it sells them directly at market price. If the sale results in a profit, the positive USDT balance is credited to the internal insurance pool; if it results in a loss, the insurance pool covers the negative USDT balance.
For isolated margin liquidation, when Isolated Margin + Unrealized PnL ≤ Position Maintenance Margin, the system initiates the forced liquidation process and charges a liquidation fee after execution.
- If the position value is greater than 100,000, 20% of the position is closed each time until the entire position is closed or Isolated Margin + Unrealized PnL > Position Maintenance Margin, at which point liquidation stops.
- If the position value is ≤ 100,000, the position is closed 100% at once.
3. Bankruptcy Price Calculation Rules
Long position: Bankruptcy price = Mark price at the time of liquidation × (1 - Maintenance margin rate of the position's risk limit tier)
Short position: Bankruptcy price = Mark price at the time of liquidation × (1 + Maintenance margin rate of the position's risk limit tier)
Margin Requirements for Leveraged Trading
1. Long Positions
Maintenance margin of a leveraged position = Position value × Maintenance margin rate of the position's tier - Tier offset + Estimated fee for fully closing the position
Initial margin of a leveraged position = Position value / Leverage multiple + Estimated fee for fully closing the position
Initial margin of a leveraged open order = Order value / Leverage multiple + Estimated closing fee + Estimated fill fee
2. Short Positions
Maintenance margin of a leveraged position = Position value × Maintenance margin rate of the position's tier - Tier offset + Estimated fee for fully closing the position
Initial margin of a leveraged position = Position value × Index price / Leverage multiple + Estimated fee for fully closing the position
Initial margin of a leveraged open order = Order value / Leverage multiple + Estimated closing fee + Estimated fill fee
The platform does not impose initial margin requirements on platform orders or position-reducing orders. Estimated fees are calculated at a rate of 0.075%.
Estimated closing fee: the fee required to close at the same price the increased position that would result if the open order were filled.
Margin Requirements for Contract Trading
1. One-Way Position Mode
Maintenance margin of a contract position = ABS(Position size) × Mark price × Maintenance margin rate corresponding to the user's risk limit tier - Tier offset + Estimated fee for fully closing the position
Initial margin of a contract position = ABS(Position size) × Mark price × 1 / Leverage multiple + Estimated fee for fully closing the position
Initial margin of a contract open order = ABS(Order size) × Order price × 1 / Leverage multiple + Estimated closing fee + Estimated fill fee
The platform does not impose initial margin requirements on platform orders or position-reducing orders. Estimated fees are calculated at a rate of 0.075% (the same applies below).
Estimated closing fee: the fee required to close at the same price the increased position that would result if the open order were filled.
2. Hedge Mode
Maintenance margin of hedge-mode positions = SUM(Maintenance margin of the long position - Tier offset + Estimated fee for fully closing the position, Maintenance margin of the short position - Tier offset + Estimated fee for fully closing the position)
Initial margin of hedge-mode positions = SUM(Initial margin of the long position + Estimated fee for fully closing the position, Initial margin of the short position + Estimated fee for fully closing the position)
Initial margin of an open order = ABS(Order size) × Order price × 1 / Leverage multiple + Estimated closing fee + Estimated fill fee
The platform does not impose initial margin requirements on platform orders or position-reducing orders.
Since the current margin currencies are only USDT / USDC, the initial margin and maintenance margin requirements for contracts are allocated to the USDT / USDC currencies:
Total maintenance margin of USDT / USDC currencies for contracts = SUM(Maintenance margin of all contract positions)
Total initial margin of USDT / USDC currencies for contracts = SUM(Initial margin of all contract positions and open orders)
Cross-Exchange Margin Mode Example
Suppose a user is in Cross-Exchange Margin Mode and holds two contract positions, as follows:
| Trading Pair | Leverage | Position Size | Entry Price | Mark Price | Notional Value | Unrealized PnL |
|---|---|---|---|---|---|---|
| BINANCE_FUTURE_BTC_USDT | 5 | 0.5 | 100,000 | 110,000 | 55,000 | 5,000 |
| OKX_FUTURE_ETH_USDT | 10 | -2 | 4,000 | 4,500 | 9,000 | -1,000 |
A leveraged short position, as follows:
| Trading Pair | Leverage | Position Assets | Liability | Index Price | Unrealized PnL |
|---|---|---|---|---|---|
| BINANCE_MARGIN_XRP_USDT | 4 | 2000 USDT | 1500 XRP | 2 | -1,000 |
Risk limits for BINANCE_FUTURE_BTC_USDT:
| Tier | Min Risk Limit Value | Max Risk Limit Value | Max Leverage | Maintenance Margin Rate | Tier Offset |
|---|---|---|---|---|---|
| 1 | 0 | 10,000 | 20 | 0.0065 | 0 |
| 2 | 10,000 | 90,000 | 10 | 0.01 | 35 |
| 3 | 90,000 | 2,000,000 | 16 | 0.02 | 935 |
Risk limits for OKX_FUTURE_ETH_USDT:
| Tier | Min Risk Limit Value | Max Risk Limit Value | Max Leverage | Maintenance Margin Rate | Tier Offset |
|---|---|---|---|---|---|
| 1 | 0 | 10,000 | 20 | 0.008 | 0 |
| 2 | 10,000 | 50,000 | 10 | 0.02 | 120 |
Borrowing tier limits for BINANCE_MARGIN_XRP_USDT:
| Tier | Min Risk Limit Value | Max Risk Limit Value | Max Leverage | Maintenance Margin Rate | Tier Offset |
|---|---|---|---|---|---|
| 1 | 0 | 8,000 | 9 | 2% | 0 |
| 2 | 8,000 | 15,000 | 3 | 3% | 80 |
CrossEx uses tiered risk limits: the maintenance margin rate of the tier in which the position's notional value falls is applied directly. The margin requirements for the positions are calculated as follows:
- BINANCE_FUTURE_BTC_USDT
Initial margin: 55,000 × 1 / 5 + 55,000 × 0.00075 = 11,041.25
Maintenance margin: 55,000 × 0.01 - 35 + 55,000 × 0.00075 = 556.25 - OKX_FUTURE_ETH_USDT
Initial margin: 9,000 × 1 / 10 + 9,000 × 0.00075 = 906.75
Maintenance margin: 9,000 × 0.008 + 9,000 × 0.00075 = 78.75 - BINANCE_MARGIN_XRP_USDT
Initial margin: 1,500 × 2 / 4 + 1,500 × 2 × 0.00075 = 752.25
Maintenance margin: 1,500 × 2 × 0.02 + 1,500 × 2 × 0.00075 = 62.25
Assume the user has 20,000 USDT and no other currencies or open orders. Based on the above, the user's account-level information is as follows:
| Field | API Field | Value |
|---|---|---|
| Total Margin Balance | Margin Balance | 20,000 + 5,000 - 1,000 - 1,000 = 23,000 |
| Total Initial Margin | Initial Margin | 11,041.25 + 906.75 + 752.25 = 12,700.25 |
| Total Maintenance Margin | Maintenance Margin | 556.25 + 78.75 + 92.25 = 697.25 |
| Total Initial Margin Rate | Initial Margin Rate | 23,000 / 12,700.25 ≈ 181.10% |
| Total Maintenance Margin Rate | Maintenance Margin Rate | 23,000 / 727.25 ≈ 3,298.67% |
| Account Total Available Margin | Available Margin | 23,000 - 12,700.25 = 10,299.75 |
USDT and USDC Margin Calculation in a Gate-Hyperliquid Hedging Scenario
Assume a user in Cross-Exchange Margin Mode holds a long position on Gate and a nearly equal short position on Hyperliquid, forming a cross-exchange hedge. After the market rises:
- Gate side: The long position's floating profit increases.
- Hyperliquid side: The short position's floating loss widens.
For ease of understanding, the following illustrative data is used (the order of magnitude is similar to a real cross-exchange hedging account, with figures rounded). The risk limit tiers and borrowing parameters for each trading pair are subject to GET /crossex/rule/risk_limits and the latest platform rules.
Coin-Level Metrics
| Currency | Balance | Unrealized PnL | Coin Equity | Liability | Contract Initial Margin | Contract Maintenance Margin | Borrowing Initial Margin | Borrowing Maintenance Margin |
|---|---|---|---|---|---|---|---|---|
| USDT | 400,000 | 340,000 | 740,000 | 0 | 160,000 | 55,000 | 0 | 0 |
| HYPERLIQUID_USDC | 3,500 | -340,000 | -336,500 | 336,500 | 195,000 | 99,000 | 67,300 | 33,650 |
USDT / USDC coin leverage multiple = 5
USDT / USDC borrowing maintenance margin rate = 10%
Account-Level Metrics
| Field | API Field | Calculation |
|---|---|---|
| Total Margin Balance | Margin Balance | 740,000 + (-336,500) = 403,500 |
| Total Initial Margin | Initial Margin | 160,000 + 195,000 + 67,300 = 422,300 |
| Total Maintenance Margin | Maintenance Margin | 55,000 + 99,000 + 33,650 = 187,650 |
| Total Initial Margin Rate | Initial Margin Rate | 403,500 ÷ 422,300 ≈ 95.5% |
| Total Maintenance Margin Rate | Maintenance Margin Rate | 403,500 ÷ 187,650 ≈ 215% |
| Account Total Available Margin | Available Margin | 403,500 - 422,300 ≈ -18,800 |
Note: CrossEx uses tiered risk limits: the maintenance margin rate and tier offset of the tier in which the position's notional value falls are applied.
Scenario Analysis
Sharing improves capital efficiency at the account level, but it does not mean USDT and USDC are automatically interchangeable, nor does it mean that margin usage on both sides offsets each other.
When Hyperliquid's floating loss makes the HYPERLIQUID_USDC equity negative, please note:
- A coin liability is created. Liability ≈ ABS(MIN(Balance + Unrealized PnL, 0)) = ABS(MIN(3,500 + (-340,000), 0)) = 336,500
- The liability additionally occupies borrowing margin.
| Item | Formula | This Example |
|---|---|---|
| Borrowing Initial Margin | Liability ÷ Coin leverage multiple | 336,500 ÷ 5 = 67,300 |
| Borrowing Maintenance Margin | Liability × Borrowing maintenance margin rate | 336,500 × 10% = 33,650 |
-
This portion is included in the account's total IM along with the contract initial margin.
-
The following situation may occur: MMR remains safe, but IMR < 100%.
- MMR ≥ 100%: No liquidation is triggered for now.
- IMR < 100%: Available margin is negative. You cannot increase positions and can only place closing orders, because closing orders do not occupy initial margin. This is common when the hedge's net equity does not change much, but a price increase pushes up the notional value and IM on both sides, or when Hyperliquid liabilities push up the borrowing IM.
-
When the liability is large, the portion exceeding the platform's rule threshold may accrue interest and continue to occupy borrowing margin, affecting returns and available capacity to open positions. You can supplement USDC through instant conversion or transfer to repay the liability, or reduce margin usage by reducing positions via hedging.
Disclaimer
The content provided herein is for reference and educational purposes only and does not constitute any financial, investment, trading, or legal advice, nor does it constitute an offer or solicitation to buy or sell any digital assets. Gate makes no express or implied representations or warranties regarding the accuracy, completeness, or timeliness of the information contained herein. Product features, interfaces, rules, and fee structures may be updated or adjusted at any time. Please refer to the latest announcements and the actual information displayed on the Gate platform for the most accurate details.
Digital asset investments involve significant risk, and prices may fluctuate substantially. You may lose the entire amount of your investment. Please make decisions cautiously based on your own financial situation and risk tolerance after fully understanding the associated risks. If necessary, you are advised to consult an independent professional financial or legal advisor.
For more information about potential risks, please refer to Gate's Risk Disclosure and User Agreement.
