Read market data

Pod's full node includes a built-in indexer that exposes live and historical market data via the ob_ JSON-RPC endpoints. No external indexer is needed.

List available markets

const markets = await provider.send("ob_getMarkets", []);
// Returns: [{ id, name, base_token_symbol, quote_token_symbol, last_clearing_price, volume_24h, ... }]

Get orderbook snapshot

const orderbookId = "0x0000000000000000000000000000000000000000000000000000000000000001";
const depth = 20; // price levels per side

const snapshot = await provider.send("ob_getOrderbook", [orderbookId, depth]);
// Returns: { buys: { price: { volume, minimum_expiry } }, sells: { ... }, timestamp }

Get OHLCV candles

const candles = await provider.send("ob_getCandles", [
  orderbookId,
  startTimestamp,  // microseconds
  endTimestamp,    // microseconds
  interval,        // candle interval
]);

Get order history

Get positions

See the JSON-RPC reference for the full ob_ API specification.

Last updated