💲Pricing System

1. Index Price

The Index Price for a perpetual contract is the price of its underlying market. In OpenWorld, index price is used for calculating the trading premium between a perpetual contract and its underlying market when both markets are live. The trading premium will determine the funding payment between longs and shorts, which incentivizes a perpetual contract to trade close to underlying price. Another use of index price is to determine the first mark price used for pricing a perpetual contract on its first trading day.

2. Mid-Price

Mid-Price is the average price of the best bid and ask price of a perpetual contract on its orderbook. It is used for calculating the trading premium between the perpetual contract market and its underlying market when both markets are live, which determine the funding payment between longs and shorts.

3. Trade Price

Trade price is formed when a trade matched on the orderbook. Trade price determines how much settlement asset (DAI) should be added or subtracted from users account for the trading counterparties. For instance, user A placed a sell order of 1 stock X at the price of 100. After that, user B placed a buy order of 1 stock X with market order. User B’s buy order matched with user A’s sell order at the price of 100. So, the trade price of this match is 100. In user A’s account, 1 stock X will be subtracted and 100 DAI will be added. In user B’s account, 1 stock X will be added and 100 DAI will be subtracted.

4. Mark Price

Mark Price is the fair price used to determine the value of perpetual contracts and users’ accounts. Mark Price is quoted by DAI, which serves as the pricing and settlement asset. To avoid market manipulation that might distort mark price by a few abnormal orders, we apply the weighted average of past trade prices to calculate mark price. To better reflect fair market prices, the longer time is past from the last trade, the less weight will be allocated to the past trade prices in the weighted average formula. The Algo is as follows:

Since there is no trade price at the beginning of each perpetual contract, we initialize the mark price with the most recent index price:

Mark Price=Index Price
Mark Price Update Time=Current Time (In Second)

Thereafter, once there’s a trade, mark price will be updated by the latest trade price:

Last Mark Price Weight =0.95^max (1, Current Trade Time - Mark Price Update Time)
Mark Price Update Time=Current Trade Time
Mark Price= Last Mark Price Weight *Mark Price + (1 - Last Mark Price Weight) * Trade Price

Last updated