Mark Price Calculation

Perpetual Mark Price Formula

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

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

where :

Spot Oracle Price\text{Spot Oracle Price} is an external oracle price of the underlying coin obtained via the Pyth Network.

The Fair Basis is calculated as the median of three components:

  • median between the EWMA of 3 rates implied from the best bid, best ask and last price
  • EWMA of implied the Mid Rate
  • median of External Rates
Fair Basis=median(median(Paradex EWMA rates),Mid Rate EWMA, median(External Rates))\begin{align*} \\ &\text{\underline{\large Fair Basis}}= \\ \\ &\text{median}\Bigl(\text{median(Paradex EWMA rates)}, \text{Mid Rate EWMA, median(External Rates)} \Bigr) \\ \\ \end{align*}

More details are provided below.

Steps to calculate the Fair Basis and the Mark Price

1. Every 5 seconds, get the latest Best Ask, Best Bid, Last Trade and Spot Prices

Example with SOL-USD-PERP best bid, best ask, last trade price and spot price

2. Calculate the implied rates from Best Ask, Best Bid, Last Trade relative to the Spot Price

Rates implied from SOL-USD-PERP best bid, best ask and last trade price relative to the spot price

3. Calculate the EWMA **(Exponentially Weighted Moving Average) of each of the three rates (**Paradex EWMA rates) and take the median

In this example, an EWMA weight of 20% is applied to the latest rate observation

EWMA of SOL-USD-PERP rates implied from best bid, best ask and last trade price relative to the spot price

5. Calculate the EWMA (Exponentially Weighted Moving Average) of the Mid Rate

The Mid Rate EWMA is calculated from the implied rate of the Mid Price relative to the Spot Price, where Mid Price is calculated as:

Mid Price=(Best Ask+Best Bid)2\text{Mid Price}=\frac{\big(\text{Best Ask} + \text{Best Bid}\big)}{2}

6. Calculate the median of the External Rates

The External Rates are determined from Mark Prices and Index Prices fetched from external exchanges (actually, Bybit, Binance and OKX) and calculated as:

External Rate=(Mark PriceIndex Price1)Paradex Funding IntervalExchange Funding Interval\text{External Rate}=\big(\frac{\text{Mark Price}}{\text{Index Price}} -1\big) * \frac{\text{Paradex Funding Interval}}{\text{Exchange Funding Interval}}

Where Paradex Funding Interval is actually 8h for all instruments

7. Calculate the Fair Basis

Finally, the Fair Basis is calculated as the median of the three components

Fair Basis=median(Paradex EWMA rates,Mid Rate EWMA, median(External Rates))\text{Fair Basis}=\text{median}\big(\text{Paradex EWMA rates}, \text{Mid Rate EWMA, median(External Rates)})

8. Calculate the Mark Price by applying the Fair Basis to the Spot Price

SOL-USD-PERP mark price compared to the underlying spot price

Note that the Fair Basis is different from the Funding Rate, the Funding Rate is derived from the Fair Basis using the formula described here

Here a comparison between the Fair Basis and the Funding Rate in this example :

SOL-USD-PERP fair basis and funding rate