Native Documentation
  • introduction
    • What is Native
    • About Native V2
    • Benefits for Key Players
  • SOLUTION
    • Native Credit Pool
    • Native Swap Engine
  • CONCEPTS
    • Orderbook
    • Firm Quote Orders
    • Auto Sign Orders
    • Swap Fees
    • Slippage
    • Base and Listed Assets
    • Single-Sided Liquidity Pools
    • Total Available Liquidity
    • Liquidity Pairing
    • Liquidity Bootstrapping
    • Health Ratio
    • Earning Fees and Incentives
    • Credit-Based Swap
      • Collateral Factor
      • PMM Credit
      • Settlement and Liquidation
    • Market-Responsive Pricing
    • Risks
  • USER GUIDE
    • Add Liquidity
    • Pair Liquidity
    • Claim Rewards
    • Swap with Native
  • Build with Native
    • Swap Aggregators
      • Guide
      • FirmQuote Swap APIs
        • GET Orderbook
        • GET Indicative quote
        • GET Firm quote
    • Asset Issuers
      • For Pegged Assets
      • For General Assets
  • Resources
    • Addresses
    • Audits
    • Github
    • System Status
    • Business Source License
    • Media Kit
Powered by GitBook
On this page
  • Headers
  • Params
  • Response
  1. Build with Native
  2. Swap Aggregators
  3. FirmQuote Swap APIs
  4. Old docs

GET /orderbook

Retrieve price levels for all supported pairs in a chain

GET https://newapi.native.org/v1/orderbook

This endpoint provides price levels for all supported pairs on a specific chain. It is useful for estimating available liquidity and obtaining quotes for different order sizes.

Headers

Name
Description

apiKey

API Key retrieved from the Native app

Params

Name
Description

chain*

Example

https://newapi.native.org/v1/orderbook?chain=ethereum

Response

Type: Array of order pairs

Name
Description

base_symbol

The symbol of the token the market maker is buying or selling.

base_address

The address of the token the market maker is buying or selling.

quote_symbol

The symbol of the token that will exchanged for the base token.

quote_address

The address of the token that will exchanged for the base token.

levels

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 the market maker is willing to transact at.

side

"ask" or "bid". Indicates whether the market maker is buying or selling the base token.

minimum_in_base

The minimum amount of base tokens that the market maker is willing to transact.

Example

[
    {
        "base_symbol": "ETH",
        "base_address": "0x2170ed0880ac9a755fd29b2688956bd959f933f8",
        "quote_symbol": "USDT",
        "quote_address": "0x55d398326f99059ff775485246999027b3197955",
        "levels": [
            [
                0.0001,
                1621.71
            ],
            [
                10,
                1621.72
            ],
            [
                40.75786733219471,
                1621.54
            ]
        ],
        "side": "bid",
        "minimum_in_base": 0.0001
    },
}

Note: The price levels returned are in a non-cumulative format. For example, if you wanted to trade 30 ETH for USDT, the price calculation would be: 0.0001 * 1621.71 + 10 * 1621.72 + (30 - 0.0001 - 10) * 1621.54 = 48648.00002.

Last updated 9 months ago

Blockchain name - Refer to the GET /chains API for more information

Explore this endpoint and see how it works .

here
here