# Firm-Quote

### 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.
      "feeBps": number,
      
      // Deadline UNIX timestamp passed by the user, you are free to accept, reject, or overwrite this request
      "quoteExpire": number,
      
      // <OPTIONAL> In wei, the amount that the market maker is allowed to borrow from native's credit pool
      "availableBorrowBalance": string
   }
}
```

### Sending Firm Quote response

After receiving the Firm Quote message, you need 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,
    "isBorrowing": string // <OPTIONAL> boolean value to indicate whether you want to use native's credit pool
  }
}
```

{% hint style="info" %}
**Note**:

1. This transaction always involves the user selling the `baseTokenAddress` for the amount specified by `baseTokenAmount` and buying the `quoteTokenAddress`.
2. The Native server will generally wait **up to 500 milliseconds** for a quote to be provided before the quote is flagged as invalid.
   {% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.native.org/native-dev/build-with-native/market-makers/api-guide/websocket-integration/firm-quote.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
