💱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 between the EWMA of 3 rates implied from the best bid, best ask and last price as described 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

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

3. Calculate the EWMA (Exponentially Weighted Moving Average) of each of the three rates and take the Fair Basis as the median rate

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

4. Calculate the Mark Price by applying the Fair Basis to the 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 :

Last updated