Market Prices

Gets the highest bid and lowest ask price levels from the orderbook for provided products.

Rate limits

  • 2400 requests/min or 60 requests/sec per IP address. (weight = 1) or length of product_ids for multi-product markets query.

See more details in API Rate limits

Single Product

Request

Connect

WEBSOCKET [GATEWAY_WEBSOCKET_ENDPOINT]

Message

{
  "type": "market_price",
  "product_id": 1
}

Request Parameters

ParameterTypeRequiredDescription

product_id

number

Yes

Id of spot / perp product for which to retrieve market price data.

Response

{
  "status": "success",
  "data": {
    "product_id": 1,
    "bid_x18": "24224000000000000000000",
    "ask_x18": "24243000000000000000000"
  },
  "request_type": "query_market_price",
}

Note: that price is represented using fixed point, so it is 1e18 times greater than the decimal price.

Multiple Products

Request

Connect

WEBSOCKET [CORE_WEBSOCKET_ENDPOINT]

Message

{
  "type": "market_prices",
  "product_ids": [1, 2]
}

Request Parameters

ParameterTypeRequiredDescription

product_ids

number[]

Yes

List of spot / perp products for which to retrieve market price data.

Response

{
  "status": "success",
  "data": {
    "market_prices": [
      {
        "product_id": 1,
        "bid_x18": "31315000000000000000000",
        "ask_x18": "31326000000000000000000"
      },
      {
        "product_id": 2,
        "bid_x18": "31291000000000000000000",
        "ask_x18": "31301000000000000000000"
      },
    ]
  },
  "request_type": "query_market_prices"
}

Last updated