# Calculation

Mark price = Median (Price 1, Price 2, Contract Price) **

Price 1 = Price Index * (1 + Last Funding Rate * (Time until next Funding / Funding period) )

Where:

The Funding period, expressed in hours, is the duration between each time Ebi charges users a funding fee**

Time until next Funding is the time left until the next funding fee charge (expressed in hours). For example, if the Funding period is set to 8 hours, and the last funding fee charge occurred 2 hours ago, the time until the next funding would be 6 hours.

**Please note that the funding fee is a payment between long- and short-position holders. Ebi only serves as a neutral intermediary in the transaction.

Price 2 = Price Index + Moving Average (5-minute Basis) **

**The Moving Average (5-minute Basis) is calculated by taking the average of the bid and ask prices and subtracting the Price Index, before taking the average of that value over the last 5 minutes, calculated every 5 seconds (60 data points).

Moving Average (5-minute Basis) = sum of [(Bid1_i + Ask1_i)/2 - PI_i] /60

Where:

PI is the Price Index at the time of calculation.

Bid1_i, Ask1_i, and PI_i are recorded within a 5-minute -period, where data is collected at 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, and 55 seconds past the minute, for a total of 60 data points over 5 minutes.

Last updated