> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qfex.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Definitions and Formulae

> Common Terms Used in the Rulebook

### Market Data Price

The price of the underlying asset, derived from the relevant external oracle source.\
Denoted as $P_t^{\text{market}}$.

### Index Price

When the current market price stays within the allowed band, the index price is:

$$
P_t^{\text{index}} = P_t^{\text{market}}
$$

when

$$
P_t^{\text{market}} \in [0.5 P_{t-1}^{\text{market}},\; 1.5 P_{t-1}^{\text{market}}]
$$

Otherwise, the index price is held at the prior market price:

$$
P_t^{\text{index}} = P_{t-1}^{\text{market}}
$$

That is, the Index Price equals the current Market Data Price if it lies within ±50% of the previous value, otherwise the prior price is used.

### Oracle Price

Defined in [Contract Specifications](/qfex/contract-specifications):

### Mark Price

The Mark Price $P_t^{\text{mark}}$ is computed as:

$$
P_t^{\text{mark}} = \text{Median} \Big(
P_t^{\text{oracle}},\;
P_t^{\text{oracle}} + \text{EMA}_{150s}(M_t - P_t^{\text{oracle}}),\;
\text{Median}(B_t,\; A_t,\; T_t)
\Big)
$$

where $M_t$ is the mid price, $B_t$ the best bid, $A_t$ the best ask, and $T_t$ the last traded price.

### Unrealized PnL

$$
PnL_{\text{unrealized}} = \sum_i q_i \cdot (P_t^{\text{mark}} - P_{i,\text{entry}})
$$

for all open positions $i$ with quantity $q_i$.

### Realized PnL

$$
PnL_{\text{realized}}= \sum_j (P_{j,\text{exit}} - P_{j,\text{entry}}) \cdot q_j
$$

for all closed positions $j$.

### Cash

$$
\text{Cash} = D - W + F_{\text{net}} + RR - \text{Fees}
$$

where $D$ = deposits, $W$ = withdrawals, $F_{\text{net}}$ = net funding, $RR$ = referral rewards.

### Margin

$$
\text{Margin} = \text{Position Margin} + \text{Order Margin}
$$

### Account Equity

$$
\text{Equity} = \text{Cash} + PnL_{\text{realized}} + PnL_{\text{unrealized}}
$$

### Available Balance

$$
\text{Available Balance} = \text{Account Equity} - \text{Margin}
$$

### Withdrawable Balance

$$
\text{Withdrawable Balance} = \text{Cash} + PnL_{\text{realized}} + \min(PnL_{\text{unrealized}}, 0) - 1.05 \times \text{Margin}
$$

### Position Value

$$
V = P_t^{\text{mark}} \times Q
$$

where $Q$ is the position quantity in the symbol.

### Funding Rate

The rate $r_t^{\text{funding}}$ paid between long and short positions when the futures price deviates from the underlying index.

### Funding Fee

$$
\text{Funding Fee} = P_t^{\text{mark}} \times Q \times r_t^{\text{funding}}
$$

### Liquidation Spread

The maximum spread $\Delta_{\text{liq}}$ from $P_t^{\text{mark}}$ at which an orderly **Immediate-or-Cancel (IOC)** liquidation order is executed.

### DLP Fee

A fee $f_{\text{DLP}}$ paid to **Designated Liquidity Providers (DLPs)** who absorb liquidated positions.

### Mark-to-Market (MTM)

All portfolios are re-evaluated every **200 ms** using the Mark Price $P_t^{\text{mark}}$ to:

* Recalculate Unrealized PnL,
* Detect margin requirement breaches,
* Trigger liquidation procedures.
