Mark Price (Oracle)

What is Mark Price?

Mark Price is a reference price applied to calculate traders' unrealized profit and loss (PnL), to reduce unnecessary forced liquidations in an abnormally volatile market, and improve the stability of the contracts market. The Mark Price ensures fair and accurate pricing of perpetual contracts.

Ensuring the accurate calculation of unrealized PnL is crucial to avoid unnecessary liquidations. The Mark Price, a key component in determining liquidations, is heavily influenced by the Price Index.

What is Price Index?

The Price Index is a weighted average price calculated by considering prices from major spot markets like Binance, Huobi, and Kraken. This weighting system ensures that markets with higher trading volumes have a greater impact on the final index value.

As the Price Index is a representation of the fair value of the asset's spot price, we use this to calculate the Mark Price, which plays a crucial role in determining your unrealized PnL (profit or loss on open positions). It's important to note that your realized PnL (profit or loss on closed positions) is based on the actual market price at the time you close your position.

This formula calculates the Mark Price for a contract:

Mark Price = Median Γ— (Price 1 , Price 2 , Contract Price)

whereby

  • Price 1 = Price Index Γ— (1 + Funding Rate Γ— (Time to Next Funding Rate (h)/8 ))

  • Price 2 = Price Index + Moving Average (5-min basis)

  • 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.

  • Moving Average (5-min basis) = Moving Average (( Bid 1 + Ask 1) / 2 β€” Price Index), sampled every minute in 5-minute intervals.

When there is huge deviation in price sources or abnormal market conditions causing large differences between the Spot Price and the Mark Price, AstheEx may implement additional precautionary actions. For example, Price 2 may be taken directly as the Mark Price.

Ensuring Price Stability

Here are some safeguards AstherusEX employs against potential issues with spot market data.

  • 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 one 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 5 minutes, 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: If the system encounters issues obtaining reliable data for the Price Index, it might affect contracts that solely rely on this index (single Price Index contracts). To prevent this from impacting your positions, we utilize the "Last Trade Price Protection" mechanism. This mechanism temporarily sets the Mark Price based on the last executed trade price for the specific contract. This ensures the system can still calculate your unrealized PnL and liquidation level, ultimately preventing unnecessary position closures.

Last updated