# Mark price

### **Overview**

On [Aster Pro](https://www.asterdex.com/en/futures/v1/BTCUSDT), the **mark price** serves as a reference price to calculate traders' unrealized profit and loss (PnL). It helps reduce unnecessary forced [liquidations](https://docs.asterdex.com/product/asterex-pro/liquidations) during periods of abnormal market volatility, ensuring fair and accurate pricing of perpetual contracts.​

### **Price index**

The **price index** is a weighted average derived from major spot markets such as Binance, Huobi, and Kraken. Markets with higher trading volumes have a greater influence on the index value. This index represents the fair value of the asset's spot price and is used to calculate the mark price, which is crucial for determining unrealized PnL.​

### **Mark price calculation**

The mark price is determined by taking the median of three prices:​

* **Price 1**: Price index × (1 + Funding rate × (Time to next funding rate in hours ÷ 8))
* **Price 2**: Price index + 5-minute moving average
* **Contract Price**: The current contract price​

The **5-minute moving average** is calculated by sampling every minute over a 5-minute interval:​

Moving average = Average of ((bid 1 + ask 1) ÷ 2 − Price index)​

The **mark price** is the median of Price 1, Price 2, and the Contract Price. For example, if Price 1 < Price 2 < Contract Price, then Price 2 is selected as the Mark Price.​

### **Handling abnormal market conditions**

In cases of significant deviations between price sources or abnormal market conditions causing large differences between the spot price and the mark price, Aster Pro may implement precautionary measures:​

* **Single price source deviation**: If the last price from a particular exchange deviates more than 5% from the median price of all sources, that exchange's price weight is set to zero.
* **Multiple price source deviations**: If more than one exchange shows a deviation greater than 5%, the median price of all sources is used as the index value instead of the weighted average.
* **Exchange connectivity issues:** If any exchange fails to update its price feed within 3 seconds, that source is removed from the price index calculation. This prevents outdated prices from influencing the mark price.
* **Last trade price protection:** If the latest trade price deviates more than 5% from the mark price and no new trade occurs within 5 seconds, the contract price is replaced with the current mark price in the mark price calculation. This prevents the system from using stale or potentially manipulated trade prices in liquidation-related processes.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.asterdex.com/trading/perpetuals/fees-and-specs/mark-price-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
