The purpose of the Everstrike Mark Price is to provide a manipulation-resistant price that serves as a reference point for the liquidation of positions on Everstrike. All positions on Everstrike are liquidated according to the Mark Price. If they were liquidated according to the Last Traded Price, it would be possible for malicious traders to manipulate the market on Everstrike and liquidate other traders in the process.
The Everstrike Mark Price is calculated as the exponential moving average of the difference between the Everstrike Fair Price and the Everstrike Index Price.
Everstrike Index Price
The Everstrike Index Price is the average price at top Spot exchanges (with outliers excluded). It represents the general price in the market. Read more about it here.
Everstrike Fair Price
The Everstrike Fair Price is one of the following:
The price X dollars deep in the book (Impact Price)
A scaled multiple of the current best price (Scaled Best Price)
For bids, the formula is:
Fair Price (Bid) = Max(Impact Price, Scaled Best Price)
For asks, the formula is:
Fair Price (Ask) = Min(Impact Price, Scaled Best Price)
Note that X might attain different values for different trading pairs. For the Bitcoin Perpetual Future, the X is currently set to 0.3 BTC. The Markets API endpoint contains information about the X used for each trading pair.
To derive a universal Fair Price (useful for Mark Price calculation), calculate the average of Fair Price (Bid) and Fair Price (Ask):
Fair Price = (Fair Price (Bid) + Fair Price (Ask)) / 2
Scaled Best Price
The Scaled Best Price is calculated in the following way:
Bids:
Scaled Best Price (Bid) = Multiplier * Best Bid
Asks:
Scaled Best Price (Ask) = Multiplier * Best Ask
Note that Multiplier might also vary by trading pair. For the Bitcoin Perpetual Future, it is currently set to 0.001. As with the X used in the Fair Price calculation, it can also be obtained through the Markets API endpoint.
βCalculation of the Mark Price
Once the Fair Price and Index Price have been calculated, we can then calculate the The Mark Price:
Mark Price = Index Price + EMA_Y(Fair Price - Index Price)
EMA_Y is an exponential moving average of Y time periods. For the Bitcoin Perpetual Future, the Y is currently set to 30. Each time period is 1 second.
To combat price manipulation, the Mark Price can only ever be within a certain percentage range of the Index Price. To ensure that this is the case, a dampener is applied:
Mark Price = Min((1+Z)*Index Price, Max((1-Z)*Index Price, Mark Price))
where Z is a constant that varies by trading pair. For futures, the range is a fixed percentage interval. For options, the range is determined dynamically, based on the theoretical value of the option (Black-Scholes price), and the price of the option's underlier.