# Trader

Users and traders can use this API to fetch the best quote from all the integrated market makers.&#x20;

### Get Quote

## Get the best quote for a trade

<mark style="color:blue;">`GET`</mark> `api.proxy.rfq.dfyn.network/api/getQuote`

Returns the best quote from all the available market makers

#### Query Parameters

| Name                                      | Type   | Description                                              |
| ----------------------------------------- | ------ | -------------------------------------------------------- |
| user<mark style="color:red;">\*</mark>    | String | address of the user                                      |
| token0<mark style="color:red;">\*</mark>  | String | token0 (base token) address                              |
| token1<mark style="color:red;">\*</mark>  | String | token1 (quote token) address                             |
| amount0<mark style="color:red;">\*</mark> | String | token0 (base token) amount                               |
| chainId<mark style="color:red;">\*</mark> | String | chain ID                                                 |
| nonce<mark style="color:red;">\*</mark>   | uint   | nonce of the user (can be fetched from the RFQ contract) |

{% tabs %}
{% tab title="200: OK Quote received" %}

```javascript
{
    "data": {
        "message": "0x552ce952865663309de97567d906fd5a7d8c22ff66d5e4a39905c100f05426a9",
        "messageHash": "0xcd1e02e04cc62a04712c43a69fea0498fcd1c7259783e91a744f17239372edff",
        "v": "0x1b",
        "r": "0xca255446e47a610783b22850747ce663978ef1d56bb908301ab9167edeb14e2f",
        "s": "0x69de981f8bf06a158a8a7128302c536c5c7f74a33941b7cdd6921cb0d77c299f",
        "signature": "0xca255446e47a610783b22850747ce663978ef1d56bb908301ab9167edeb14e2f69de981f8bf06a158a8a7128302c536c5c7f74a33941b7cdd6921cb0d77c299f1b",
        "messageObject": {
            "user": "0x40d5250D1ce81fdD1F0E0FB4F471E57AA0c1FaD3",
            "custodian": "0x876cEA61f692F1624b6c8B1a8aC3d7A978A9f4fB",
            "token0": "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",
            "token1": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
            "amount0": "1000000000000000",
            "amount1": "1699106",
            "deadline": "1660047049",
            "nonce": 0,
            "chainId": "137"
        },
        "swapFee": {
            "type": "BigNumber",
            "hex": "0x01"
        }
    }
}
```

{% endtab %}

{% tab title="400: Bad Request Error" %}

```javascript
{
    "data": null
}
```

{% endtab %}
{% endtabs %}


---

# 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.dfyn.network/dfyn-exchange-rfq-module/api-reference/trader.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.
