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 /indicative-quote

Retrieve amount out for selling an ERC-20 or native token

GET https://newapi.native.org/v1/indicative-quote

This endpoint calculates and returns the number of tokens you would get based on the input token amount and the specified token pair. Native's routing optimizes for the best pricing among on-chain aggregators and Private Market Makers (PMMs).

For native token swaps, Native uses 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE to represent the token address of the native token.

Headers

Name
Description

apiKey

API Key retrieved from the Native app

Params

Name
Description

src_chain *

dst_chain*

token_in*

Address of the token to be sold

token_out*

Address of the token to be bought

amount

Amount of token to be sold, in ether unit

amount_wei

Amount of token to be sold, in wei unit

from_address*

Address of the user that sells the token_in

to_address

Address of the user that receives the token_out. If empty, this address will be the same as from_address

expiry_time

The expiry time of the quote, in seconds

Example

https://newapi.native.org/v1/indicative-quote?chain=ethereum&token_in=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE&token_out=0xdAC17F958D2ee523a2206206994597C13D831ec7&amount=1&from_address=0x42d4e9ee3f725c84b7934e4fda64f2be0f803130

In this example, wallet 0x42d4e9ee3f725c84b7934e4fda64f2be0f803130 requests a quote for swapping 1 ETH to USDT on the Ethereum network.

Response

Name
Description

success

Indicates if the quote was successful fetched

buyerToken

The ERC-20 token address of the buyer's token. This is the token the market maker will receive.

sellerToken

The ERC-20 token address of the seller's token. This is the token that will be sent to market maker.

buyerTokenAmount

The token out amount of the order in ether

buyerTokenAmountWei

The token out amount of the order in wei

sellerTokenAmount

The token input amount of the order in ether

sellerTokenAmountWei

The token input amount of the order in wei

price

Price = buyerTokenAmount / sellerTokenAmount

widgetFeeUsd

The platform fee charged by the widget owner

liquidityProviderFeeUsd

The fee that will be paid to the liquidity provider

totalFeeUsd

The total fees to be paid, if this order was executed

routes

The routes taken for the provided quote. Native router will find the shortest route if there is no direct liquidity for the given pair.

Example

{
    "success": true,
    "buyerToken": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
    "sellerToken": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
    "buyerTokenAmount": 1846.565451,
    "buyerTokenAmountWei": "1846565451",
    "sellerTokenAmount": "1",
    "sellerTokenAmountWei": "1000000000000000000",
    "price": 1846.565451,
    "widgetFeeUsd": 0,
    "liquidityProviderFeeUsd": 0,
    "totalFeeUsd": 0,
    "routes": [
        "ETH",
        "USDT"
    ],
}

In the response above, Native returns 1,846.565451 USDT for the order submitted.

Last updated 9 months ago

The blockchain name belonging to the token_in address - Refer to the GET /chains API for more information

The blockchain name belonging to the token_out address - Refer to the GET /chains API for more information

Explore this endpoint and see how it works .

here
here
here