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.0001",
      "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.00015",
      "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
fundingRatestring or objectCurrent funding rate as string (e.g., "0.0001"), or empty object {} when unavailable
openIntereststringTotal open interest in base asset
timestampintegerUnix timestamp in milliseconds when data was last updated

Error Response

{
  "status": "error",
  "error": {
    "message": "Could not get market prices",
    "code": "INTERNAL_ERROR"
  },
  "request_id": "5ccf215d37e3ae6d",
  "timestamp": "2025-01-01T00:00:00Z"
}

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:

ErrorDescription
Invalid signatureEIP-712 signature validation failed
Invalid market symbolMarket symbol not recognized
Nonce already usedNonce must be greater than previous value
Rate limit exceededToo many requests in time window
Request expiredexpiresAfter timestamp has passed
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)
  • Rolling 24-hour window, continuously updated

Funding Rate

  • fundingRate: Current funding rate for perpetual contracts
  • Used to calculate funding payments between longs and shorts

Open Interest

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

Timestamps

  • timestamp: When this market data was last updated
  • Unix timestamp in milliseconds for precise timing
  • Critical for latency-sensitive strategies

Related Endpoints