Skip to Content

GET /info

Returns comprehensive information about all available markets and tokens.

Request

curl https://zo-mainnet.n1.xyz/info

Response

{ "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

FieldTypeDescription
marketIdnumberUnique market identifier
symbolstringTrading pair symbol (e.g., “BTCUSD”)
baseTokenIdnumberToken ID of the base asset
quoteTokenIdnumberToken ID of the quote asset
priceDecimalsnumberDecimal precision for prices
sizeDecimalsnumberDecimal precision for order sizes
imfnumberInitial Margin Fraction (e.g., 0.05 = 5%)
mmfnumberMaintenance Margin Fraction (e.g., 0.025 = 2.5%)
cmfnumberCancel 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

FieldTypeDescription
tokenIdnumberUnique token identifier
symbolstringToken symbol (e.g., “USDC”)
decimalsnumberToken decimal precision
mintAddrstringSolana mint address
weightBpsnumberCollateral 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