Multi-currency margin mode: cross margin trading (Potential Borrow Optimisation)
To provide better trading services, OKX will update the calculation rules for potential borrowing and actual borrowing in multi-currency margin mode and portfolio margin mode. This rule change will gradually affect users starting from 8:00 am UTC on January 20, 2025. The new rules will be fully applied to all users by 8:00 am UTC on February 19, 2025.
To provide you with a preview and better understanding, these new product changes will be available on demo trading gradually between 8:00 am UTC on January 2, 2025, and 8:00 am UTC on January 8, 2025.
Introduction
In multi-currency cross-margin mode, you can trade all instruments, including spot or spot with margin, expiry futures, perpetual futures, and options after depositing assets to your trading account. The USD value of your assets is used to calculate the margin for placing orders and holding positions.
In auto-borrow mode, if the available balance or available equity of a currency in your trading account is insufficient but the USD value is adequate, you can still sell that currency through spot or spot with margin trading, or trade derivatives settled in that currency. When the currency’s equity is negative due to being oversold or the loss of contracts that are settled in this currency, the liability and the corresponding interest of this currency will be generated automatically.
In multi-currency margin mode, the risk is measured in USD. If your overall adjusted equity (USD) is sufficient to cover the maintenance margin for all positions, they won’t be liquidated or reduced. If the adjusted equity is insufficient, all the positions under cross-margin mode will be partially or fully liquidated. You can isolate risks by opening positions in isolated margin mode.
Key Terms and Formulas
Currency Formulas
Term | Definition | Formula | Parameter in API Doc |
---|---|---|---|
Balance | The total assets of a currency in the multi-currency cross-margin account. | Not applicable | cashBal in the details array |
Floating PnL (cross) | The sum of unrealized profit and loss of the positions that are settled in a currency in the multi-currency cross-margin account. | The floating PnL of cross-margin expiry futures positions + Floating PnL of cross-margin perpetual futures positions | Not applicable |
Equity (cross) | The equity of a currency in the multi-currency cross-margin account. | Balance + Floating PnL (cross) + Options value – Accrued interest | Not applicable |
Frozen equity | The amount of a currency in the multi-currency cross-margin account that is in use, which includes spot or spot with margin sell orders, options buy orders for closing positions, isolated mode orders and estimated trading fee from expiry futures, perpetual futures and options orders. | Assets frozen in spot or spot with margin sell orders + Assets frozen in options buy orders for closing positions + Assets frozen in isolated margin mode orders + Assets frozen in estimated trading fee from expiry futures, perpetual futures and options orders Note: Assets frozen in isolated margin mode orders represent the estimated decrease in equity value when orders are filled. Once isolated orders are filled, this portion of equity frozen in the orders will be transferred from the cross-margin balance to the isolated margin balance, and can no longer be used as margin for cross-margin positions. | frozenBal in the details array |
Available equity | The amount of a currency that can be used for spot or spot with margin sell orders, options buy orders for closing orders, isolated mode orders, and estimated trading fee from expiry futures, perpetual futures and options orders. | Max (0, Equity (cross) – Frozen equity) | availEq in the details array |
Liability | The liability of a currency incurred in the cross-margin account and isolated margin positions. Interest will be calculated based on this field. | Abs {Min [0, Equity (cross)]} + Liability from isolated margin positions | liab in the details array |
Potential borrowing | The amount of a currency incurred when cross-margin equity is not enough to cover frozen equity. The potential borrowing frozen margin will be calculated based on this field. | Abs {Min [0, Equity (cross) – Frozen equity]} | Not applicable |
Potential borrowing frozen margin | The amount of a currency’s margin incurred when potential borrowing is incurred. | Potential borrowing / Currency’s borrow leverage Note: You can set a currency’s borrow leverage on the Trading page and also via the API. | borrowFroz in the details array |
Currency Example
Suppose you have the following amount of BTC, SOL, and USDT in your trading account.
Currency | USD Price | Balance |
---|---|---|
BTC | 80,000 | 2 |
SOL | 200 | 6,000 |
USDT | 1 | 100,000 |
You opened a BTC-USDT perpetual long position at 80,000 USDT with position value of 0.5 BTC, leverage is 10x, and assume the mark price and entry price are the same.
The BTC-USDT perpetual mark price then rises to 100,000 USDT. You have a floating PnL of 10,000 USDT [= 0.5 × (100,000 – 80,000)].
Currency | USD Price | Balance | Position | Floating PnL | Equity |
---|---|---|---|---|---|
BTC | 100,000 | 2 | NA | 0 | 2 |
SOL | 200 | 6,000 | NA | 0 | 6,000 |
USDT | 1 | 100,000 | BTC-USDT perpetual position | 10,000 | 110,000 |
Given that you set the borrow leverage of BTC to 5x and you place a sell order of 4 BTC in the BTC-USDT pair. Thus, frozen equity is incurred. However, the frozen equity is larger than your BTC equity, which means your equity isn’t enough to cover the frozen equity. Then, potential borrowing and potential borrowing frozen margin are incurred.
Currency | Equity | Order | Frozen Equity | Available Equity | Potential Borrow | Potential Borrow Frozen Margin |
---|---|---|---|---|---|---|
BTC | 2 | Sell 4 BTC | 4 | 0 | 2 | 0.4 |
SOL | 6,000 | NA | 0 | 6,000 | 0 | 0 |
USDT | 110,000 | NA | 0 | 110,000 | 0 | 0 |
Account Formulas
Term | Definition | Formula | Parameter in API Doc |
---|---|---|---|
Adjusted equity | The discounted fiat value of all currencies in the account, which can be used to provide margin for positions and orders. | Discounted equity + Spot or spot with margin order loss – Assets frozen in options buy orders for closing positions - Assets frozen in isolated margin mode orders – Estimated trading fees from all open orders (include spot or spot with margin orders) Note: Discounted equity: ∑ All currencies [Currency equity (cross) × Discount rate × USD price of the currency] Spot or spot with margin order loss: The estimated decrease in adjusted equity value when spot orders are filled. This is due to a difference in discount rates between the currency that is sold and the currency that is bought. Assets frozen in isolated margin mode orders: The estimated decrease in adjusted equity value when isolated margin mode orders are filled. Once isolated orders are filled, this portion of frozen equity will transfer from the cross-margin balance to the isolated margin balance, and can no longer be used as margin for cross-margin mode. | adjEq |
Position value | Value of all cross-margin positions and potential borrowing in USD. | ∑ All currencies [Position value of cross-margin expiry futures position, Cross-margin perpetual futures position, Cross-margin options positions + Potential borrowing] Note: Currency-margin expiry and perpetual futures: Position value (USD) = Face value × Number of contracts × Multiplier / Mark price × USD price of the currency USD-stablecoin-margin expiry and perpetual futures: Position value (USD) = Face value × Number of contracts × Multiplier × Mark price × USD price of the currency Options: Position value (USD) = Face value × Number of contracts × Multiplier × USD price of the currency Potential borrowing: Position value (USD) = Potential borrowing × USD price of the currency | notionalUsd |
Floating PnL (cross) | Value of all cross margin positions’ unrealized profit and loss. | ∑ All currencies [Floating PnL (cross) of each currency × USD price of the currency] | upl |
Frozen margin | The fiat value of the margin required for opening cross-margin orders and positions in the account. | ∑ All currencies [(Frozen margin in orders + Frozen margin in positions + Borrow frozen margin) of the currency × USD price of the currency] Note: Frozen margin in orders: Margin frozen in expiry futures order + Margin frozen in perpetual futures orders + Margin frozen in options sell orders Frozen margin in positions: Margin frozen in expiry futures positions + Margin frozen in perpetual futures positions + Margin frozen in options sell positions | imr |
Available margin | The discounted fiat value of the margin in the account that can be used to trade spot and derivatives. | Adjusted equity + Futures order loss – Frozen margin Note: Futures order loss: The estimated unrealized loss that will be incurred if the futures orders are filled. The loss comes from the difference between mark price and estimated fill price. | Not applicable |
Maintenance margin | The sum of maintenance margin of all open positions under cross-margin mode. | ∑ All coins (Maintenance margin for cross-margin positions of each currency × USD price of each currency) Note: Maintenance margin for cross-margin positions: Position value × Maintenance margin requirement For more information on maintenance margin requirements, refer to position tiers. | mmr |
Account leverage | The leverage of your account. | Position value / Adjusted equity | Not applicable |
Margin ratio | Risk level of multi-currency cross-margin positions. | Adjusted equity / (Maintenance margin + Liquidation fees) Note: Maintenance margin and liquidation fees are calculated using the sum of open positions and open orders | mgnRatio |
Discount Rate Example
Under multi-currency cross-margin mode, currencies are measured in USD, and this USD value can be used as margin. Due to market volatility, our platform calculates the USD value of each currency based on discount rates to mitigate market risks. More information on the discount rates for each currency can be found here.
Example of adjusted equity calculation |
---|
Discount rates for BTC with tiers valued in crypto Tier and discount rate 0 - 20 BTC: 0.98 20 - 25 BTC: 0.975 25 - 30 BTC: 0.97 30 - 50 BTC: 0.965 50 - 70 BTC: 0.96 70 - 90 BTC: 0.955 90 - 110 BTC: 0.95 Assume the price of BTC is 60,000 USD and you have 100 BTC. Equity = 100 BTC Equity = 100 × 60,000 = 6,000,000 USD Adjusted equity = (20 × 0.98 + 5 × 0.975 + 5 × 0.97 + 20 × 0.965 + 20 × 0.96 + 20 × 0.955 + 10 × 0.95) × 60,000 = 5,785,500 USD |
Note:
For cryptocurrencies that have a USD index price, the USD price will be used.
For cryptocurrencies that do not have a USD index price but have a USDT spot trading pair, the spot price multiplied by the USDT/USD index price will be used.
For cryptocurrencies that do not have a USDT index price and USDT spot trading pair but have a BTC spot trading pair, the spot price multiplied by the BTC/USD index price will be used.
For cryptocurrencies that do not have a USDT index price, USDT spot trading pair and BTC spot trading pair but have an ETH spot trading pair, the spot price multiplied by the ETH/USD index price will be used.
Account Example
To calculate account dimension values, the same example from the Currency section above and the data below are used:
Currency | USD Price | Discount Tier | Equity | Discounted Equity |
---|---|---|---|---|
BTC | 100,000 | 0 - 20: 0.98 | 2 | 196,000 |
SOL | 200 | 0 - 4000: 0.95 4000 - 6500: 0.9475 | 6,000 | 1,139,000 |
USDT | 1 | 0 - ∞: 1 | 110,000 | 110,000 |
Account | Discounted Equity | Adjusted Equity | Frozen Margin | Available Margin |
---|---|---|---|---|
USD | 1,445,000 | 1,045,000 | 90,000 | 955,000 |
Discounted equity = 2 × 0.98 × 100,000 + (4,000 × 0.95 + 2,000 × 0.9475) × 200 + 110,000 × 1 × 1 = 1,445,000 USD
Assume you placed an isolated margin mode order with frozen equity 400,000 USD in value.
Adjusted equity = Discounted equity + Spot and margin order loss – Equity frozen in options buy orders for closing positions – Equity frozen in isolated margin mode orders – Estimated trading fees from all open orders = 1,445,000 + 0 – 0 – 400,000 = 1,045,000 USD
Margin frozen in USDT positions = 0.5 × 100,000 / 10 = 50,000 USDT
Margin frozen in BTC-borrowing orders = 2 / 5 = 0.4 BTC
Frozen margin = Margin frozen in positions + Margin frozen in borrowing orders = 1 × 50,000 + 0.4 × 100,000 = 90,000 USD
Available margin = 1,045,000 – 90,000 = 955,000 USD
Trading rules
Auto-Borrow Mode
Trading Logic
You can turn on auto-borrow mode under multi-currency mode.
When you trade spot or spot with margin, expiry futures, perpetual futures, and options in cross-margin mode, the account’s adjusted equity should be greater than or equal to the account’s frozen margin. When a currency’s available equity is insufficient, you can still place orders. However, potential borrowing will be triggered.
Example
Given the data below:
Currency | USD Price | Balance | Discount Tier | Available Equity |
---|---|---|---|---|
BTC | 100,000 | 2 | 0 - 20: 0.98 | 2 |
SOL | 200 | 6,000 | 0 - 4000: 0.95 4000 - 6500: 0.9475 | 6,000 |
USDT | 1 | 100,000 | 0 - ∞: 1 | 100,000 |
Account | Discounted Equity | Adjusted Equity |
---|---|---|
USD | 1,445,000 | 1,445,000 |
Placing a spot order
If you try to place a sell 120,000 USDT (120,000 USD in value) in the BTC-USDT pair, and if this order doesn’t incur any spot or spot with margin order loss, your account adjusted equity is 1,445,000 USD. This means you have sufficient account adjusted equity but you don’t have sufficient USDT to be sold with only 100,000 USDT in balance. On the other hand, because the you’re in auto-borrow mode and the USDT borrow leverage you set is 5x, this order can still be placed. However, potential borrowing of 20,000 USDT and potential borrowing frozen margin of 4,000 USDT are incurred.
Placing a perpetual futures order
If you try to place a long order, the frozen margin of the order requires 200,000 USDT (200,000 USD in value) in the BTC-USDT swap pair. Assuming this order incurs a trading fee of 1,000 USD, your account adjusted equity is 1,445,000 USD, and you have sufficient account adjusted equity to be charged a trading fee. Therefore, this order can be placed successfully.
Non Auto-Borrow Mode
Trading Logic
You can also turn off auto-borrow mode under multi-currency mode if you don’t want to trigger borrowing when opening positions or when trading spot.
When you trade in cross-margin mode, the account adjusted equity should be greater than or equal to the frozen margin (inclusive of the current order). The currency’s available equity (when trading expiry futures or perpetual futures, or selling options) or the currency’s available balance (when trading spot, isolated mode order, or buying options) should be greater than the amount required for this order.
Note:
The available balance is the amount of assets that can be used to trade spot, open isolated positions, and buy options for closing positions.
The available balance differs from available equity because the former doesn’t account for PnL generated under cross-margin mode.
Example
Given the account data below:
Currency | USD Price | Balance | Discount Tier | Available Equity |
---|---|---|---|---|
BTC | 100,000 | 2 | 0 - 20: 0.98 | 2 |
SOL | 200 | 6,000 | 0 - 4000: 0.95 4000 - 6500: 0.9475 | 6,000 |
USDT | 1 | 100,000 | 0 - ∞: 1 | 100,000 |
Account | Discounted Equity | Adjusted Equity |
---|---|---|
USD | 1,445,000 | 1,445,000 |
Placing a spot order
If you are placing a sell order of 120,000 USDT (120,000 USD in value) in the BTC-USDT pair, assuming this order doesn’t incur any spot and margin order loss, the account adjusted equity of the user is 1,445,000 USD, which is sufficient. However, you don’t have sufficient USDT to be sold as there’s only an available balance of 100,000 USDT in the account and it’s in non-auto-borrow mode, so this order can’t be placed.
Placing a perpetual future order
If you are placing a long order in the BTC-USDT swap pair, it requires 100,000 USDT (100,000 USD in value). Assuming this order incurs a trading fee of 500 USDT, your account adjusted equity is 1,445,000 USD, which is sufficient. Additionally, the currency’s available equity is enough for the required trading fee, so this order can be placed successfully.
Potential borrowing limit and interest-free limit
Potential borrowing can also be incurred under both auto-borrow and non-auto-borrow modes.
Potential borrowing will use up your margin tier borrowing limit, main account limit, and the platform’s total lending limit.
If you’ve turned on auto-borrow mode, you could sell currencies that you don’t hold or are unavailable in your account through spot or derivatives when the total USD-equivalent equity is sufficient. When the currency’s equity is negative due to overselling or the derivative loss is settled in the currency, liability and the corresponding interest of this currency will be generated automatically. In potential borrowing, unrealized loss caused by cross-margin expiry and perpetual futures positions enjoys the interest-free limit. If the liability is within the interest-free limit, no interest will be charged.
If you’ve turned off auto-borrow mode, only the available balance or available equity of the currency can be used to place orders for spot, margin, expiry futures, perpetual futures, and options under cross-margin mode and isolated margin 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 currency can’t pay off the loss settled in this currency. If the account has surplus equity in other currencies and the overall USD value of the account is sufficient, these currencies won’t be sold, and the liability will be generated passively. If the liability is within the interest-free limit, no interest will be charged. When the liability of the currency exceeds the interest-free limit, forced repayment will be triggered. More information on forced repayment can be found here.
For more information on interest-free limits, refer to interest calculation.
Risk assessment
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 open orders being canceled completely due to insufficient margin.
Order cancellation assessment
Order cancellation via risk control mechanisms will cancel part of the open order when the trader’s account risk is higher than a certain level but has not yet reached the pre-liquidation risk level. This cancellation will reduce liquidation risk and prevent the user from suddenly reaching the pre-liquidation level and causing all open orders to be canceled.
Rules for assessing order cancellation under multi-currency cross-margin mode:
When Adjusted margin < Maintenance margin of all positions + Initial margin and fees for opening orders, all the opening orders for futures and options under cross-margin mode will be canceled. If the conditions still meet the requirement after cancellation, then this cancellation will result in a spot trading loss.
Non-borrow mode: (Available equity - Frozen balance) < Required maintenance margin for all the positions + Initial margin & fees of opening orders when open positions, all open orders that will increase the amount of the frozen margin will be canceled. When available balance < 0, orders to open positions under isolated mode, options buyer orders, and open orders for selling this crypto will be canceled.
Auto-borrow mode: Actual borrowing > Max borrowing limit, all the orders that increase liability will be canceled (including orders to open positions under isolated mode, options buyer orders, and open orders for selling this crypto). When available balance < 0, orders to 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, known as order cancellation by pre-liquidation:
Instruments | Mode | Multi-currency cross mode |
---|---|---|
Futures | Hedge mode | Cancel all unfilled open orders (including bot orders) under cross margin mode. |
One-way mode | Cancel all unfilled open orders (including bot orders) under cross margin mode. | |
Margin | - | Cancel all unfilled open orders (including bot orders) under cross-margin mode. |
Options | - | Cancel all unfilled open orders under cross margin mode. |
If the margin level is still ≤ 100% after open orders are canceled, forced liquidation will be triggered.
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). Long options positions won’t be liquidated.
There are 3 phases of partial liquidation:
1. Liquidation will start with positions of the same contracts in the opposite direction under hedge mode.
2. When there is no position described in phase 1, or all positions described in phase 1 are partially liquidated, and liquidation risks have not been reduced significantly, the system will try to keep the total delta value of the account unchanged while attempting to reduce the overall risk of the account. That is, partially liquidate the long and short hedged positions in terms of delta value (Delta refers to a rate of change in the position value of a contract per change in the index price. When the two changes are in the same direction, the delta is positive. Otherwise, it is negative. The greater the change in the position value of a contract per change in the index price, the greater the absolute value of delta). If multiple positions meet the delta long and short offsetting conditions, the system will first partially liquidate the position with a larger maintenance margin.
3. When there is no position described in 2), or all positions described in 2) are partially liquidated (that is, the total delta value of the account cannot be kept almost unchanged at this time, while the account risk cannot be reduced), and liquidation risks have not been reduced significantly, the system will try to partially liquidate the remaining unhedged positions, and will prioritize positions that can help to reduce liquidation risks the most. Each time you partially liquidate your position, the position tier will be reduced by one level until the liquidation risks have been reduced significantly.
For example, the current price of futures contract BTC-USD-0925 is 50,000 USD/BTC, and we assume the assets allocation of an account is as follows:
Type | Amount |
---|---|
Balance | 3 BTC, 10ETH |
Positions | Futures:BTCUSD0925 1,000 contracts. Position delta > 0 |
Open order | Expiry futures: BTCUSD1225: 100 contracts, order price at 9,000 |
The margin level is 93%, triggering the forced liquidation condition. After canceling all open orders, the margin level becomes 95%, entering the liquidation phase. At this point, the total equity in the account is 170,000 USD, with a maintenance margin of 200,000 USD.
Assume that 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. The system liquidates 500 long position futures contracts of BTCUSD0925 and -100 short position options contracts BTCUSD-20200925-65000-C. After liquidation, the account equity is 169,000 USD, and the maintenance margin is 180,000 USD.
If the account is still at risk 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 can’t hedge each other.
There are 500+ contracts of BTCUSD0925 futures remaining. If the position tier was reduced by one, the total equity would become 165,000 USD, with a maintenance margin of 170,000 USD.
If EOSUSD-20200925-6-C option (short position) position tier was reduced by one, the total equity would become 164,000 USD, with a maintenance margin of 165,000 USD.
In summary:
Reducing BTCUSD futures contracts can decrease equity by 4,000 USD and reduce maintenance margin by 10,000 USD.
Reducing EOSUSD option positions can decrease equity by 5,000 USD and reduce maintenance margin by 15,000 USD.
Since 10,000 USD is greater than 6,000 USD, priority will be given to reducing your option positions.
If reducing expiry futures contracts does not significantly reduce liquidation risks, the same rules will be followed to select the next position to reduce. When the liquidation results in negative assets, the system will use the insurance fund to offset your negative assets, and a corresponding bankruptcy loss bill will be generated at this time.
Risk Notice: Potential borrow is a complex concept. Please closely monitor your margin level and take precautionary measures, including reducing your positions and topping up the margin against potential liquidation risk in your account. OKX is not responsible for any and all losses arising from this adjustment.
This document is provided for informational purposes only. It is not intended to provide any investment, tax, or legal advice, nor should it be considered an offer to purchase, sell, hold or offer any services relating to digital assets. Digital asset holdings, including stablecoins, involve a high degree of risk, can fluctuate greatly, and can even become worthless. Leveraged trading in digital assets magnifies both potential gains and potential losses and could result in the loss of your entire investment. Past performance is not indicative of future results. You should carefully consider whether trading or holding digital assets is suitable for you in light of your financial condition, particularly if considering the use of leverage. You are solely responsible for your trading strategies and decisions, and OKX is not responsible for any potential losses. Not all products and promotions are available in all regions. For more details, please refer to the OKX Terms of Service and Risk & Compliance Disclosure.
© 2024 OKX. All rights reserved.