The way the Mark Price is calculated is closely correlated with the funding rate and vice versa. We strongly recommend that you carefully read the two articles on "Mark Price" and "Funding Rate" to gain a full understanding of how the Futures trading system works.
As Unrealized PnL is the primary driver of liquidations, it's important to ensure that Unrealized PnL is accurately calculated in order to avoid unnecessary liquidations. The core basis of a Perpetual Contract is the intrinsic or "true" value of the Contract. The “Price Index,” which is the primary component of the Mark Price, is an average of the prices on the major mainstream markets
The Price Index is a composite index derived from a basket of prices from various major Spot Market exchanges, weighted by their respective trading volumes. Referenced trading markets include: Binance, Huobi, Bittrex, HitBTC, Gate.io, Bitmax, Poloniex, FTX, and MXC.
Click to view the ApolloX USDⓈ-M Perpetual Futures Price Index.
We also take additional protective measures to avoid poor market performance caused by interruptions in Spot Market prices and connectivity problems. These protective measures are as follows:
- Single Price Source Deviation:
When the Last Price of a particular exchange deviates more than 5% from the Median Price of all price sources, the price weight of that exchange will be set to zero.
- Multi Price Source Deviation:
If the Last Price of more than 1 exchange shows a deviation greater than 5%, the Median Price of all price sources will be used as the index value instead of the weighted average.
- Exchange Connectivity Problems:
If we can't access the data feed for an exchange that has had trades updated in the last 10 seconds, we can use price data from the last result to calculate the Price Index.
- If the trade data for an exchange has not been updated for 10 seconds, the weight of this exchange will be set to zero when calculating the weighted average.
- Last Trade Price Protection:
When the "Price Index" and "Mark Price" matching system is unable to secure a stable and reliable source of reference data, it impacts the Price Index for contracts with a single Price Index (i.e., the Price Index will not change). In this case, we use the “Last Trade Price Protection" mechanism to update the Mark Price until the system is back to normal. The “Last Trade Price Protection” mechanism is a way of determining the Mark Price by putting a specified limit on the last trade price of the contract itself, thereby temporarily changing the reference price for the contract. This allows the matching system to calculate Unrealized PnL and the Liquidation Level, thereby avoiding unnecessary liquidation.
You can think of the Price Index as a fair Spot Price. We use this to calculate the Mark Price, which is then used to calculate Unrealized PnL for each contract. Note that Realized PnL for the account is based on the Market Price of the trade at the time the position is closed.
The Mark Price formula for Perpetual Futures Contracts is as follows:
Mark Price = Median × (Price 1 , Price 2 , Contract Price)
Price 1 = Price Index × (1 + Funding Rate × (Time to Next Funding Rate (h)/8 ))
Price 2 = Price Index + Moving Average (30-min basis)
*Moving Average (30-min basis) = Moving Average (( Bid 1 + Ask 1) / 2 – Price Index), sampled every minute in 30-minute intervals.
*Median: The middle price out of Price 1, Price 2, and the Contract Price is taken as the median. For example, if Price 1 < Price 2 < Contract Price, then Price 2 is taken as the Mark Price.
Please note that ApolloX will take additional protective measures when there are large deviations between the Spot Price and the Mark Price due to extreme market conditions or deviations in price sources. In such cases, Price 2 will be taken directly as the Mark Price.
The Mark Price is a better estimate of the inherent value of a contract compared to Perpetual Futures Contract prices, which have large short-term price fluctuations. We use this Mark Price to avoid unnecessary liquidations for our traders and to prevent market manipulation.