Retrieving Orderbooks
aori_viewOrderbook
To view the current orderbook, you can use the aori_viewOrderbook
method. This method allows users to view the current orderbook. The orderbook contains a list of active orders that have neither been cancelled nor fulfilled.
Parameters | Type | Required | Description |
---|---|---|---|
chainId | string | No | The ID of the blockchain chain you're interested in. If not provided, the method will return orders from all chains. |
inputToken | string | No | Base Token |
outputToken | string | No | Quote Token |
limit | integer | No | Optional: Number of orders shown. If no number is provided, a default value of 100 is used. |
{
"id": <request_id>,
"jsonrpc": "2.0",
"method": "aori_viewOrderbook",
"params": [{
"chainId": <chain_id>,
"inputToken": <input_token>,
"outputToken": <output_token>,
"limit": <integer>
}]
}
Response
{
"id": <request_id>,
"result": {
"orders": [
{
// Orders fitting the query. These fit the Limit Order type.
},
// ... 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