Skip to main content
The marketState query returns the current mark price, oracle (index) price, last trade price, funding rate index, and price readiness flag for a contract. Use this on startup or after a reconnect to synchronize your local price state before relying on WebSocket updates. It also serves as a lightweight check to confirm that a contract is ready to accept orders.
Check priceReady before placing orders. If the mark price is unavailable, order placement may be rejected by the exchange until prices are published.
An unknown contract ID, or a contract with no published price, returns HTTP 200 with priceReady: false and prices of "0" rather than an error. Decide availability from priceReady.

Request

string
required
type (required) — Must be "marketState".
string
required
asset (required) — The contract ID to fetch market state for, expressed as a decimal string (e.g. "1"). Use the contractId from configs.

Response

string
Always "marketState".
string
The contract ID from the request.
string
Current mark price used for PnL calculation and liquidation checks (raw integer string). Returns "0" if the mark price has not yet been published for this contract.
string
Current oracle (index) price sourced from external feeds (raw integer string). Returns "0" if not yet published. Used to compute the funding rate.
string
Price of the most recent trade on this contract (raw integer string). Returns "0" if no trades have occurred yet.
boolean
true if mark and index prices are available and valid for trading. false means prices have not been published yet or the contract ID is unknown — orders placed while this is false may be rejected.
string
Cumulative funding rate index snapshot at the time of the last funding settlement. Use this to compute unrealized funding payments for open positions.
integer
Unix millisecond timestamp of the most recent funding settlement event.