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

Params

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

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.

Explore this endpoint and see how it works here.

Last updated