GET /info
Returns comprehensive information about all available markets and tokens.
Request
curl https://zo-mainnet.n1.xyz/infoResponse
{
"markets": [
{
"marketId": 1,
"symbol": "…",
"priceDecimals": 1,
"sizeDecimals": 1,
"baseTokenId": 1,
"quoteTokenId": 1,
"imf": 1,
"mmf": 1,
"cmf": 1
}
],
"tokens": [
{
"tokenId": 1,
"symbol": "…",
"decimals": 1,
"mintAddr": "…",
"weightBps": 1
}
]
}Response Fields
Market Object
| Field | Type | Description |
|---|---|---|
marketId | number | Unique market identifier |
symbol | string | Trading pair symbol (e.g., “BTCUSD”) |
baseTokenId | number | Token ID of the base asset |
quoteTokenId | number | Token ID of the quote asset |
priceDecimals | number | Decimal precision for prices |
sizeDecimals | number | Decimal precision for order sizes |
imf | number | Initial Margin Fraction (e.g., 0.05 = 5%) |
mmf | number | Maintenance Margin Fraction (e.g., 0.025 = 2.5%) |
cmf | number | Cancel Margin Fraction (e.g., 0.01 = 1%) |
[!NOTE] Margin fractions explained:
- IMF (Initial): Maximum leverage = 1/IMF. E.g., 5% IMF = 20x max leverage.
- MMF (Maintenance): If margin falls below this, positions may be liquidated.
- CMF (Cancel): If margin falls below this, open orders may be cancelled.
Token Object
| Field | Type | Description |
|---|---|---|
tokenId | number | Unique token identifier |
symbol | string | Token symbol (e.g., “USDC”) |
decimals | number | Token decimal precision |
mintAddr | string | Solana mint address |
weightBps | number | Collateral weight in basis points (10000 = 100%) |
Example: Python
import requests
response = requests.get("https://zo-mainnet.n1.xyz/info")
data = response.json()
print("Markets:")
for market in data["markets"]:
max_leverage = 1 / market["imf"]
print(f" {market['symbol']} (ID: {market['marketId']}) - Max {max_leverage:.0f}x leverage")
print("\nTokens:")
for token in data["tokens"]:
weight_pct = token["weightBps"] / 100
print(f" {token['symbol']} (ID: {token['tokenId']}) - {weight_pct:.0f}% collateral weight")Helper Functions
import requests
from functools import lru_cache
@lru_cache(maxsize=1)
def get_market_info():
"""Fetch and cache market info."""
resp = requests.get("https://zo-mainnet.n1.xyz/info")
data = resp.json()
# Create lookup dictionaries
markets_by_id = {m["marketId"]: m for m in data["markets"]}
markets_by_symbol = {m["symbol"]: m for m in data["markets"]}
tokens_by_id = {t["tokenId"]: t for t in data["tokens"]}
return markets_by_id, markets_by_symbol, tokens_by_id
def get_market_by_symbol(symbol: str):
"""Get market info by symbol."""
_, markets_by_symbol, _ = get_market_info()
return markets_by_symbol.get(symbol)
def get_price_scale(market_id: int) -> int:
"""Get price multiplier for a market."""
markets_by_id, _, _ = get_market_info()
market = markets_by_id[market_id]
return 10 ** market["priceDecimals"]
def get_size_scale(market_id: int) -> int:
"""Get size multiplier for a market."""
markets_by_id, _, _ = get_market_info()
market = markets_by_id[market_id]
return 10 ** market["sizeDecimals"]Last updated on