Firm-Quote

1. Receiving Firm Quote Request

If our router decides to route to you, your server will receive a Firm Quote message via websocket in the following format:

{
  "messageType": "firmQuote",
  "message": {
    "quoteId": string, // This is a unique quote ID generated by Native
    "chainId": number, // 1 for ETH L1
    "baseTokenAddress": string,  // Base token (the token the trader sells).
    "quoteTokenAddress": string,  // Quote token (the token the trader buys).
    "baseTokenAmount": string, // In wei

    "seller": string, // The address that will send seller token to market maker. 
    "pool": string, // Native pool contract address that will execute this order.

    // How much, in basis points, will be charged to you in fees if this order goes through.
    "feesBps": number
    // Deadline UNIX timestamp passed by the user, you are free to accept, reject, or overwrite this request
    "deadlineTimestamp": number
  }
}

After receiving this Firm Quote message, you have to compute the quote you'd like to offer (based on market conditions, internal balances, etc) and return it in the following format:

2. Sending Firm Quote Response

After receiving this Firm Quote message, you have to compute the quote you'd like to offer (based on market conditions, internal balances, etc) and return it in the following format:

{
  "messageType": "quote",
  "message": {
    // Same as Firm Quote request
    "quoteId": string;
    "chainId": number, // 1 for ETH L1
    "baseTokenAddress": string,
    "quoteTokenAddress": string,
    
    // Amounts are in wei
    "baseTokenAmount": string,
    "quoteTokenAmount": string,

    // The unix timestamp when the quote expires, in seconds.
    "deadlineTimestamp": number,
    
    // <OPTIONAL> Auth Id that we will pass back when we request for a sign quote
    "authId"?: string;
  }
}

Note that this transaction always involves the user selling the baseTokenAddress with the amount of baseTokenAmount and buying the quoteTokenAddress .

Note: Native server will generally wait 500 milliseconds for a quote to be provided before the quote is flagged as invalid.

Last updated