Get Market Prices
Retrieve current market prices and 24-hour statistics for all trading pairs.
Endpoint
POST https://papi.synthetix.io/v1/infoRequest
Request Format
{
"params": {
"action": "getMarketPrices"
}
}Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
params.action | string | Yes | Must 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
| Field | Type | Description |
|---|---|---|
symbol | string | Trading pair symbol (e.g., "BTC-USDT") |
markPrice | string | Current mark price used for position valuation and liquidation |
indexPrice | string | Reference price from external sources (spot exchanges) |
lastPrice | string | Last traded price |
bestBid | string | Best bid price from order book |
bestAsk | string | Best ask price from order book |
prevDayPrice | string | Market price 24 hours ago |
volume24h | string | 24-hour trading volume in base asset |
fundingRate | string or object | Current funding rate as string (e.g., "0.0001"), or empty object {} when unavailable |
openInterest | string | Total open interest in base asset |
timestamp | integer | Unix 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:
| Error | Description |
|---|---|
| Invalid signature | EIP-712 signature validation failed |
| Invalid market symbol | Market symbol not recognized |
| Nonce already used | Nonce must be greater than previous value |
| Rate limit exceeded | Too many requests in time window |
| Request expired | expiresAfter timestamp has passed |
| Error | Description |
|---|---|
| Market configuration unavailable | Failed to retrieve market list |
| Mark price unavailable | Failed to retrieve mark price data |
| Index price unavailable | Failed 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
- Get Markets - Market configuration
- Get Funding Rate - Current funding rates per symbol
- Get Open Interest - Open interest for all markets
- Get Candles - Historical price data
- Market Price Updates (WebSocket) - Real-time streaming of all price data