Firm-Quote

Based on the order book you provide, our router will determine the optimal liquidity source to offer the best price. If your pricing is selected, Native will request a firm quote from you.

The firm quote endpoint must adhere to the following format:

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 (e.g., 1 for Ethereum, 56 for BSC)

sellerToken

The ERC20 token address that will be sent to the market maker

buyerToken

The ERC20 token address that will be received from the market maker

pool

Native pool contract address that will execute this order. Additional data for validation or pricing.

seller

The address that will send the seller token to the market maker (typically NativeRouter)

beneficiary

Address of the end user who initiated the swap request

quoteId

Unique ID for this order request

deadlineTimestamp

Deadline UNIX timestamp specified by the user; you can accept, reject, or modify this request

feeBps

Fee that Native will charge market makers, factored into their quote. Native collaborates with market makers to track and pay fees off-chain. Contracts with market makers will specify how fees are set and paid, and data sources will be provided for monitoring fee obligations.

Example

plaintextCopy code<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 the market maker in exchange for USDT on Binance Smart Chain (BSC).

Response

You must provide a response in the following format:

NameDescription

success

Indicates whether you can provide a firm quote for this order flow (true/false)

buyerTokenAmount

The amount of tokens you are exchanging with the seller

deadlineTimestamp

The timestamp when this order will expire, typically 20-30 seconds for execution

auth

Optional field used for verification with the signer, relayed by Native for signing

Example

jsonCopy code{
  "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, the market maker returns 10,100 USDT for the order sent in the example.

Last updated