1. Quick Margin Trading Rules
After transferring a margin pair's assets into the isolated position, they will be displayed as collateral but there will not be an open position yet.
A position will be opened once the user incurs liabilities from manual or auto borrowing.
1.1 Quick margin trading position
Positions under Quick Margin Trading will be reflected as shown below:
Term |
Definition |
Base assets |
Amount of base crypto in position, inclusive of amount transferred in, borrowed and bought |
Quote assets |
Amount of quote crypto in position, inclusive of amount transferred in, borrowed and bought |
Base liability |
Amount of base crypto borrowed and interest accrued that has not been repaid |
Quote liability |
Amount of quote crypto borrowed and interest accrued that has not been repaid |
Margin ratio |
Margin ratio = Net assets in isolated position / (Maintenance margin + Fees) Net assets in isolated position = (Quote assets - Quote liaiblity) + (Base assets - Base liability) * Mark price Maintenance margin = (Quote liability * MMR) + (Base liability * Mark price * MMR) Note: Margin ratio will only be displayed for open position, i.e. there is liability |
Est. liq. price |
Estimated liquidation price = [Quote liability * (1 + MMR) * (1 + taker fee) - Quote asset)] / [Base asset - Base liability * (1 + MMR) * (1 + taker fee)] |
PnL |
PnL = (Quote assets - Quote liability) + Mark price * (Base assets - Base liability) - Value of crypto transferred in + Value of crypto transferred out Remarks: PnL is calculated in the quote crypto units |
PnL% |
PnL% = PnL / (Value of crypto transferred in - Value of crypto transferred out) |
1.2 Borrowing rules
Under Quick Margin Trading, users can borrow crypto manually or through auto borrow orders. The maximum amount that users can borrow is calculated using the collateral transferred into the isolated position and the isolated margin position tiers. Users can borrow both quote and base crypto.
1.3 Order validations
Under Quick Margin Trading, users can place orders via 3 modes: Manual, Auto borrow and Auto repay
Mode
|
Description
|
Order validation
|
Manual
|
Similar to spot trading during order. Users can buy and sell crypto with the amount borrowed in advance
|
Position asset - Frozen amount in open order
|
Auto borrow
|
Borrowing will only happen once the order is filled but not when it is placed, and interest accrual starts with the borrowing. However, potential borrowing in open orders consumes the borrowing limit.
|
Position asset - Frozen amount in open order + Available to borrow
|
Auto repay
|
When the order is filled, the system will calculate and try to repay the liability with the amount bought in. Residual amount will be added as position asset.
|
Position asset - Frozen amount in open order
|
Order validation rule: Amount in orders to be placed <= Available amount
2. Risk Management
2.1 Maintenance margin ratio
The maintenance margin ratio is determined based on the higher tier between the base borrowings and quote borrowings.
2.2 Order cancellation assessment
Cancellation of orders will occur once the risk of a user's position has exceeded a certain threshold but has yet to reach the point of liquidation. It helps the position return below the risk threshold and avoids suddenly reaching the liquidation threshold right after certain orders are filled.
Rules for order cancellation under Quick Margin Trading:
-
When Net assets < Maintenance margin for the position + Initial margin for the open auto borrow orders, the system will cancel all auto borrow orders for the position.
2.3 Partial liquidation and full liquidation
When the margin ratio of the 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 prevailing conditions.
A liquidation will be triggered if the margin ratio of the position is <= 100%. The system will cancel all the orders in the position, and then the isolated margin position will be partially or fully transferred to the liquidation engine. If the position is at tier 2 and above, the system will reduce the borrowing amount tier by tier until the margin ratio is > 100%.
Example:
Margin position in BTC/USDT with users borrowing USDT to long BTC:
If a user holds a large position at tier 2 or above (that is, the borrowed USDT amount ≥ 1,000,000, like 1,100,000), 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 = 1,100,000 - 1,000,000 = 100,000.
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.