> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.paradex.trade/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.paradex.trade/_mcp/server.

# Mark Price Calculation

## **Perpetual Mark Price Formula**

The mark price of a perpetual future instrument is calculated as :

$$
\text{Mark Price}=\text{Spot Oracle Price}*(1+\text{Fair Basis})
$$

where :

$\text{Spot Oracle Price}$ is an external oracle price of the underlying coin obtained via the [Pyth](https://pyth.network/price-feeds) & [Stork](https://www.stork.network/) Networks.

## Fair Basis

Fair Basis measures how rich or cheap the perp is versus spot. It is built from three sources, each treated as one vote:

* **On-venue quotes**: Paradex best bid, best ask, and last trade, each expressed as a basis $(\text{price} - \text{spot}) / \text{spot}$.
* **On-venue mid**: basis computed from the Paradex bid/ask mid.
* **External venues**: per-venue basis $(\text{venue mark} - \text{spot}) / \text{spot}$ for each external venue (Binance, Bybit, OKX, Hyperliquid, and Lighter).

All inputs are EWMA-smoothed before use. The smoothed bases are then combined through two successive medians so no single feed can dominate:

$$
\begin{aligned}
& \text{InternalBasis} = \text{median}\big( \text{BidEWMA},\ \text{AskEWMA},\ \text{TradeEWMA} \big) \\
& \text{ExternalMedian} = \text{median}\big( \text{basis}_{\text{venue}_1},\ \text{basis}_{\text{venue}_2},\ \ldots \big) \\
& \text{LiquidBasis} = \text{median}\big( \text{InternalBasis},\ \text{MidEWMA},\ \text{ExternalMedian} \big)
\end{aligned}
$$

The published Fair Basis blends the external median with the liquid basis, weighted by an on-venue liquidity score $w \in [0, 1]$:

$$
\text{Fair Basis} = (1 - w) \times \text{ExternalMedian} + w \times \text{LiquidBasis}
$$

### Liquidity weight

A tick is *liquid* when both bid and ask are present and the relative spread is within the per-market Max Top-of-book Spread (1%). The weight $w$ ramps linearly toward 1 on liquid ticks and toward 0 on illiquid ticks, traversing the full 0-to-1 range over 30 minutes of sustained conditions.

Sustained thinness drives $w \to 0$ and Fair Basis follows external consensus; sustained tightness drives $w \to 1$ and on-venue signals regain equal weight.