marketState query returns the current mark price, index (oracle) 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.Request
string
required
Must be
"marketState".string
required
The contract ID to fetch market state for, expressed as a decimal string (e.g.
"1"). Use the contractId from configs.Response
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 index (oracle) 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 indicates prices have not been published yet — 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.