Mark Price Calculation
Perpetual Mark Price Formula
The mark price of a perpetual future instrument is calculated as :
where :
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
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
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 (**Paradex EWMA rates) and take the median
In this example, an EWMA weight of 20% is applied to the latest rate observation
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:
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:
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
8. 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 :