Index Price
To ensure that the index price of each asset reflects the fair market price accurately, the platform selects at least three major exchanges' trading pairs as index components for each trading pair. The platform also incorporates exceptional handling logic to ensure that the index remains within a normal range when there is a significant price deviation on a single exchange.
Aibit calculates the index price by taking a weighted average of the latest filled prices from multiple exchanges in the market. Each cryptocurrency in the USDT perpetual futures has an associated index. For example, the BTC/USDT perpetual futures uses the BTC index price.
How to get Index Price
Real-time retrieval of the latest prices and volumes for all index components of a particular cryptocurrency from respective exchanges. Every 1 second (based on the index update interval), the latest prices from the listed exchanges are fetched via API.
Exchanges that have not updated their latest prices and volumes within a certain period (within 30 minutes) are considered invalid and excluded from the calculation.
If there are trading pairs with BTC as the pricing currency, the prices are multiplied by Aibit's BTC to USD index to convert them to USD prices.
The number of remaining valid exchange data is determined as follows:
If there are three or more valid exchanges, the valid data from each exchange is weighted equally.
Note: If the price of any exchange (including the current exchange) deviates from the median price of all exchanges by more than ±3%, the price of that exchange is calculated based on the median price * 0.97 or median price * 1.03.
If there are two valid exchanges, the valid data from each exchange is weighted equally.
If there is only one valid exchange, the price from that exchange is directly taken as the index price.
An Example:
Let's say the current price on one exchange is 518 USDT/BTC, while the prices on the other five exchanges are 500 USDT/BTC, 501 USDT/BTC, 502 USDT/BTC, 503 USDT/BTC, and 504 USDT/BTC, respectively. The median price among all sample exchange prices is (502 + 503) / 2 = 502.5 USDT/BTC. Since the price of this exchange deviates from the median price by (518 - 502.5) / 502.5 = 3.08% > 3%, the price for this exchange will be considered as 502.5 * 1.03 = 517.57 USDT/BTC. The resulting index price will be (517.57 + 500 + 501 + 502 + 503 + 504) / 6 = 504.59.
Resolution of Abnormal Index Price
1.Significant Deviation in Price from Other Exchanges.
The resolution is as follows:
If there are only two valid exchanges in the index (either due to only having two exchanges in the index or temporarily excluding some exchanges due to market conditions), and the price deviation between the two platforms exceeds 25%, it is considered that the price from the exchange with smaller deviation from the previous calculated index price is normal, while the other exchange has an outlier price. In this case, the index price is temporarily anchored to the price from the exchange with the normal price.
2. Loss of Market Data from a Certain Exchange.
The resolution is as follows:
If an exchange fails to retrieve market data (due to exchange closure, market interruption, or security breaches)at a particular timestamp, the price at that time will be calculated based on the latest valid price obtained. If a certain exchange obtains less than 10 valid data points (10%)within the past 100 data points (10 minutes), the price from that exchange is considered not reliable, and its weight is temporarily adjusted to 0. Once the data from that exchange is restored, if at least 90 out of the past 100 data points (90%) are valid, the weight of that exchange will be restored.
3.Prolonged Significant Deviation in Price from a Certain Exchange.
The resolution is as follows:
When the price from a certain exchange deviates significantly from other exchanges for a prolonged period, it is considered that the price from that exchange may not be reliable. In such cases, adjustments will be made to the index sample and weights, and the specific adjustment plan will be announced by the platform.
Mark Price
To reduce unnecessary liquidations for users, the USDT perpetual futures utilizes the mark price as an additional reference price during the liquidation process. When the system determines whether a user's position triggers liquidation, it must satisfy both the mark price and the latest price. It helps to avoid unnecessary deviations from the fair price due to market manipulation or lack of liquidity, which could lead to cascading liquidation risks.
Mark Price Calculation
Mark Price = Spot Index Price + Futures Basis Moving Average
Calculation of Futures Basis Moving Average:
Futures Basis = Futures Mid-price - Spot Index Price
= ((Ask Price of Futures + Bid Price of Futures) / 2 - Spot Index Price)
Assuming the basis is represented by x, the calculation of the Futures Basis Moving Average is as follows:
Futures Basis Moving Average = (x1 + x2 + x3) / 3
where:
x1: Basis of the current futures midpoint price
x2: Basis of the futures midpoint price one minute ago
x3: Basis of the futures midpoint price two minutes ago
...
The mid-price basis difference in the futures 30 minutes ago, with a sampling interval of 30 minutes and values taken every minute.