Multi-currency margin mode: cross margin trading

Published on Mar 21, 2023Updated on Apr 17, 202422 min read
  • Assets

  • Discount rate

  • Trading rules

  • Risk assessment

  • Order cancellation assessment

  • Pre-liquidation assessment

Introduction of multi-currency margin mode: Under this mode, users can trade with all instruments including spot, margin, futures, perpetual swap, and options, after assets are deposited to the multi-currency margin account. Margin calculations for order placement and holding positions will be in USD and the USD value of user's assets in different currencies will be used for these calculations. Under Auto-borrow mode, if the balance or equity of a certain currency in the user's account is insufficient while its equivalent value in USD is sufficient, users can continue selling the assets in this currency through spot trading, or trade the derivatives that are settled in this currency. When a certain currency's equity is less than 0 due to being oversold and the loss of contracts that are settled in this currency, the liability and the corresponding interest of this currency will be generated automatically.

Under the multi-currency margin mode, the risk is measured in USD. If the user's overall adjusted equity is sufficient to provide the maintenance margin for all positions in USD, all the positions will be maintained. If the adjusted equity is insufficient, all the positions under cross margin mode will be partially or fully forced liquidated. Users can segregate the risks via isolated positions.

Assets

Under multi-currency margin account mode, the assets will be displayed as below:

Asset Info

Module Terms Explainations
Currency Equity The total assets of a certain currency in the multi-currency cross margin account and isolated positions.

Equity = Balance in the multi-currency margin account + PnL in cross margin positions + Margin balance in isolated positions + P&L in isolated positions + Options market value - Accrued interest
Available margin The margin amount of a certain currency that can be used for cross Margin and Futures, Perpetual Swap, and Options (short positions) trading under multi-currency account mode.

Available margin = Max (0, Balance in cross margin account of certain currency + PnL in cross margin positions – Frozen equity)
Available balance The assets amount of a certain currency that can be used for isolated positions, spot and options (long positions) trading under multi-currency account mode.

Please be noted that this description is for order calculation only and will not displayed on the website.
Frozen equity The assets amount of a certain currency in the multi-currency account that has been occupied, including pending orders and positions occupation and accrued interest in cross margin, pending orders occupation under isolated margin mode, and used in trading bots.
Unrealized P&L The sum of the unrealized PnL of all margin and derivatives positions that settled with a certain currency, including positions under the cross and isolated margin mode.

Unrealized PnL = Unrealized PnL of positions in cross margin mode + Unrealized PnL of positions under isolated margin mode

1) Unrealized PnL of positions of cross margin mode = Unrealized PnL of futures positions under cross margin mode + Unrealized PnL of perpetual positions under cross margin mode + Unrealized PnL of options positions under cross margin mode

2) Unrealized PnL of positions of isolated margin mode = Unrealized PnL of Margin positions under isolated margin mode + Unrealized PnL of Futures positions under isolated margin mode + Unrealized PnL of Perpetual positions under isolated margin mode + Unrealized PnL of Options positions under isolated margin mode
Liability Liability = Liability under cross margin and isolated positions mode

Lliability under cross margin mode = |Min (0, Balance of the currency under cross margin mode + Unrealized PnL under cross margin positions + Options market value under cross margin mode)|
Account Account equity The net value of all currencies in the user’s account after being converted into fiat.

Total equity = Sum (Amount of the currency * Price of the currency)

The price of currency is based on the USD index price of the currency on OKX platform. If a currency does not have a USD price, OKX will calculate accroding to the spot price of (Currency/USDT) * (USDT/USD) on OKX, if it does not have a USDT price, OKX will calculate accroding to the spot price of (Currency/USDC) * (USDC/USD) on OKX, if a currency does not have a USDC price, OKX will calculate accroding to the spot price of (Currency/BTC) * (BTC/USD) on OKX.
Adjusted equity The net fiat value of the assets in the account that can provide margins for spot, futures, perpetual swap and options under the cross margin mode.

Adjusted equity = Positive available equity under cross margin account of each currency * Spot price of USD * Currency discount rate + Negative available equity under cross margin account of each currency * Spot price of USD - Loss of spot selling orders, options buy orders and pending orders of opening positions under isolated margin mode - All estimated transaction fees of existed pending orders

Available equity under cross margin account = Balance under cross margin mode + Unrealized PnL of futures positions of cross margin mode + Unrealized PnL of perpetual swap positions under cross margin

Trading loss: It is not a real loss. It's a value decrease of fiat that can provide valid margins after traded under cross margin mode.

Loss of spot trading: The change in the value of the currency due to the difference in discount rates between the purchased currency and the sold currency.

Loss of buying options: The filled buying options are still belong to the account equity, cannot be used as margins.

Loss of pending orders of in isolated margin mode: After an isolated pending order is filled, the equity will become a position margin of isolated balance, cannot be used for providing cross margins for the positions.

Note: Currency assets are converted into fiat value through different discount rates according to the degree of liquidity.
Positions value (USD) The sum value of all cross positions, which is calculated in USD.
Note:
1. Futures and swaps of crypto-margined :
Position value (USD) = Face value * Number of contracts * Multiplier/Mark price * USD price
2. Futures and swaps of USDT-margined:
Position value (USD) = Face value * Number of contracts * Multiplier * Mark price * USD price
3. Options:
Position value (USD) = Face value * Number of contracts * Multiplier * USD price
4. Potential Borrowing
Frozen margin The fiat net value of all opened positions and pending orders margins in cross margin mode.
Frozen margin = Sum [(Potential borrowing frozen margin + Frozen amount when placing orders under cross margin mode + Initial margin under cross margin mode) of each crypto * crypto price]
Note: When user turns on the auto-borrowing mode under multi-currency cross margin mode, if the adjusted margin of fiat is sufficient, the user can sell the assets of this currency or trade the derivatives settled in the currency even though the balance of this currency is insufficient. In this case, a potential borrowing amount of this currency will be generated, and will take up potential borrowing margin with a certain percentage.
Maintenance margin The sum maintenance margins of all open positions under cross margin mode.
Maintenance margin = Sum [Maintenance margins for open positions in cross margin mode of each currency * Price of the currency]
Maintenance margin = Position value * Maintenance margin ratio

About Maintenance margin ratio rules, please refer to https://www.okx.com/trade-market/position
Leverage Entire leverage of account. Leverage = Position value (USD)/Adjusted margin
Margin level The risk assessment index of multi-currency cross margin account.

Margin level = Adjusted equity / (Maintenance margin + Transaction fees of position-reducing)
• Maintenance margin is calculated according to (Amount of holding positions + Amount of opened pending orders)
• Transaction fees of position-reducing are calculated according to (Amount of holding positions + Amount of opened pending orders)

Discount rate

Under multi-currency cross margin mode, assets of different currencies in cross margin accounts can be calculated into USD value and used as margins. Due to the volatility of each currency market, our platform calculates the actual USD value of each currency based on discount rates to balance market risks. The current currency discount rates are shown in the following table (our platform may adjust these rates according to the actual market on a regular basis): https://www.okx.com/trade-market/discountrate

Examples:

  1. Assuming there are a total of 1 BTC and 50,000 ZRX in user account, and BTC/USD index price is 50,000, because the currency discount rate of 50,000 ZRX is equal to 0, 1 BTC value is in 0~5,000,000 USD, the currency discount rate of 1 BTC is equal to 1. So the USD value of the account is 50,000 * 1 * 1 = 50,000 USD.

  2. Assuming there is a total of 11,000,000 USDT in user account, and USDT/USD index price is 1, because the currency discount rate of 11,000,000 USDT is in 10,000,000~20,000,000 USD, the USD value of the account is 5,000,000 * 1 * 1 + 5,000,000 * 1 * 0.975 + 1,000,000 * 1 * 0.975 = 10,850,000 USD.

  3. Currency has USD index: use the USD index to calculate the fiat value.

Currency doesn't have USD index, but has spot trading index of USDT: use the current platform's spot price in USDT trading pair * USDT/USD index price.

No USD index or spot trading pair of USDT, but has spot trading pairs of BTC: use the current platform's spot price in BTC trading pair * BTC/USD index price.

No USD index, USDT pair, or BTC pair in spot trading, but there are spot trading pairs of ETH: use the current platform's spot price in ETH pair * ETH/USD index price.

Trading rules

In the multi-currency account, users can choose to trade in cross margin mode or isolated margin mode. For the multi-currency cross margin mode:

  • All currency assets are calculated to USD value through different discount rates according to the degree of liquidity, and provide margin for all trading products.

  • Users can decide whether to open auto-borrow mode or not. When the user turns on the multi-currency auto-borrow mode, if the adjusted margin of the overall USD value is sufficient, he can sell the currency through spot trading or trade the derivatives that are settled in this currency even if the balance or equity of this certain currency is insufficient. In this case, a potential borrowing amount will be generated in the user's account and a partial adjusted margin will be frozen as a margin requirement at a certain percentage of the potential borrowing margin.

  • If the user turns on the multi-currency auto-borrow mode, the liability of a currency will be automatically generated when the equity of this currency is insufficient due to the oversold amount or the settlement loss in this currency. The generated interests will be calculated according to the real liability amount of the currency, and the real liability amount will freeze parts of the initial margin and maintenance margin based on the margin level of each currency.

  • If the user chooses multi-currency non-borrow mode, the user can use the available balance or equity of the currency only to place orders of spot, futures, perpetual swap, and options under cross margin mode and isolated mode. However, the account risk is measured by the overall adjusted equity under cross margin mode, so there may be a situation in which the equity of a certain currency cannot pay off the loss settled in this currency. In this situation, if the account has surplus equity in other currencies, and the overall USD value of the account is sufficient, the account will still be safe, and the real liability will be passively generated. If the liability is within the interest-free range of the currency, no interest will be charged. When the liability of the currency exceeds the interest-free limit, a forced repayment system (TWAP) will be triggered. The system will automatically use available equity of other currencies in the account to cover the liability and make it stay within the interest-free limit according to certain rules. The forced repayment(TWAP) will be executed: the positive assets are sold into USDT and repaying the liability with USDT.

  1. Assessment rules for Auto-borrow orders in multi-currency cross margin mode

In the multi-currency account, the user can turn on the auto-borrow mode. When a user trades with spot, futures, perpetual swap, and options trading under cross margin mode, the overall adjusted equity in the account should be greater than or equal to the frozen margin that includes the pending orders.

1) Example for the case that the adjusted equity is sufficient:

Crypto Equity Current Price (USD) Used as margin Discount rate
BTC 1 10,000 0.5 1
USDT 100 1 50 1
DASH 20 5 0 0.5

Place an order to sell 20 DASH at a price of 0.001BTC/DASH (for a simple calculation, excludes placement fees and interests)

Adjusted margin = Available assets in positive cross margin account of each currency * USD spot price * Currency discount rate + Available asset in negative cross margin account of each currency * USD spot price - Loss of spot selling, options buying and pending orders of opening positions under isolated margin mode - Estimated transaction fees of all existing pending orders

= 1 BTC * 10,000 USDT/BTC * 1 + 100 USDT * 1 + 20 DASH * 5 USDT/DASH * 0.5 = 10,150 USD

Since the discount rate of BTC is 1 ,the loss of this pending order = 0

The loss of spot trading is related to the discount rate of the bought currency. The lower the bought currency discount rate, the greater the trading loss. When the discount rate of the bought currency is 1, there is no loss.

Frozen margin including this pending order = 0.5 BTC * 10,000 USDT/BTC + 50 USDT = 5,050 USD

Adjusted margin > Overall frozen margin including this pending order

The order can be placed successfully

  1. The adjusted margin is sufficient, but the amount of a certain currency is insufficient, as shown below:
Crypto Equity Current Price (USD) Used as margin Discount
BTC 1 10,000 0.5 1
USDT 100 1 50 1
DASH 0 5 0 0.5

Place an order to sell 20 DASH at a price of 1 BTC/DASH (for a simple calculation, excludes placement fees and interests)

Adjusted margin = Available assets in positive cross margin account of each currency * USD spot price * Currency discount rate + Available asset in negative cross margin account of each currency * USD spot price - Loss of spot selling, options buying and pending orders of opening positions under isolated margin mode - Estimated transaction fees of all existing pending orders

= 1 BTC * 10,000 USDT/BTC * 1 + 100 USDT * 1 + 20 DASH * 5 USDT/DASH * 0.5 = 10,150 USD

Since the discount rate of BTC is 1 ,the loss of this pending order = 0

The loss of spot trading is related to the discount rate of the bought currency. The lower the bought currency discount rate, the greater the trading loss. When the discount rate of the bought currency is 1, there is no loss.

Frozen margin including this pending order = 0.5 BTC * 10,000 USDT/BTC + 50 USDT + Initial margin of potential borrowing amount = 5,060 USD

Note: User can sell the currency through spot trading or trade the derivatives that are settled in this currency even if the balance or equity of this certain currency is insufficient. In this case, a potential borrowing amount will be generated in the user's account and a partial adjusted margin will be frozen as a margin requirement at a certain percentage of the potential borrowing margin.

  • Initial margin requirement (IMR) of potential borrowing amount = Total potential borrowing amount * Initial margin ratio * USD spot price = 20 * 10% * 5 = 10 USD

  • The total potential borrowing amount is determined by the difference between the available equity of this currency under cross margin mode and the frozen amount of the currency. If the available equity of the currency is less than the frozen amount of the currency, the difference is the amount of potential borrowed crypto.

Adjusted margin > Overall frozen margin including this pending order

The order can be placed successfully

3) Introduction of potential borrowing limit and interest-free limit

a) Potential borrowing = Actual borrowing + Virtual borrowing

b) Margin borrowing, Options buyer borrowing, and negative UPL (unrealized PnL) caused by opening positions in Derivatives is Actual borrowing. Actual borrowing uses the user's Margin tier limit, main account limit, and the platform's total lending limit.

c) The borrowing used for opening positions in Derivatives is virtual borrowing. The virtual borrowing uses the user's Margin tier limit but does not use the user's main account limit and the platform's total lending limit.

For details of the interest-free limit rules, please refer to: https://www.okx.com/help/vi-interest-calculation

  1. Assessment rules for placing non-borrow order under multi-currency cross margin mode

Under the multi-currency margin mode, if the user wants to trade with the balance only, does not want to open a position with borrowing currency, the user can turn off "Auto-borrow" in the settings. When the user trades under the multi-currency cross margin mode under the "Non-borrow" setting, the overall adjusted margin in the account should be greater than or equal to the frozen margin including this pending order, and the available balance of the currency should be greater than or equal to the amount of currencies required

Note: The available balance is the amount of assets that can be used for isolated positions opening, spot, and options (long positions) trading in the multi-currency account.

  • The difference between available balance and available margin: the available balance does not include the cross mode PnL.

Example:

There are 1 BTC and 10,000 ETH in the account. When the adjusted equity> initial margin:

1. When the user places a spot selling order, the user can only sell 1 BTC;

2. When the user place a futures, perpetual swap, or options contract, the margin that can be used is 1 BTC only;

3. Users can only use 1 BTC for buying options.

There may be a situation in which the equity of a certain currency cannot pay off the loss settled in this currency. At this time, if the account has a surplus margin in other currencies, and the overall USD value of the account is sufficient, the account is still safe, and a liability will be passively generated.

If the liability is within the interest-free limit of the currency, no interest will be charged; when the liability of the currency exceeds the interest-free limit, the forced repayment system (TWAP) will be triggered. About the system's forced repayment rules, please refer to https://www.okx.com/help/ix-introduction-to-system-forced-repayment

  1. Trading rules for multi-currency cross margin mode

3.1 Perpetual/Futures in cross margin mode

Under the multi-currency margin mode, perpetual/futures derivatives support both Hedge and One-way mode, as shown in the following:

(1) Hedge mode

(2) One-way mode

Term Definition
Total For the One-way mode, the total of long positions is a positive number, and the total of short positions is a negative number.
Avail. Only shown under Hedge mode Avail. = Total – Positions of pending close orders
PnL Unrealized profit and loss of current positions
1. Crypto-margined futures/perpetual swap
PnL of long positions = Face value * |Number of contracts| * Multiplier * (1/Avg. open price – 1/Mark price)
PnL of short positions = Face value * |Number of contracts| * Multiplier * (1/Mark price – 1/Avg. open price)
2. USDT margined futures/perpetual swap
PnL of long positions = Face value * |Number of contracts| * Multiplier * (Mark price – Avg. open price)
PnL of short positions = Face value * |Number of contracts| * Multiplier * (Avg. open price – Mark price)
PnL ratio PnL/Position-opening margin
Initial margin 1. Crypto-margined futures/perpetual swap
Initial margin = Face value * |Number of contracts| * Multiplier / (Mark price * leverage)
2. USDT-margined futures/perpetual swap
Initial margin = Face value * |Number of contracts| * Multiplier * Mark price / Leverage
Maintenance margin 1. Crypto-margined futures/perpetual swap
Maintenance margin = Face value * |Number of contracts| * Multiplier * Maintenance margin ratio / Mark price
2. USDT margined futures/perpetual swap
Maintenance margin = Face value * |Number of contracts| * Multiplier * Maintenance margin ratio * Mark price

3.2 Options in cross margin mode

Under the multi-currency margin mode, you will be able to open long and short positions of options . The options positions are shown in the following:

Term Definition
Total The total of long positions is a positive number, and the total of short positions is a negative number.
Options value If the unit for calculating the price is currency, then options value = Total positions * Mark price
If the unit for calculating the price is the number of contracts, then options value =
Total positions * Mark price * Multiplier
PnL Unrealized profit or loss of current positions
PnL = (Mark price - Avg. open price) * Total positions * Multiplier
PnL ratio PnL of long positions = (Mark price – Avg. open price) / Avg. open price
PnL of short positions = (Avg. open price- Mark price) / Avg. open price
Initial margin
The initial margin for long positions is 0. For initial margin of short positions, please refer to Introduction to the calculation of options margin.
Maintenance margin
The maintenance margin for long positions is 0. For maintenance margin of short positions, please refer to Introduction to the calculation of options margin.

Risk assessment

The multi-currency margin mode has two levels of risk assessments. The first level is called the order cancellation assessment, and the second level is called the pre-liquidation assessment. This ensures that users can trade smoothly and avoid pending orders being canceled completely due to insufficient margin.

Order cancellation assessment

Order cancellation via risk control mechanisms will cancel part of the pending order when the user's account risk is higher than a certain level but has not yet reached the pre-liquidation risk level. This cancelation will revert the account back to a safe status and prevent the users from suddenly reaching the pre-liquidation level and causing all pending orders to be canceled.

Rules for "Order cancellation assessment" under multi-currency cross margin mode

  1. When Adjusted margin < Maintenance margin of all positions + Initial margin of placing orders when open position + fees,

all the pending orders when opening positions of futures, perpetual swap, and options under cross margin mode will be canceled. If the conditions still meet the requirement after cancellation, then this cancelation will result in a loss in spot trading.

  1. Non-borrow mode: (Currency available equity - Frozen balance) < Required maintenance margin for all the positions + Initial margin of the pending orders when open positions + Fees

All pending orders that will increase the amount of the frozen margin will be canceled.

When available balance < 0, orders of open positions under isolated mode, options buyer orders and pending orders for selling this currency will be canceled.

  1. Auto-borrow mode: Actual borrowing > Max borrowing limit, all the orders that increase liability will be canceled (including orders of open positions under isolated mode, options buyer orders and pending orders for selling this currency).

When available balance < 0, orders of open positions under isolated mode will be canceled.

Pre-liquidation assessment

The forced liquidation of multi-currency margin mode is based on whether the margin level reaches 100%.

When the margin level is <= 300%, the system will send a warning to reduce the positions and the user should be aware of the liquidation risk. 300% is the warning parameter, OKX reserves the right to adjust this parameter according to the actual situation.

When the margin level is <= 100%, the system will cancel orders according to the following rules, the order cancellation by pre-liquidation:

Instruments Mode Multi-currency cross mode
Futures/Perpetual Hedge mode Cancel all unfilled pending orders (including strategy orders) under cross margin mode;
Cancel the common placement orders under isolated margin mode; Cancel the limit orders and stop-loss orders of opening positions under isolated margin mode.
Keep the stop-profit&loss orders of closing positions under isolated margin mode and strategy orders except stop orders under isolated margin mode.
One-way mode Cancel all unfilled pending orders (including strategy orders) under cross margin mode;
Cancel the common placement orders under isolated margin mode;
Keep the strategy orders of closing under isolated margin mode.
Margin - Cancel all unfilled pending orders (including strategy orders) under cross margin mode;
Cancel the common placement orders under isolated margin mode;
Keep the strategy orders of closing under isolated margin mode.
Options - Cancel all unfilled pending orders under cross margin mode;
Cancel the placement orders under isolated margin mode;

If the margin level is still <= 100% after pending orders are canceled, forced liquidation will be executed.

The forced liquidation process has three phases. In each phase, the liquidated positions will be handed over to the forced liquidation engine at the current mark price, and a corresponding amount of maintenance margin will be charged (the maintenance margin is determined by the liquidation tier and will be used to offset the loss caused by the liquidation engine. The remaining part will be counted into the insurance fund). The options long position will not be liquidated.

Three phases of partial liquidation:

(1) Liquidation will start with the opposite positions of the same contracts under the Hedge mode.

(2) If the account fails to back to a safe status after all the positions mentioned in phase (1) are liquidated, the system will try to reduce the overall risk degree of the account while keeping the total delta value the same. In other words, for a particular index, the system will partially liquidate the positions that opposite in terms of delta value(Delta value refers to the change speed of the value of contract positions caused by the change of index price. If the two changes are in the same direction, the delta value will be positive; if the opposite, it will be negative. The more significant the change in contract value caused by the change of the same index, the greater the absolute value of delta). If multiple positions of the same index meet the requirement of hedging each other, the system will first partially liquidate those with more maintenance margins.

(3) If the account still fails back to a safe status after all positions mentioned in phase (2) are liquidated, which means the system is unable to make the total delta value of a certain index stay the same while reducing the risk degree of the account, then the system will try to partially liquidate the remaining positions that cannot hedge each other. During the liquidation process, the system will give priority to reducing the position with the most effective risk reduction. Each time positions will be partially liquidated by one level until the account is restored to safety.

For example, the current price of futures contract BTC-USD-0925 is 50,000USD/BTC, and we assume the assets allocation of an account is as follows:

Type Amount
Balance 3 BTC 10ETH
Positions Futures:BTCUSDUSD0925 1,000conts,Position delta > 0

Options: BTCUSD-20200626-65000-C -100conts,Position delta < 0
EOSUSD-20200925-6-C -10,000 conts,Position delta < 0
Pending order Futures:BTCUSD1225:100 conts, order price at 9,000
Perpetual:BTCUSD: -100 conts, order price at 8,000

When the margin level is 93%, liquidation will be executed. After all pending orders are canceled, the margin level becomes 95%, account gets into the liquidation process. At this time, the adjusted equity in the cross margin account is $170,000, and the maintenance margin is $200,000 USD.

Assume that the Hedge mode is enabled, and there are no opposite positions of the same contract, but there are opposite positions in terms of delta value in the BTCUSD index. Based on the calculation, the system liquidates 500 contracts of long positions in futures BTCUSD0925, -100 contracts of short positions in options BTCUSD-20200925-65000-C. After liquidation, the account equity is $169,000, and the maintenance margin is $180,000.

If the account is still risky and there are no opposite positions that can hedge each other in BTCUSD (all short positions of BTCUSD-20200626-65000-C are liquidated, and the delta value of the remaining positions is positive), the system will partially liquidate the remaining positions that cannot hedge each other.

When the liquidation results in negative assets, the system will use the insurance fund to offset the user's negative assets, and at this time, a corresponding bankruptcy loss bill will be generated.