The calculation of the marker price is deeply linked to the funding rate and vice versa. We strongly recommend you to read the sections "Marked prices" and "Funding rates" carefully in order to fully understand how the entire contract trading system works.
Since unrealized gains and losses are the main cause of forced closures, it is very important to accurately calculate the profit and loss of a position in order to avoid unnecessary closures. The intrinsic value of a contract is the core foundation of a perpetual contract, and is obtained by reference to a weighted average of prices on the major trading markets, with the index price being the main component of the marker price.
The index price is a composite index price obtained by referring to the prices of a basket of major spot trading markets and weighting the average according to their trading volumes. The main reference markets include: Binance, Huobi, Bittrex, HitBTC, Gate.io, Bitmax, Poloniex, FTX, MXC.
Please refer to the index price component of the YIBIU local contract: Index Price
We also take some additional protection measures to avoid poor market performance due to disruptions in the spot market price or due to connectivity issues. These protections are as follows.
1. Single price source deviation: When the latest price of an exchange deviates from the median price of all price sources by more than 5%, the price weight of that exchange will be set to zero.
2、Multiple price source deviation: If more than 1 exchange's latest price deviates by more than 5%, the median price of all price sources will replace its weighted average and be used as the index price value.
3、Exchange connection problem: If we do not have access to the exchange data source and this exchange has updated the transaction data in the last 10 seconds, we can get the price data from the latest result and use it for the index price calculation.
4、If an exchange does not update the transaction data within 10 seconds, the weight of this exchange will be zero when calculating the weighted average.
5、Latest transaction price protection: When the "index price" and "marker price" aggregation system is unable to obtain a stable and reliable source of reference data, for contracts with a single index price component, the index will be affected (the index price will not change), we will We will update the marker price using the latest transaction price protection mechanism until it returns to normal. Last traded price protection is a method of temporarily switching the marker price of a contract, using the latest traded price of the contract itself plus a certain limit as the marker price so that the aggregation system has a way to calculate the unrealized profit and loss, and the liquidation line, etc., while trying to avoid unnecessary liquidation events at this time.
The index price can be considered as a fair spot price and is used to calculate the marker price (which is used to further calculate the unrealized profit/loss of each contract). Please note that the actual profit/loss of the account is based on the market price at the time of closing the position.
The markup price formula for perpetual contracts is as follows.
Marker Price = Median * (Price Level 1, Price Level 2, Contract Price)
Price Level 1 = Index Price * (1 + Funding Rate * (time (hours) / 8) until the next funding rate is charged)
Price Level 2 = Index Price + Moving Average (30-minute basis)*
* Moving Average (30-minute basis) = Moving Average ((Bid1 price + Ask1 price) / 2 - Index price), taken at 30-minute intervals and sampled every minute.
* Median: The middle of the three numbers is used for Price 1, Price 2, and Contract Price, e.g. if Price 1 < Price 2 < Contract Price, then the marker price is taken as Price 2.
Please note that YIBI will take additional protective measures when the spot price deviates from the marker price due to the possibility of extreme market conditions or deviations in price sources, and will use price 2 directly as the marker price.
The marker price is a better predictor and indicator of the intrinsic value of the contract than the price of a perpetual contract with high short-term price volatility. We use this marker price to avoid unnecessary forced liquidation of clients' positions and to prevent any market manipulation.
Note that
1. BTCUSD Index = Σ [(BTCUSD Bitstamp) x weight 1) + (BTC-USD Coinbase Pro x weight 2) + (XBT/USD Kraken x weight 3) + (USD-BTC Bittrex x weight 4) + ( BTCBUSD Binance x weight 5)] / total weight
2. YIBI will update the index price components from time to time.