Skip to content
Docs
Actions
Retrieving Orderbooks

Retrieving Orderbooks

aori_viewOrderbook

This method allows users to view the current orderbook. The orderbook contains a list of active orders that have neither been cancelled nor fulfilled.

ParametersTypeRequiredDescription
chainIdstringNoThe ID of the blockchain chain you're interested in. If not provided, the method will return orders from all chains.
query.basestringNoBase Token
query.quotestringNoQuote Token
sidestringNoTwo options: "BUY" or "SELL". Determines the direction of the orderbook.
limitintegerNoOptional: Number of orders shown. If no number is provided, a default value of 100 is used.
 {
   "id": <unique_request_id>,
   "jsonrpc": "2.0",
   "method": "aori_viewOrderbook",
   "params": [{
     "chainId": <chain_id>,
     "query": {
       "base": <base_token>,
       "quote": <quote_token>
     },
     "side": <string>,
     "limit": <integer>
   }]
 }

Response

{
 "id": <unique_request_id>,
 "result": {
   "orders": [
     {
       // Order details
     },
     // ... more orders
   ]
 }
}

Notes:

  • The method filters out orders that have been cancelled or fulfilled.
  • If chainId is provided, the method will also fetch the current block number and timestamp for that chain. This might be used for further processing or validation, though it's not directly returned in the response.

aori_subscribeOrderbook

See Market Streaming.