Pricing System
Last updated
Last updated
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.
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.
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.
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:
Thereafter, once thereโs a trade, mark price will be updated by the latest trade price: