Orderbook Data (ob_)

Orderbook Data (ob_) is a read-focused API surface that provides access to markets and orderbook activity without requiring clients to run their own indexer or interact with the orderbook contracts directly. It is powered by a native indexer built into the Pod protocol, ensuring fast, consistent, and up-to-date views of on-chain state.

The API exposes live orderbook snapshots, historical OHLCV candles, account-level order history and positions, making it ideal for trading interfaces, analytics, and monitoring services.

📝 This is a JSON-RPC 2.0 API. The request path is not important; the method to execute is defined by the method field in the request body. You can send all requests to /, and any path after / is optional and used only for documentation clarity.

Get All Markets

post

Retrieves a list of all available markets/orderbooks with their metadata and statistics. Each market includes token information, current pricing, 24-hour statistics, and fee structure.

Body
jsonrpcstringRequiredDefault: 2.0
methodstringRequiredDefault: ob_getMarkets
idintegerRequiredDefault: 1
paramsarrayOptionalDefault: []
Responses
chevron-right
200

Array of market objects with metadata and statistics

application/json
post
/ob_getMarkets
200

Array of market objects with metadata and statistics

Get Orderbook Snapshot

post

Retrieves the current orderbook snapshot for a specified market, showing buy and sell orders aggregated by price level.

Orders are grouped by price and include total volume and minimum expiry at each level. Buy orders are sorted by price descending (best bid first), sell orders by price ascending (best ask first).

Body
jsonrpcstringRequiredDefault: 2.0
methodstringRequiredDefault: ob_getOrderbook
idintegerRequiredDefault: 1
paramsarrayRequired

Parameters:

  1. orderbook_id (bytes32): The 32-byte orderbook identifier
  2. depth (integer, optional): Maximum number of price levels to return for each side. If omitted, all available price levels are returned.
Example: ["0x0000000000000000000000000000000000000000000000000000000000000001",20]
Responses
chevron-right
200

Orderbook snapshot with aggregated buy and sell orders

application/json
post
/ob_getOrderbook
200

Orderbook snapshot with aggregated buy and sell orders

Get Historical Candles

post

Retrieves historical candle (OHLCV) data for a specified orderbook.

Candles represent aggregated price and volume data over specified time intervals. Results are returned sorted by timestamp in descending order (newest first).

All prices are in quote/base units with 1e18 scale (hex-encoded).

Body
jsonrpcstringRequiredDefault: 2.0
methodstringRequiredDefault: ob_getCandles
idintegerRequiredDefault: 1
paramsarrayRequired

Parameters:

  1. orderbook_id (bytes32): The 32-byte orderbook identifier
  2. query (object): Query parameters with resolution, time range, and limit
Example: ["0x0000000000000000000000000000000000000000000000000000000000000001",{"resolution":"1h","from_ts":1704067200000000,"to_ts":1704153600000000,"limit":100}]
Responses
chevron-right
200

Array of candle objects sorted by timestamp (newest first)

application/json
post
/ob_getCandles
200

Array of candle objects sorted by timestamp (newest first)

Get Account Orders

post

Retrieves orders for a specific address in a given orderbook, with support for cursor-based pagination.

Orders are returned in descending order by timestamp/nonce. Use the next_cursor from the response to fetch subsequent pages.

Body
jsonrpcstringRequiredDefault: 2.0
methodstringRequiredDefault: ob_getOrders
idintegerRequiredDefault: 1
paramsarrayRequired

Parameters:

  1. address (address): The address to get orders for
  2. query (object): Query parameters with optional orderbook_id, limit, cursor, and status filter
Example: ["0x742d35Cc6634C0532925a3b844Bc9e7595f2bD28",{"orderbook_id":"0x0000000000000000000000000000000000000000000000000000000000000001","limit":10,"status":"active"}]
Responses
chevron-right
200

Object containing orders array and pagination cursor

application/json
post
/ob_getOrders
200

Object containing orders array and pagination cursor

Get Account Positions

post

Retrieves trading positions for a specific address across all orderbooks.

Positions track the cost basis of acquired tokens (from buys and deposits) and compute unrealized PnL using the current clearing price. The response includes per-token positions (balance, position size, unrealized PnL) and aggregate metrics (total realized PnL, total invested, total unrealized PnL).

All amounts use 1e18 fixed-point scale.

Body
jsonrpcstringRequiredDefault: 2.0
methodstringRequiredDefault: ob_getPositions
idintegerRequiredDefault: 1
paramsstring[]Required

Parameters:

  1. address (address): The address to get positions for
Example: ["0x742d35Cc6634C0532925a3b844Bc9e7595f2bD28"]
Responses
chevron-right
200

Positions response with per-token positions and aggregate PnL

application/json
post
/ob_getPositions
200

Positions response with per-token positions and aggregate PnL

Last updated