Sign-Quote

1. Receiving Sign Quote Request

After our server has validated the firm quote, we will ask for you to sign the quote by requesting the following message:

{
  "messageType": "signQuote",
  "message": {
    "quoteData": {
      // It is leveraged to mitigate quote replay.
      "nonce": number,
      "signer": string,
      "baseTokenAddress": string,
      "quoteTokenAddress": string,
      "baseTokenAmount":  string,
      "quoteTokenAmount": string,
      "deadlineTimestamp": string,
      "chainId": number,
      "caller": string,
      "authId": string, // <OPTIONAL> The same authId if it is sent in the firm quote
      "quoteId": string,
    }
  }
}

2. Sending Sign Quote Response

You need to sign the quote based on the EIP712 specification with our order format, you can refer to this guide for an example of signing transaction. Next, you need to send the response back to Native in this following format:

{
  "messageType": "signature",
  "message": {
    "quoteId": string,  // This is the quote id previously sent.
    "signature": string  // 0x-prefix signature (65 bytes)
  }
}

Note: Native server will generally wait 350 milliseconds for a quote to be signed before the quote is flagged as invalid. Too many signature failures can result in an order pause to the Market Maker because it affects the user experience that trades through Native.

Success!

Congratulations! You've successfully integrated with Native and you're now a Market Maker 🥳

Last updated