Skip to content

Get Market Prices

Retrieve current market prices and 24-hour statistics for all trading pairs.

Endpoint

POST https://papi.synthetix.io/v1/info

Request

Request Format

{
  "params": {
    "action": "getMarketPrices"
  }
}

Request Parameters

ParameterTypeRequiredDescription
params.actionstringYesMust be "getMarketPrices"

Response

Success Response

{
  "status": "ok",
  "response": {
    "BTC-USDT": {
      "symbol": "BTC-USDT",
      "markPrice": "45025.37500000",
      "indexPrice": "45025.50000000",
      "lastPrice": "45025.00000000",
      "bestBid": "45020.00000000",
      "bestAsk": "45030.00000000",
      "volume24h": "1250.50",
      "quoteVolume24h": "56282500.00",
      "fundingRate": "0.00001250",
      "openInterest": "12500.75",
      "prevDayPrice": "44952.00000000",
      "timestamp": 1704067200000
    },
    "ETH-USDT": {
      "symbol": "ETH-USDT",
      "markPrice": "2998.75000000",
      "indexPrice": "2998.80000000",
      "lastPrice": "2998.75000000",
      "bestBid": "2996.00000000",
      "bestAsk": "3001.50000000",
      "volume24h": "8945.25",
      "quoteVolume24h": "26800000.00",
      "fundingRate": "0.00001250",
      "openInterest": "45678.50",
      "prevDayPrice": "2804.00000000",
      "timestamp": 1704067200000
    }
  },
  "request_id": "5ccf215d37e3ae6d"
}

Market Prices Response Object

The response returns an object (map) where keys are market symbols and values are market price data:

  • Object Format: Keys are market symbols (e.g., "BTC-USDT"), enabling O(1) lookups
  • Combined Data: Each value includes real-time prices and rolling 24-hour statistics
  • Symbol Included: Each object contains the symbol field for consistency
  • Fast Access: Direct access to specific market data without iteration

Market Price Object

FieldTypeDescription
symbolstringTrading pair symbol (e.g., "BTC-USDT")
markPricestringCurrent mark price used for position valuation and liquidation
indexPricestringReference price from external sources (spot exchanges)
lastPricestringLast traded price
bestBidstringBest bid price from order book
bestAskstringBest ask price from order book
prevDayPricestringMarket price 24 hours ago
volume24hstring24-hour trading volume in base asset
quoteVolume24hstring24-hour trading volume in quote asset (e.g., USDT)
fundingRatestringCurrent estimated funding rate for the market
openIntereststringTotal open interest in base asset
timestampintegerUnix timestamp in milliseconds when the data was last updated

Error Response

{
  "status": "error",
  "error": {
    "message": "Could not get market prices",
    "code": "INTERNAL_ERROR"
  },
  "request_id": "5ccf215d37e3ae6d"
}

Code Examples

Get All Market Prices

{
  "params": {
    "action": "getMarketPrices"
  }
}

Validation Rules

  • No authentication required
  • No parameters to validate
  • Returns data for all available markets
  • Real-time data from price feeds

Error Handling

Common error scenarios:

Error CodeDescriptionRetryable
UNAUTHORIZEDEIP-712 signature validation failedNo
VALIDATION_ERRORRequest validation failedNo
MISSING_REQUIRED_FIELDRequired field is missingNo
INVALID_FORMATField format is invalidNo
INVALID_VALUEInvalid parameter valueNo
RATE_LIMIT_EXCEEDEDToo many requests in time windowYes
INSUFFICIENT_MARGINNot enough margin for tradeNo
ORDER_NOT_FOUNDOrder does not existNo
OPERATION_TIMEOUTOperation timed outYes
ErrorDescription
Market configuration unavailableFailed to retrieve market list
Mark price unavailableFailed to retrieve mark price data
Index price unavailableFailed to retrieve index price data

Rate Limiting

  • Default: 1000 requests per minute per IP
  • Burst: Up to 100 requests per second
  • Real-time Data: High-frequency access supported

Data Fields Explained

Price Types

Mark Price

The mark price is the current fair value of the perpetual contract used for:

  • Position valuation in portfolios
  • Liquidation price calculations
  • PnL calculations
  • Updated continuously based on trading activity and price feeds

Index Price

The index price is a reference price derived from external spot exchanges:

  • Provides an external price reference independent of Synthetix trading
  • Used as a baseline for mark price calculations
  • Sourced from multiple spot exchanges for accuracy

Prev Day Price

The market (last) price 24 hours ago

Core Metrics

Volume

  • volume24h: Total base asset traded in 24 hours (e.g., BTC amount)
  • quoteVolume24h: Total quote asset traded in 24 hours (e.g., USDT amount)
  • Rolling 24-hour window, continuously updated

Funding Rate

  • fundingRate: Current estimated funding rate for the market, fetched from the funding rate service
  • For per-symbol funding rate history, see Get Funding Rate

Open Interest

  • openInterest: Total open positions in base asset
  • Key indicator of market activity and liquidity

Timestamps

  • timestamp: Unix timestamp in milliseconds representing when the response was generated
  • Each price field (markPrice, indexPrice, lastPrice) is updated in real-time from price feeds

Related Endpoints