Isolated margin mode

Publicado em 17 de jun. de 2022Atualizado em 5 de ago. de 2024Leitura de 8min

1. Trading rules

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

iv-isolated-margin-mode image 1
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 positionLong 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 ratio Long positions: margin ratio = [position assets - (liability +interest) / mark price] / (maintenance margin + fees) Short positions: margin ratio = [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 current margin position is a short position—Its available asset is 30,000 USDT, liability 2 BTC, Margin is USDT and leverage is 5X, 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.

2. Risk Assessment

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

A liquidation will be triggered if the margin ratio of an isolated position is < 100%, and the system will cancel the orders with the opposite trading side, then the isolated margin position will be partially or fully transferred to the liquidation engine.

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 ratio 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 ratio lower than 100%, or if the user's position is at tier 2 or above, but the margin ratio 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 ratio 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 ratio = [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 ratio = [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 ratio 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 ratio 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 ratio of the position after liquidation is > 100%. But 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).