Introduction to the isolated mode of Spot and futures/Multi-currency/Portfolio margin

Julkaistu 16.12.2020Päivitetty 17.2.2025Lukuaika: 16 minuuttia

Trading rules

When users conduct transactions in spot and futures isolated margin mode, the available balance of this currency in their accounts should be greater than or equal to the amount of the same currency required by the order.

When users conduct transactions in multi-currency isolated margin mode, the overall adjusted equity in their accounts should be greater than or equal to the hold equity of the corresponding pending orders, and the available balance of this currency should be greater than or equal to the amount of the same currency required by the order.

Isolated margin mode

1. In isolated margin mode, the margin pair users traded will be displayed in the form of margin positions, as shown below.

vii-introduction-to-the-isolated-mode-of-single-multi-currency-portfolio-margin image 1

Term

Explanation

Parameter in Get positions API

Assets

The amount of crypto bought, after deducting trading fees


Note: For users that have not upgraded to the new isolated margin mode, assets will reflect the sum of the amount of crypto bought and the margin balance of the position.

pos

Liability

The amount of crypto borrowed, it includes the borrowed amount as well as interest.

liab

Margin

Amount of margin used for this position

margin

Entry price

Average entry price of the position

Entry price = (Initial amount * Initial entry price + Additional amount * Filled price) / (Initial amount + Additional amount)

avgPx

Est. liq. price

Estimated liquidation price of the position

In the new isolated margin mode

Long position using base crypto as margin

Est. liq. price = |liability + interest| * (1 + mmr%) * (1 + taker fee rate) / (assets + margin)

Long position using quote crypto as margin

Est. liq. price = [|liability + interest| * (1 + mmr%) * (1 + taker fee rate) - margin] / assets

Short position using base crypto as margin

Est. liq. price = assets / [|liability + interest| * (1 + mmr%) * (1 + taker fee rate) - margin]

Short position using quote crypto as margin

Est. liq. price = (assets + margin) / [|liability + interest| * (1 + mmr%) * (1 + taker fee rate)]

In the old isolated margin mode

Long position using base crypto as margin

Est. liq. price = |liability + interest| * (1 + mmr%) * (1 + taker fee rate) / assets

Short position using quote crypto as margin

Est. liq. price = assets / [|liability + interest| * (1 + mmr%) * (1 + taker fee rate)]

liqPx

Floating PnL

In the new isolated margin mode

Long position using base crypto as margin

Floating PnL = assets - |liability + interest| / mark price

Long position using quote crypto as margin

Floating PnL = assets * mark price - |liability + interest|

Short position using base crypto as margin

Floating PnL = assets / mark price - |liability + interest|

Short position using quote crypto as margin

Floating PnL = assets - |liability + interest| * mark price

In the old isolated margin mode

Long position using base crypto as margin

Floating PnL = assets - |liability + interest| / mark price - margin

Short position using quote crypto as margin

Floating PnL = assets - |liability + interest| * mark price - margin

upl

Floating PnL%

Floating PnL / initial margin

uplRatio

2. Open positions: the assets, liabilities and margin will be reflected in an isolated position. Depending on whether the user has upgraded to the new isolated margin mode, there will be differences in how the positions are displayed. Examples of what positions will look like under these 2 scenarios

  • Long 1 BTC at 100,000 using 10x leverage

  • Short 1 BTC at 100,000 using 10x leverage

Using base crypto as margin

Using quote crypto as margin

Long

In the old isolated margin mode

Assets = 1.1 BTC

Liability = -100,000 USDT

Margin = 0.1 BTC

In the new isolated margin mode

Assets = 1 BTC

Liability = -100,000 USDT

Margin = 0.1 BTC

Assets = 1 BTC

Liability = -100,000 USDT

Margin = 10,000 USDT

Short

Assets = 100,000 USDT

Liability = -1 BTC

Margin = 0.1 BTC

In the old isolated margin mode

Assets = 110,000 USDT

Liability = -1 BTC

Margin = 10,000 USDT

In the new isolated margin mode

Assets = 100,000 USDT

Liability = -1 BTC

Margin = 10,000 USDT

3. Closing positions:

Using base crypto as margin

Using quote crypto as margin

Long

Quote liability must be fully repaid

Base assets in the position must be fully sold

Note: After selling all the assets in the position, if there is still liability in the position, the margin in the position will be used to offset the liability before closing the position

Short

Quote assets in the position must be fully sold

Note: After selling all the assets in the position, if there is still liability in the position, the margin in the position will be used to offset the liability before closing the position

Base liability must be fully repaid

Method

Order placed

Scenario and behaviour

Example

Placing orders to close out the position on the position panel

Market close all

When liability and margin are the same crypto

The system will place an order to sell all the assets. Once the liability has been paid, any additional amount of crypto bought thereafter will be transferred back into the account balance. The position will be closed once all the assets in the position have been sold.

When asset and margin are the same crypto

The system will calculate how much liability needs to be bought back (inclusive of trading fees) and place an order to buy back the liability. After which, if there are remaining assets in the position, they will be transferred back into the account balance.

Note: The liability crypto might be overbought a little due to rounding issues.

When liability and margin are the same crypto

Asset = 1 BTC

Liability = -100,000 USDT

Margin = 10,000 USDT

Leverage = 10x

Assuming no trading fees, and the price of BTC has risen to 125,000 USDT per BTC, an order to sell 1 BTC will be placed, selling all the assets in the position. When the order is filled, the remaining 25,000 USDT after repaying the liability and 10,000 USDT in margin will be transferred back into the account balance.

When asset and margin are the same crypto

Asset = 1 BTC

Liability = -100,000 USDT

Margin = 0.1 BTC

Leverage = 10x

Assuming no trading fees, and the price of BTC has risen to 125,000 USDT per BTC, an order to sell 0.8 BTC will be placed to buy back 100,000 USDT. The remaining 0.2 BTC in asset and 0.1 BTC in margin will be transferred back into the account balance once the order has been filled.

Market/Limit order

When liability and margin are the same crypto

Users will need to place orders to sell all the remaining assets that are in the positions. Once the liability has been paid, any additional amount of crypto bought thereafter will be transferred back into the account balance. The position will be closed once all the assets in the position have been sold.

When asset and margin are the same crypto

Users will need to place orders to buy back all the liability in the position. After which, if there are remaining assets in the position, they will be transferred back into the account balance.

When liability and margin are the same crypto

Asset = 1 BTC

Liability = -100,000 USDT

Margin = 10,000 USDT

Leverage = 10x

Assuming no trading fees, and the price of BTC has dropped to 98,000 USDT per BTC, the user places an order to sell 1 BTC, selling all the assets in the position. When the order is filled, the remaining 2,000 USDT in liability will be offset using the margin in the position and the remaining 8,000 USDT will be transferred back into the account balance

When asset and margin are the same crypto

Asset = 1 BTC

Liability = -100,000 USDT

Margin = 0.1 BTC

Leverage = 10x

Assuming no trading fees, and the price of BTC has dropped to 98,000 USDT per BTC, the user needs to place an order to sell 1.0204 BTC to buy back 100,000 USDT. 0.0204 BTC will be used from the margin and the remaining will be transferred back into the account balance once the order has been filled.

Placing orders to close out the position on the order panel

Reduce only

Same as placing a market/limit order via the position panel

-

Non reduce only

Closing the existing position will be similar to that of placing a reduce only order. Once the position has been closed, the remaining portion of the order that has been filled will be used to open a position in the opposite direction. The margin required for opening the position will be transferred from the account balance.

When liability and margin are the same crypto

Asset = 1 BTC

Liability = -100,000 USDT

Margin = 10,000 USDT

Leverage = 10x

Assuming no trading fees, and the price of BTC has risen to 125,000 USDT per BTC, the user places an order to sell 2 BTC. When the order is filled, the remaining 25,000 USDT after repaying the liability and 10,000 USDT in margin will be transferred back into the account balance. The remaining 1 BTC that has been sold will then open a position in the opposite direction, with 12,500 USDT being transferred from the account balance into the position as margin.

Asset = 125,000 USDT

Liability = -1 BTC

Margin = 12,500 USDT

Leverage = 10x

When asset and margin are the same crypto

Asset = 1 BTC

Liability = -100,000 USDT

Margin = 0.1 BTC

Leverage = 10x

Assuming no trading fees, and the price of BTC has risen to 125,000 USDT per BTC, the user places an order to sell 2 BTC. When the order is filled, the remaining 0.1 BTC in margin will be transferred back into the account balance. The remaining 1.2 BTC that has been sold will then open a position in the opposite direction, with 0.12 BTC being transferred from the account balance into the position as margin.

Asset = 150,000 USDT

Liability = -1.2 BTC

Margin = 0.12 BTC

Leverage = 10x

Perpetual/futures in isolated margin mode

In isolated margin mode, perpetual/futures support both Hedge mode and One-way mode, as shown in the following figures:

(1)Hedge mode

vii-introduction-to-the-isolated-mode-of-single-multi-currency-portfolio-margin image 2

(2)One-way mode

vii-introduction-to-the-isolated-mode-of-single-multi-currency-portfolio-margin image 3
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 in Hedge mode Avail. = total – positions of pending close orders
P&L Unrealized profit or loss of current position
1. Coin-margined futures/perpetual swap
P&L of long positions = face value * |contracts| * multiplier * (1 / avg. open price – 1 / mark price)
P&L of short positions = face value * |contracts| * multiplier * (1 / mark price – 1 / avg. open price)
2. USDT-margined futures/perpetual swap
P&L of long positions = face value * |contracts| * multiplier * (mark price – avg. open price)
P&L of short positions = face value * |contracts| * multiplier * (avg. open price – mark price)
P&L ratio P&L/initial margin
liquidation price 1. Coin-margined futures/perpetual swap
Long positions: Est. liquidation price = face value * |number of contracts| * (maintenance margin ratio + fee rate + 1) / (margin balance + face value * |number of contracts| / avg. open price)
Short positions: Est. liquidation price = face value * |number of contracts| * (maintenance margin ratio + fee rate - 1) / (margin balance - face value * |number of contracts| / avg. open price)
2. USDT-margined futures/perpetual swap
Long positions: Est. liquidation price = (margin balance - face value * |number of contracts| * avg. open price) / [face value * |number of contracts| * (maintenance margin ratio + fee rate - 1)]
Short positions: Est. liquidation price = (margin balance + face value * |number of contracts| * avg. open price) / [face value * |number of contracts| * (maintenance margin ratio + fee rate + 1)]
Margin balance Initial margin + margin added to or reduced from this position
Maintenance margin 1. Coin-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
Margin level (Margin balance + P&L) / [position value * (maintenance margin ratio + fee rate)]
1. Coin-margined futures/perpetual swap
Margin level = (margin balance + P&L) / [face value * |number of contracts| / mark price * (maintenance margin ratio + fee rate)]
2. USDT-margined futures/perpetual swap
Margin level = (margin balance + P&L)/ [face value * |number of contracts| * mark price * (maintenance margin ratio + fee rate)]

Isolated margin options

The isolated options positions are shown as follows:

vii-introduction-to-the-isolated-mode-of-single-multi-currency-portfolio-margin image 4
Term Definition
Total The total amount of long positions is positive, and the total amount of short positions is negative.
Options value Positions * mark price * contract multiplier
P&L Unrealized profit or loss of the current position
P&L = (mark price - avg.open price) * total positions * contract multiplier
P&L ratio P&L of long positions = (mark price – avg.open price) / avg.open priceP&L of short positions = (avg.open price- mark price) / avg.open price
Margin balance Initial margin + manually added or removed margin
Maintenance margin The calculation of the maintenance margin for short positions refers to:
Margin level Margin balance / (maintenance margin + liquidation fee)

Risk Assessment

The risks of isolated positions in different business lines are measured separately, and the risks of isolated positions are segregated from that of cross positions. The risk assessment of isolated positions is based on the margin level, and the calculation methods for different trading products are slightly different.

Isolated margin positions

A liquidation alert will be triggered if the margin level of an isolated position is < 300%, and the system will send a liquidation alert to the account, letting you know the risk of liquidation. 300% is an alert parameter, and OKX reserves the right to adjust this parameter according to the current situation.

When the margin level <= 100%, the system will cancel all orders related to your position.

After cancellation, if the margin level > 100%, the account will revert to normal. Your position will be reduced or liquidated if the margin level remains <= 100% after all orders have been canceled.

1. Examples of liquidation calculation:

Long margin positions in BTC/USDT with BTC as the margin currency:

If a user holds a large position at tier 2 or above (that is, the borrowed BTC amount ≥100, like 110), and the margin level of the position is lower than 100%, the liquidation system will not directly liquidate the whole position. Instead, a partial liquidation will be executed.

The system will calculate the position amount that needs liquidating to lower the position tier by 1 level.

Position amount that needs liquidating = current borrowed amount - max borrow amount of tier 2 =110-100 =10.

If a user's position is at tier 1 with the margin level lower than 100%, or if the user's position is at tier 2 or above, but the margin level calculated according to the maintenance margin ratio(MMR) of the lowest tier is lower than 100%, the system will directly liquidate the whole position at the bankruptcy price (the price at which all margins are lost out).

2. Examples of margin level calculation:

Short margin positions in BTC/USDT with USDT as the margin currency:

The user's asset in the position is 3,299,800 USDT, the liability is 110 BTC, the interest is 0.5 BTC, the mark price is 19,500, and the taker fee rate is 0.01%.

Maintenance margin = (liability + interest) * maintenance margin ratio * mark price = (110 + 0.5) * 4.00% * 19,500 = 86,190 USDT

Liquidation fee = (liability + interest) * (1 + maintenance margin ratio) * taker fee rate * mark price = (110 + 0.5) * (1 + 4.00%) * 0.01% * 19,500 = 224.094 USDT

Margin level = [assets in the position - (liability + interest) * mark price] / (maintenance margin + liquidation fee)=[3,299,800 - (110 + 0.5) * 19,500] / (86,190 + 224.094) = 1325.0732%

In this case, the account is at a safe status. When the mark price rises to 29,000, it will be:

Maintenance margin = (110 + 0.5) * 4.00% * 29,000 = 128,180 USDT

Liquidation fee = (110 + 0.5) * (1 + 4.00%) * 0.01% * 29,000 = 333.268 USDT

Margin level = [3,299,800 - (110 + 0.5) * 29,000] /(128,180 + 333.268) = 74.1558%

In this case, the position will be liquidated as the margin level is less than 100%. After the position tier is lowered by 1 level (lowered from level 3 to level 2), the liquidated amount will be 10 BTC. If the margin level is still less than 100% after the liquidation, the liquidation will continue, and the position tier will be lowered by another 1 level (lowered from level 2 to level 1, and the amount of liquidated position will be 50 BTC). The liquidation process will end if the margin level of the position after liquidation is > 100%. But if the margin level is still less than 100% when the position is at level 1, the system will directly liquidate the position out at the bankrupt price (the price at which all margins are lost).

Isolated perpetual/futures positions

A liquidation will be triggered when the margin level of an isolated position is < 300%, and the system will send a liquidation alert to the account, letting you know the risk of liquidation. 300% is an alert parameter, and OKX reserves the right to adjust this parameter according to the current situation.

When the margin level <= 100%, the system will cancel all orders related to your position.

After cancellation, if the margin level > 100%, the account will revert to normal. Your position will be reduced or liquidated if the margin level remains <= 100% after all orders have been canceled.

The liquidation rules are as follows:

For a position at tier 3 or above, if the margin level calculated based on the current tier is less than 100%, but the margin level calculated based on the maintenance margin ratio(MMR) of the lowest tier is more than 100%, the positions will not be fully liquidated. The system will calculate the position amount that needs liquidating to lower the position tier by 2 levels, and the positions will be liquidated at the bankruptcy price. If the margin level after the partial liquidation is more than 100%, the liquidation process will end; if the margin level is less than 100%, the liquidation process will continue.

In the Hedge mode, if a user holds both long and short positions, the pairs of long/short positions will be closed immediately. If the margin level reaches the required maintenance margin ratio, the liquidation will end; if not, the liquidation will continue.

Example: Take the BTCUSD futures contract as an example.

If a user holds a large position at tier 3 or above (that is, the position amount ≥ 22,001, like 30,000), and the margin level of this position is lower than 100%, the liquidation system will not directly liquidate the whole position. Instead, a partial liquidation will be executed.

The system will calculate the position amount that needs liquidating to lower the position tier by 2 levels.

Position amount that needs liquidating = current position amount - max amount of tier 2 = 30,000 - 3,000 = 27,000.

If a user's position is at tier 2 and below with the margin level lower than 100%, or if the user's position is at tier 3 or above, but the margin level calculated according to the maintenance margin ratio of the lowest tier is lower than 100%, the system will directly liquidate the whole position at the bankruptcy price (the price at which the entire margin is lost).

Isolated options positions

If the margin level of an isolated position is < 300%, the system will send a liquidation alert to the account, letting you know the risk of liquidation. 300% is an alert parameter, and OKX reserves the right to adjust this parameter according to the current situation.

When the margin level <= 100%, the system will cancel all orders related to your position.

After cancellation, if the margin level > 100%, the account will revert to normal. Your position will be reduced or liquidated if the margin level remains <= 100% after all orders have been canceled.
The liquidation rules are as follows:

The pending close-orders of the position will be canceled first. If the margin level after the order cancellation is more than 100%, the account will go back to safe status; if the margin level is less than 100%, a partial or full liquidation will be executed.

For a position at tier 2 or above, if the margin level calculated based on the current tier is less than 100%, but the margin level calculated based on the margin factor of the lowest tier is more than 100%, the position will not be fully liquidated. The system will calculate the position amount that needs liquidating to lower the position tier by 1 level, and the position will be liquidated at the mark price. The liquidation fee will be charged according to the margin requirement for the corresponding liquidated position tier( the liquidation fee will make up for the loss of the liquidation engine, and the remaining will be added to the insurance fund).

If the margin level after the partial liquidation is more than 100%, the liquidation process will end; if the margin level is less than 100%, the liquidation process will recur until the position returns to a safe status.

Example: Take the ETHUSD-20201225-600-P options contract as an example.

If a user holds a large position at tier 3 or above ( that is, the short position amount ≥ 2,000, like 2,500), and the margin level of this position is lower than 100%, the liquidation system will not directly liquidate the whole position. Instead, a partial liquidation will be executed.

Position amount that needs liquidating to lower the position tier (by 1 level) = current position amount - max amount of tier 2 = 2,500 - 2,000 = 500.

If a user's position is at tier 1 with the margin level lower than 100%, or if the user's position is at tier 2 and above, but the margin level calculated according to the margin factor of the tier 1 is lower than 100%, the system will directly liquidate the whole position at the mark price. The liquidation fee will be charged according to the margin requirement for the corresponding liquidated position tier. The liquidation fee = ( Option face value maintenance margin-mark price) * the contract multiplier * number of contracts * the margin multiplier, will be made up for the loss of the liquidation engine, and the remaining will be added to the insurance fund. If the margin ratio is still less than 100% when the position is at level 1, the system will directly liquidate the position out at the bankrupt price (the price at which all margins are lost).

Liquidation in isolated position mode

The margin level for isolated margin mode is calculated independently. When the margin level falls below 100%, the isolated position will be forcibly reduced or liquidated. If there is a remaining balance in isolated positions, it will be transferred from the position balance to the account balance. (Note: There may be some remaining balance due to issues with accuracy).