# Mark Price

### **Overview**

To improve the **stability** of the contract market and **reduce unnecessary forced liquidations** during periods of high volatility, the system uses a **marked price** rather than the last traded price. The marked price is used to:

* Calculate a user's **unrealized profit and loss (PnL)**
* Trigger **forced position reductions** (liquidations) when necessary

### **Marked Price Formula**

$$
\text{Marked Price} = \text{Median} \left( P\_{\text{latest}},\ P\_{\text{reasonable}},\ P\_{\text{ma}} \right)
$$

Where:

* P<sub>latest</sub>: Latest transaction-related price
* P<sub>reasonable</sub>: Reasonable theoretical price
* P<sub>ma</sub>: Moving average adjusted price

### **Components Breakdown**

#### 1. **Latest Price** P<sub>latest</sub>

This is the **median** of three values:

$$
P\_{\text{latest}} = \text{Median} \left( P\_{\text{buy1}},\ P\_{\text{sell1}},\ P\_{\text{trade}} \right)
$$

Where:

* P<sub>buy1</sub>: Best bid (Buy 1)
* P<sub>sell1</sub>​: Best ask (Sell 1)
* P<sub>trade</sub>​: Last transaction price

#### 2. **Reasonable Price** P<sub>reasonable</sub>

Calculated as:

$$
P\_{\text{reasonable}} = P\_{\text{index}} \times \left( 1 + F\_{\text{prev}} \times \frac{t\_{\text{remain}}}{T} \right)
$$

Where:

* P<sub>index</sub>: Spot market index price
* F<sub>prev</sub>​: Funding rate of the **previous period**
* t<sub>remain</sub>​: Time remaining until the next funding fee settlement
* T: Funding fee settlement interval (e.g., 480 minutes for 8-hour cycles)

#### 3. **Moving Average Price** P<sub>ma</sub>​

$$
P\_{\text{ma}} = P\_{\text{index}} + \text{MA}\_5(\Delta)
$$

Where:

* MA<sub>5</sub>(Δ): 5-minute moving average of the **spread**
* Spread Δ(n) is defined as:

$$
\Delta(n) = P\_{\text{exchange}}(n) - P\_{\text{index}}(n)
$$

And:

* P<sub>exchange</sub>(n): Exchange’s median price at time nnn
* P<sub>index</sub>: Index price at time nnn

### **Summary**

The **marked price** integrates:

* Short-term trading dynamics
* Fair value via funding-adjusted index pricing
* Smoothing through moving averages

This hybrid pricing mechanism enhances risk control and protects users from unfair liquidations during momentary price spikes or dips.
