Firm-Quote

Based on the order book that you give, our router will decide which liquidity source to route to give the best price. In case our router chooses your pricing, Native will ask you for the firm quote. The firm quote endpoint provided must adhere to the following format:

Firm Quote Endpoint

GET <market_maker_base_url>/firm-quote

Params

NameDescription

sellerTokenAmount

The token input amount of the order, In wei.

chainId

Chain ID of the network. In integer. eg: 1 for Ethereum, 56 for BSC.

sellerToken

The ERC20 token address will be sent to market maker.

buyerToken

The ERC20 token address will receive from market maker.

pool

Native pool contract address that will execute this order. Additional data for market maker to do validation or differential pricing.

seller

The address that will send seller token to market maker. (NativeRouter in most cases).

beneficiary

Address of the end user that initiated the swap request.

quoteId

Unique ID for this order request.

deadlineTimestamp

Deadline UNIX timestamp passed by the user, you are free to accept, reject, or overwrite this request.

feeBps

This is the fee that Native will charge market makers.

Market makers are supposed to factor the fee into their quote.

Native will work with market makers to coordinate the tracking and payment of fees, off-chain. Native will sign contracts with market makers, specifying how fees are set and paid. We will also provide data sources for market makers to monitor the fee owed.

Example

<market_maker_base_url>/firm-quote?sellerTokenAmount=10000000000000000000000&chainId=97&sellerToken=0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d&buyerToken=0x55d398326f99059ff775485246999027b3197955&pool=0xaaE854bdd940cf402d79e8051DC7E3390e32A3ac&seller=0x7d1F5C43998570629f5d00134321fB6a95451ec3&quoteId=62716-206e-41cb-8559-013f1ed1a65a&feeBps=12

In this example, a user sells 10,000 USDC to market maker in exchange for USDT on Binance Smart Chain (BSC).

Response

You need to provide a response in the following format:

NameDescription

success

Indicate true or false, whether you can provide a firm quote for this order flow.

buyerTokenAmount

The amount of tokens you are exchanging with the seller.

deadlineTimestamp

The timestamp of when this order will expire. We recommend approximately between 20s to 30s to give time for the order to be signed and executed on chain.

auth

This is an optional field and is used for verification with the signer. Native will just relay this value to the signer for verification.

Example response:

{
  "success": true,
  "buyerTokenAmount": "10100000000000000000000",
  "deadlineTimestamp": 1671086729, // Will be passed to sign-quote
  "auth": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9" // <OPTIONAL> will be passed to sign-quote
}

In the response above, market maker returns 10,100 USDT for the order sent in the example.

Last updated