⚙️
Native Developers
  • Native V1
    • Overview
    • Operations
      • Single-Hop Transaction: Off-chain Pricing
      • Single-Hop Transaction: On-chain Pricing
      • Multi-Hop Transaction
      • L1 Token Swap
      • Creating a Pool
      • Updating a Pool
    • System Components
      • GUI
      • Native Backend
      • Pricer
      • Registry
      • Signer
      • Pool
      • Pool Factory
      • Treasury
      • Router
    • Smart Contracts
      • Core
        • Registry
        • NativePool
        • NativePoolFactory
        • NativeRouter
      • Liquidity Pools
    • Contract Address
    • API References
      • GET /v1/indicative-quote
      • GET /v1/orderbook
      • GET v1/firm-quote
      • GET v1/firm-quote/calldata
    • Guide
      • Get quote for ETH to USDT
      • Execute ETH to USDT swap on Native
    • Routing
  • Market Maker Integration
    • WebSocket Connection
Powered by GitBook
On this page
  1. Native V1
  2. API References

GET /v1/indicative-quote

Get amount out for selling a ERC20 / native token.

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

This endpoint provides amount of token out Native quote given the requested token and token amount. Native routing optimises for the best price among on-chain aggregator and private market makers.

Native supports native token swap. Use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE to represent the token address of the native token.

Headers

Name
Description

apiKey

Contact Native to get your API key.

Params

Name
Description

chain

Blockchain name. Supported chains: ethereum, bsc

token_in

Token address for the token to be sold.

token_out

Token address for the token to be bought.

amount

Amount of token to be sold, in ether unit.

address

Address of the user making the swap.

Example

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

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

Response

{
  buyerToken: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
  buyerTokenAmount: 1839.7184,
  liquidityProviderFee: 0,
  price: 1839.7184,
  routes: ["ETH", "USDT"],
  sellerToken: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
  sellerTokenAmount: 0.01,
  success: true,
  totalFee: 0,
  widgetFee: 0,
}

In the response above, Native returns 1,839.7184 USDT for the order sent in the example.

PreviousAPI ReferencesNextGET /v1/orderbook

Last updated 1 year ago