To get a complete understanding of how the Liquidation process works for a Cross Margin position, please read the following articles before proceeding.
- “What is Cross and Isolated Margin?”
- “What are Initial and Maintenance Margins?”
- “What is Liquidation?”
In the context of trading perpetual contracts on Phemex, “Margin” refers to the usage of user funds for different purposes.
Every position a user opens will involve the following:
- Initial Margin (IM): the initial funds allocated to open the position.
- Maintenance Margin (MM): the minimum amount of funds that must remain within a user’s Trading Account to keep the position open.
- Selecting Isolated or Cross Margin settings: Isolated Margin mode will restrict the position’s allocated funds to the IM + MM and no more (unless the user manually allocates more). Please note that for the purposes of simplifying the concepts in this guide, IM and MM are often referenced as separate elements. In reality, IM already accounts for MM. Cross Margin mode will allow the position to take from the user’s unused funds to help prevent liquidations.
NOTE: To learn more about adding or removing margin for different types of positions, please read “How do I Adjust the Margin on My Position?“
The total amount of funds in a user’s trading account will be referred to as Total Margin. A user’s Total Margin can be further divided into two segments:
- Used Margin: the amount of funds that have already been allocated to all open positions, including Isolated Margin and Cross Margin Positions.
NOTE: Unfilled orders listed in the Order Book will also take or use funds from your Total Margin until canceled.
- Unused/Shared Margin: the remaining funds that are not being used by any position or pending order but can be borrowed by any Cross Margin position that requires it.
Figure 1. Is a visual representation of Total Margin subdivided into Used and Unused Margin. The example shows a user with four open positions, one Isolated Margin, and three Cross Margin positions. In addition, two of the four symbols also have open orders. All open orders and positions account for roughly half of Total Margin.
Liquidation refers to the automatic closing of a user’s position due to an inability to meet Maintenance Margin requirements. To fully understand liquidation, let’s contrast the process for Isolated Margin and Cross Margin positions.
An Isolated Margin position cannot borrow from a user’s unused funds to prevent liquidation. This means that if the asset’s price moves against the user eating up the position’s Initial Margin and dipping below the Maintenance Margin, the position will automatically be liquidated or closed.
There are two factors that can mitigate this scenario:
- A user can manually add more margin to this position but would have to do so ahead of time.
- If the traded symbol has open orders, upon a negative price move that causes the position to fall below its min. Maintenance Margin, the system will first cancel any pending orders to free up funds for the position. If the funds are still not enough to meet min. Maintenance Margin requirements, the position will still be liquidated.
A Cross Margin position is able to employ any available unused funds (within the same trading account) to help prevent liquidations. When a position experiences a negative move that causes it to drop below its Maintenance Margin requirements, the system will automatically apply any unused funds to raise the position’s margin back to its original level (MM + IM). Please note that when a Cross Margin position borrows from unused funds, it will take enough not only to once again meet the min. Maintenance Margin requirements but also to fully fill the Initial Margin as well.
If the position’s PNL continues to drop, draining the entirety of the unused funds, and is still unable to meet its min. Margin Maintenance requirements, it will be liquidated or closed.
Once again, if the symbol has any funds allocated to pending orders, the system will cancel these first in a final attempt to free up funds to prevent liquidation.
NOTE: The scenarios outlined in these examples assume negative PNL, positions with positive PNL may also be partially or fully closed. For an explanation of this process, please read “Why was part or all of my position automatically closed?”
Liquidation for Multiple Positions
The liquidation process becomes more complex when multiple positions are open. When more than one Cross Margin position must use funds from the available shared margin, the system will perform a sequence of procedures to prioritize some positions over others.
To illustrate this process, let’s walk through various detailed examples using the scenario depicted in Figure 1. as the base.
Example 1: Position 1 (ETH) is liquidated
In Figure 1., because position 1 is an isolated position that cannot use any of the shared funds unless the user manually allocates more margin, a liquidation will not affect any of the other positions. Figure 2. Shows the resulting condition of this user’s trading account (the isolated position is now gone).
Example 2: Position 1 (ADA) has fallen below MM requirements while Position 2 and 3 have positive PNL
In this scenario, Position 1 would simply take funds from the unused margin to recover its necessary MM + IM while other positions remain unaffected. However, if the price continues to move against Position 1 until it consumes all of the unused funds while still unable to meet its MM requirements, the position will be liquidated.
Once Position 1 uses up all of the shared funds, it cannot access any positive unrealized PNL. The only way for Position 1 to access extra funds would be to either close Position 2, 3, or both. Once positive unrealized PNL becomes realized PNL, Cross Margin positions are able to access it.
Example 3: All three positions are at risk of liquidation
Starting with Figure 2., let’s imagine all three positions have negative PNL and have dipped below their MM requirements. Figure 5. depicts the resulting scenario.
When multiple Cross Margin Positions need additional funds to prevent liquidation, the system will first prioritize the order of events. In other words, because the system is monitoring and updating prices in real-time, whichever symbol or position was first to drop below MM requirements, will also be the first to take from the unused funds. Subsequently, the next position would take from the remaining funds. This sequence will continue until the IM and MM of all positions have been restored or until the unused funds get fully drained, and one or more positions will have to be liquidated.
In the unlikely scenario that all three positions drop below their MM requirements simultaneously, the system would instead prioritize positions based on a predetermined sequence of symbols (ETH>ADA>LINK>…).
Following this sequence, let’s now assume that the unused funds are enough to cover Positions 1 and 2, but not enough to meet Position 3’s MM requirements, see Figure 6. What would happen in this scenario?
As previously mentioned, if the remaining unused funds are not enough to help Position 3 meet its min. MM requirements, the system would cancel all BCH pending orders to release more funds. If the newly released funds in addition to the remaining unused funds are enough to meet Position 3’s MM, then all 3 positions will remain open. If the newly released funds are still not enough, Position 3 will be liquidated and only Positions 1 and 2 would remain.
NOTE: Because currently the BTC trading account only allows for BTC-settled inverse contracts, it has not been included here. The sharing of unused funds or margin is limited to each trading account. This means that only USD-settled contracts can share USD Trading funds, while only the BTC contract can access BTC Trading funds.
NOTE: This article only explains the process of liquidation. For actual calculation formulas, please review “How are Liquidation Prices calculated?”