The Mushino Mark Price is calculated as the exponential moving average of the difference between the Mushino Fair Price and the Mushino Index Price.

**The Mushino Index Price**

The Mushino 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.

**The Mushino Fair Price**

The Mushino 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:

Max(Impact Price, Scaled Best Price)

For asks, the formula is

Min(Impact Price, Scaled Best Price)

Note that X might attain different values for different trading pairs. For BTC, the X is currently set to $5000.

**The Scaled Best Price** is calculated as follows.

Bids:

Multiplier * Best Bid

Asks:

Multiplier * Best Ask

The Multiplier will also vary by pair. For BTC it is currently set to 0.001.

**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 BTC, the Y is currently set to 60. Each time period is 1 second.

To combat price manipulation, the Mark Price can only ever be within a certain percentage 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 BTC, Z is currently set to 0.005 (or 0.5%).

**Getting the value of each constant for a specific pair**

The exact values of each constant for each pair can be obtained through the /pairs API endpoint.

X = fair_qty

Multiplier = fair_multiplier

Y = mark_price_ema_range

Z = mark_price_max_deviation