# Quote v2

This endpoint facilitates the creation of a potential quote for executing a swap between two assets. It allows users to obtain pricing information and other essential details necessary to initiate asset swaps within the system. Use this endpoint to explore the potential cost and feasibility of asset exchanges before finalizing transactions.

### URL

```url
https://blade-api.sushi.com/rfq/v2/quote/{CHAIN_ID}
```

## Request

| Path Param | Description                                  | Example       |
| ---------- | -------------------------------------------- | ------------- |
| chain      | <p>Integer - Required<br>ID of the chain</p> | chain\_id=137 |

<table><thead><tr><th width="210.33333333333331">Query Param</th><th width="328">Description</th><th>Example</th></tr></thead><tbody><tr><td>pool_address</td><td>str - Optional<br>Address of the pool. If not present, the best pool will be calculated</td><td>pool_address=0x655eDCE464CC797526600a462A8154650EEe4B77</td></tr><tr><td>time_in_seconds</td><td>Integer - Optional<br>Amount of time between accepting a quote and receiving the quote on the blockchain. As this value increases, the quote will get worse for the user.</td><td>time_in_seconds=30</td></tr><tr><td>output_amount</td><td>Integer/String - Optional<br>Desired quantity of assets to receive as part of the swap<br>This field is mutually exclusive with <mark style="color:orange;"><code>input_amount</code></mark></td><td>output_amount=18000</td></tr><tr><td>input_amount</td><td>Integer/String - Optional<br>Desired quantity of assets you are willing to exchange<br>This field is mutually exclusive with <mark style="color:orange;"><code>output_amount</code></mark></td><td><br>input_amount=18000</td></tr><tr><td>input_asset_symbol</td><td>String - Required<br>Identifier of the asset you want to provide for the swap<br>Should correspond to the asset name returned from the <a href="broken-reference">pool</a> call</td><td>input_asset_symbol=ETH</td></tr><tr><td>output_asset_symbol</td><td>String - Required<br>Identifier of the asset you want to receive in the swap<br>Should correspond to the asset name returned from the <a href="broken-reference">pool</a> call</td><td>output_asset_symbol=DAI</td></tr></tbody></table>

## Response

Quote object

<table><thead><tr><th width="244">Field</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>String(UUID) - Id of the quote, use this value when signing a quote</td></tr><tr><td>must_accept_by</td><td>String - Human-readable UTC timestamp by which you must accept the quote and should be expected to be a short duration. If this time has passed already, request a new quote - the server will not sign a quote after <mark style="color:orange;"><code>must_accept_by</code></mark> has passed</td></tr><tr><td>good_until</td><td>Integer - number of seconds that quotes live</td></tr><tr><td>chain_id</td><td>Integer - Represents the ID of the chain</td></tr><tr><td>input_asset_address</td><td>String - Contract address of the asset you want to provide for the swap</td></tr><tr><td>input_amount</td><td>String - Amount of assets to be exchanged</td></tr><tr><td>output_asset_address</td><td>String - Contract address of the asset you want to receive in the swap</td></tr><tr><td>output_amount</td><td>String - Amount of assets you will receive in the exchange</td></tr><tr><td>input_value_in_usd</td><td>Float - Amount in dollars to be exchanged</td></tr><tr><td>output_value_in_usd</td><td>Float - Amount in dollars you will receive in the exchange</td></tr><tr><td>created_at</td><td>Integer - Unix Timestamp indicating the date and time when the quote was created</td></tr><tr><td>rate</td><td>Float - swap rate</td></tr></tbody></table>

## Examples

If you want to create a quote to make a swap from ETH to USDC in Ethereum Mainnet (chain\_id=1)

***Request***

```bash
curl -X GET "https://blade-api.sushi.com/rfq/v2/quote/1?pool_address=0x655eDCE464CC797526600a462A8154650EEe4B77&time_in_seconds=60&output_asset_symbol=USDC&input_asset_symbol=ETH&input_amount=10000000000000000000" \
-H "x-api-key: mQzA8Uy6nZ8Vyh" \
-H "Content-Type: application/json"
```

***Response***

```json
{
    "id": "05a51aa6-41b5-4c61-a452-f1b95d0d43e4",
    "must_accept_by": "2023-10-13 22:24:20.932560+00:00",
    "good_until": 1697235920,
    "chain_id": 1,
    "input_amount": "10000000000000000000",
    "output_amount": "5661947917",
    "input_value_in_usd": 15595.15,
    "output_value_in_usd": 5668.12,
    "created_at": 1697235848,
    "rate": 566.1947917,
    "input_asset_address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "output_asset_address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
}
```
