> For the complete documentation index, see [llms.txt](https://docs.eldorito.club/dkit-by-eldorito/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eldorito.club/dkit-by-eldorito/dkit-api/quote-request-a-trade-quote.md).

# /quote - Request a trade quote

### Endpoint <a href="#endpoint" id="endpoint"></a>

**Method:** `POST` \
**URL:** `https://crunchy.dorito.club/api/quote`

### Request parameters

```
{
  "sellAsset": "string",
  "buyAsset": "string",
  "sellAmount": "string",
  "providers": [
    "string"
  ],
  "sourceAddress": "string",
  "destinationAddress": "string",
  "slippage": 100,
  "affiliate": "string",
  "affiliateFee": 88,
  "includeTx": true
}
```

Here's a detailed description of the different parameters:

| Parameter            | Type      | Required | Description                                            |
| -------------------- | --------- | -------- | ------------------------------------------------------ |
| `sellAsset`          | `string`  | ✅ Yes    | The asset being sold (e.g. `"ETH.ETH"`).               |
| `buyAsset`           | `string`  | ✅ Yes    | The asset being bought (e.g. `"BTC.BTC"`).             |
| `sellAmount`         | `string`  | ✅ Yes    | Amount in basic units (decimals separated with a dot). |
| `providers`          | `array`   | ❌ No     | Limits the possible liquidity providers.               |
| `sourceAddress`      | `string`  | ✅ Yes    | Address of the sender.                                 |
| `destinationAddress` | `string`  | ✅ Yes    | Address of the recipient.                              |
| `slippage`           | `number`  | ❌ No     | Max slippage in percentage (5 = 5%).                   |
| `affiliate`          | `string`  | ❌ No     | Affiliate address for revenue sharing.                 |
| `affiliateFee`       | `number`  | ❌ No     | Fee percentage in basis points (50= 0.5%).             |
| `includeTx`          | `boolean` | ❌ No     | Include transaction details in the response.           |

**Note:** Asset names for `sellAsset` and `buyAsset` should follow the following nomenclature:

* Chain.Ticker (e.g., `"BTC.BTC"` or `"ARB.ETH"`)
* Chain.Ticker-ContractAddress (e.g., `"ETH.USDC-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"`)

This is the `identifier`as provided in the [`/tokens`](/dkit-by-eldorito/dkit-api/tokens-request-supported-tokens-by-a-swap-provider.md) endpoint.

### Example request <a href="#example-request" id="example-request"></a>

A simple request to trade `ETH.ETH`to `BTC.BTC`may omit the `providers`list if you can manage them in the response, but should include the amount, the involved addresses and slippage settings.

The expiration time returned by the endpoint is an estimation. We recommend requesting a new quote at least every minute if the trade has not been executed yet.

{% tabs %}
{% tab title="cURL" %}

```
curl -X POST "https://crunchy.dorito.club/api/quote" \
  -H "Content-Type: application/json" \
  -d '{
    "sellAsset": "ETH.ETH",
    "buyAsset": "BTC.BTC",
    "sellAmount": "0.1",
    "sourceAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
    "destinationAddress": "357a3So9CbsNfBBgFYACGvxxS6tMaDoa1P",
    "slippage": 10,
    "includeTx": true
  }'
```

{% endtab %}
{% endtabs %}
