Introduction to the isolated mode of Spot and futures/Multi-currency/Portfolio margin
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.
Term | Definition |
Total | The number of positive assets on the position (including margin). Long positions: with trading currency as position asset. Short positions: with quote currency as position asset. |
Available asset | Total position assets – on-hold by pending order |
Liability | Initial liabilities + deducted interest - Long positions: Liability is calculated in quote currency. - Short positions: Liability is calculated in trading currency. |
Interest | Interest that has not been deducted yet. |
Avg. open price | (Original amount * original avg. open price + new amount * filled price) / (original amount + new amount) |
Est. liquidation price | Long positions: Est. liquidation price = (liability + interest) * (1 + maintenance margin ratio) * (1 + taker fee rate) / position assets Short positions: Est. liquidation price = position assets * (liability + interest) * (1 + maintenance margin ratio) * (1 + taker fee rate) |
P&L | P&L of long positions = position assets – margin - (liability + interest)/ mark price P&L of short positions = position assets – margin - (liability + interest)* mark price |
P&L ratio | P&L/initial margin |
Margin balance | Initial margin + margin added to or reduced from this position Long positions: initial margin = open amount / leverage Short positions: initial margin = open amount / leverage * open price |
Maintenance margin | Long positions: maintenance margin = (liability + interest) * maintenance margin ratio / mark price Short positions: maintenance margin = (liability + interest) * maintenance margin ratio * mark price |
Margin level | Long positions: margin level = [position assets - (liability +interest) / mark price] / (maintenance margin + fees) Short positions: margin level = [position assets - (liability + interest) * mark price] / (maintenance margin + fees) |
2. Principle of initial margin: When users open long positions, only trading currency of the pair can be used as margin currency. When users open short positions, only quote currency of the pair can be used as margin currency.
For example:
If you want to open long positions with BTC in BTC/USDT isolated margin trading, you must have a balance in BTC as margin in your account. If you want to open short positions with BTC in BTC/USDT isolated margin trading, you must have a balance in USDT as margin in your account;
Now open a 10X long position of 1 BTC, then 0.1 BTC is required as margin (the available balance in spot and futures cross account should be greater or equal to 0.1 BTC). If the filled price is 10,000 USDT, then 10,000 USDT needs to be borrowed. If the transaction is not filled, no currency will be borrowed, no interest will be accrued, but the margin will be on-hold.
After the transaction is filled, you will open a long position: the position asset is 1 + 0.1 = 1.1 BTC, and its liability is 10,000 USDT.
3. Principle of closing positions: only position assets can be used to close a position, and the position will be closed when its liabilities are paid off; when closing a position, users can choose whether to use "reduce only".
No. | Mode | Closing method | Rule | Example |
1 | Close in Position | Market close all | 1. Only pay off the liabilities, and the remaining assets will be transferred to the account balance. 2. Only the position assets can be used to close the position. 3. The default setting is “reduce only”. |
The current isolated margin position is a long position—Its position asset is 2 BTC, liability 10,000 USDT, and interest 10 USDT. 1. The system will calculate how much USDT needs to be bought to close the position and pay off the liability (interest and fees will also be included). If the result is 10,020 USDT, the system will sell 2 BTC at market price, and then stop when you receive 10,020 USDT. Due to transaction accuracy, it may exceed a little. 2. Assuming that the average filled price is 10,000 USDT, then buying 10,020 USDT requires 1.002 BTC, and the remaining 0.998 BTC will not be sold.3. After closing the position, the remaining 0.998 BTC will be transferred to the account balance, and due to accuracy reasons, the remaining USDT will also be transferred to the account balance after the liability is paid off. |
Closing at limit price | 1. Users can buy assets that exceed the liabilities. Once the liability is paid off, the margin position will be closed. The oversold assets and remaining ones will be transferred to the account balance. 2. Only the position assets can be used to close the position. 3. The default setting is "reduce only". |
The current margin position is long position—the position asset is 2 BTC, liability 10,000 USDT, and interest 10 USDT. 1. Sell 0.5 BTC at the filled price of 10,000 USDT, then 5,000 USDT is bought. After deducting the fee of 5 USDT and interest of 10 USDT, the remaining 4,985 USDT will be used to pay off the liability. With a remaining liability of 5,015 USDT, the position still exists. 2. After partially closing the position: the position asset is 1.5 BTC, liability 5,015 USDT, and interest 0. 3. Sell 1 BTC at the filled price of 10,000 USDT, and 10,000 USDT is bought. After deducting the fee of 15 USDT, the remaining 9,985USDT will be used to pay off the liability. Since liability has been paid off, the position disappeared. 4. The remaining assets of 0.5 BTC and 4,970 USDT will be transferred to single-currency cross account balance. |
||
2 | Close in Open short/Open long | Reduce only | The same as those of [Close in Position] | - |
Reduce only + reverse position | 1. When the liability is paid off, the margin position will disappear. The excesses will be used to open a reverse position. 2. Only the position assets can be used to close the position, and the margin for opening a reverse position is the available balance of that corresponding currency in single-currency cross account. |
the liability of 1 BTC. After the order is filled, the position will be closed first, and then a reverse position will be opened. The position asset of 10,000 USDT is used to pay off the 1 BTC liability. After the long position is closed, the remaining 10,000 USDT position asset will be transferred to the account balance. The reverse position of 0.5 BTC will use 0.1 BTC in the account balance as its margin, and 5,000 USDT will be borrowed to open a reverse long position. At this time, the position asset of this margin long position is 0.5 + 0.1 = 0.6 BTC, and its liability is 5,000 USDT. The current margin position is a short position—Its available asset is 30,000 USDT, liability 2 BTC, with interest and transaction fees temporarily ignored. 1. Buy 1 BTC at the filled price of 10,000 USDT. This order uses an asset of 10,000 USDT to pay off the liability of 1 BTC. 2. After partially closing the position: the remaining asset is 20,000 USDT, and the remaining liability is 1 BTC. Since the liability has not been paid off, the position still exists. 3. Buy 1.5 BTC at the filled price of 10,000 USDT. 1.5 BTC > the liability of 1 BTC. After the order is filled, the position will be closed first, and then a reverse position will be opened. 4. The position asset of 10,000 USDT is used to pay off the 1 BTC liability. After the long position is closed, the remaining 10,000 USDT position asset will be transferred to the account balance. 5. The reverse position of 0.5 BTC will use 0.1 BTC in the account balance as its margin, and 5,000 USDT will be borrowed to open a reverse long position. 6. At this time, the position asset of this margin long position is 0.5 + 0.1 = 0.6 BTC, and its liability is 5,000 USDT. |
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
(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 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:
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).