Orderbook
Price levels endpoint for Native APIs and aggregators
To indicate current pricing for Native APIs and aggregators, you must provide a price level endpoint that returns the price levels of all supported pairs on a specified chain.
Native will call this endpoint every second on every supported network to retrieve the latest price levels.
The endpoint must adhere to the following format:
Endpoint
Params
Name | Description |
---|---|
| Chain ID of the blockchain network, in integers. For example: 1 for Ethereum, 56 for BSC. |
Example
Response
You need to provide a response in the following format:
Type: Array of order pairs
Name | Description |
---|---|
| The symbol of the token you are buying or selling |
| The address of the token you are buying or selling |
| The symbol of the token that will exchanged for the base token |
| The address of the token that will exchanged for the base token |
| This is an array of tuples in the format of [[int, int]]. The value at index 0 is the amount of tokens and the value at index 1 is the price you are willing to transact at. |
| "Ask" or "Bid" Indicates whether you are buying or selling the base token |
| The minimum amount of base tokens that you are willing to transact |
Example
Note: The price levels must be returned in a non-cumulative manner.
For example, given the following price levels for the WETH-USDT
pair:
If someone wants to trade 3 WETH for USDT, the price would be calculated as follows: 0.001 * 1600 + 1 * 1610 + 1.999 * 1612 = 4833.988
The Native server is hosted in the Singapore region, and all market makers are required to respond to all endpoints in under 1 second.
Last updated