GET /market/{id}/stats
Returns detailed statistics for a specific market, including funding rates and price information.
Request
Path Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
id | number | Yes | Market ID (e.g., 0 for BTC/USD) |
curl https://zo-mainnet.n1.xyz/market/0/statsResponse
{
"indexPrice": null,
"indexPriceConf": null,
"frozen": true,
"volumeBase24h": 1,
"volumeQuote24h": 1,
"high24h": null,
"low24h": null,
"close24h": null,
"prevClose24h": null,
"perpStats": null
}Response Fields
| Field | Type | Description |
|---|---|---|
indexPrice | number | null | Current oracle index price |
indexPriceConf | number | null | Index price confidence interval |
volumeBase24h | number | 24h volume in base asset |
volumeQuote24h | number | 24h volume in quote asset (USD) |
high24h | number | null | 24h high price |
low24h | number | null | 24h low price |
close24h | number | null | Current 24h close price |
prevClose24h | number | null | Previous 24h close price |
frozen | boolean | Whether the market is frozen |
perpStats Object
| Field | Type | Description |
|---|---|---|
mark_price | number | Current mark price |
funding_rate | number | Current hourly funding rate |
next_funding_time | string | Next funding timestamp (ISO 8601) |
open_interest | number | Total open interest in base units |
aggregated_funding_index | number | Cumulative funding index |
Example: Python
import requests
market_id = 0 # BTC/USD
response = requests.get(f"https://zo-mainnet.n1.xyz/market/{market_id}/stats")
stats = response.json()
print(f"Index Price: ${stats['indexPrice']:,.2f}")
print(f"Funding Rate: {stats['perpStats']['funding_rate']:.4%}")
print(f"Open Interest: {stats['perpStats']['open_interest']:,.2f} BTC")Fetching Multiple Markets
import requests
from concurrent.futures import ThreadPoolExecutor
market_ids = [0, 1, 2] # BTC, ETH, SOL
def fetch_stats(market_id):
resp = requests.get(f"https://zo-mainnet.n1.xyz/market/{market_id}/stats")
return (market_id, resp.json())
with ThreadPoolExecutor(max_workers=3) as executor:
all_stats = list(executor.map(fetch_stats, market_ids))
for market_id, stats in all_stats:
print(f"Market {market_id}: {stats['perpStats']['funding_rate']:.4%}")Last updated on