Portal pengembangan
Tema

Pricing Mechanism#

Price References and Price Limits#

Onchain uses multiple price references to separate the latest executed trade from the broader market reference used for risk controls. The applicable prices depend on whether the instrument is a spot pair or a perpetual contract.

Price References#

  • Last price: The price of the most recent matched trade on the instrument's order book. It changes only when a new trade is executed and does not guarantee the execution price of the next order.
  • Index price: A weighted reference derived from prices across multiple exchanges. It provides the external market reference used in price limits and perpetual mark-price calculations.
  • Mark price: A reference used only for perpetual contracts to calculate unrealized PnL, margin requirements, and liquidation risk. It is designed to reduce the effect of short-term order-book volatility.

Spot Pricing#

Spot markets use the last price to display the latest execution and the index price as the basis for price limits. A buy order must not exceed the highest price limit, and a sell order must not fall below the lowest price limit.

Meeting the price-limit requirement does not guarantee execution; the order must still satisfy the remaining trading rules and match available liquidity.

Perpetual Mark Price#

For perpetual contracts, Onchain calculates three reference prices and uses their median. The resulting reference is then bounded by the contract's current price limits.

  • P1 = Index price + 10-second basis EMA
  • P2 = median(Best bid, Best ask, Last price)
  • P3 = Index price × (1 + Latest funding rate × Time ratio)

Reference price = median(P1, P2, P3)

Mark price = min(max(Reference price, Lowest price limit), Highest price limit)

The basis used in P1 is the contract mid-price minus the index price. The 10-second exponential moving average gives more weight to recent observations.

The time ratio in P3 is the time remaining until the next funding settlement divided by the funding period.

Price Limits#

Price limits prevent orders from being submitted too far from the market reference. They apply by order side:

  • Buy orders: Must be at or below the highest price limit.
  • Sell orders: Must be at or above the lowest price limit.

For perpetual contracts, the same limits apply whether the order opens or closes a position.

During the first 10 minutes after listing:

The limits are calculated from the index price and the initial limit percentage X:

  • Highest price limit = Index price × (1 + X)
  • Lowest price limit = Index price × (1 − X)

After the first 10 minutes:

The calculation also incorporates the average basis and the configured percentages Y and Z:

Highest price limit:

min(max(Index price, Index price × (1 + Y) + Average basis), Index price × (1 + Z))

Lowest price limit:

max(min(Index price, Index price × (1 − Y) + Average basis), Index price × (1 − Z))

The average basis is the average difference between the instrument mid-price and the index price across the configured sampling period. Spot markets use the spot mid-price; perpetual contracts use the contract mid-price.

The configured parameters are instrument-specific and should not be inferred from another market.