> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainworks.co/llms.txt
> Use this file to discover all available pages before exploring further.

# EVM Quotes

> Fetch buy and sell quotes for token swaps on Ethereum, Base, and BNB Chain.

Get price quotes for token swaps without executing transactions.

***

## Get Buy Quote

Get a price quote for buying tokens with native currency.

**Endpoint:** `/evm/buy/quote`

| Parameter   | Type   | Required    | Description                                              |
| ----------- | ------ | ----------- | -------------------------------------------------------- |
| `chain`     | string | Yes         | Chain identifier: `eth`, `base`, or `bsc`                |
| `token`     | string | Yes         | Token contract address                                   |
| `swapMode`  | string | Yes         | `ExactIn` (specify input) or `ExactOut` (specify output) |
| `amountIn`  | string | Conditional | Amount of native currency in wei. Required for `ExactIn` |
| `amountOut` | string | Conditional | Amount of tokens to receive. Required for `ExactOut`     |
| `wallet`    | string | Yes         | Wallet address for the quote                             |

**Example:**

<Tabs>
  <Tab title="Socket.IO">
    ```typescript theme={null}
    socket.emit("/evm/buy/quote", {
      chain: "eth",
      token: "0x6982508145454Ce325dDbE47a25d4ec3d2311933",
      swapMode: "ExactIn",
      amountIn: "1000000000000000000", // 1 ETH
      wallet: "0x10a64c6d7f12c47b7c66c5b4e20e72bc1fcd5d9e",
    });
    ```
  </Tab>

  <Tab title="HTTP">
    ```typescript theme={null}
    await fetch("https://api.chainworks.co/evm/buy/quote", {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        Authorization: CHAINWORKS_API_AUTH_TOKEN,
      },
      body: JSON.stringify({
        chain: "eth",
        token: "0x6982508145454Ce325dDbE47a25d4ec3d2311933",
        swapMode: "ExactIn",
        amountIn: "1000000000000000000", // 1 ETH
        wallet: "0x10a64c6d7f12c47b7c66c5b4e20e72bc1fcd5d9e",
      }),
    });
    ```
  </Tab>
</Tabs>

**Response:**

```json theme={null}
{
  "success": true,
  "result": {
    "chain": "eth",
    "isBuy": true,
    "token": "0x6982508145454Ce325dDbE47a25d4ec3d2311933",
    "swapMode": "ExactIn",
    "price": 0.00000234,
    "priceImpact": 0.0012,
    "amountIn": "1000000000000000000",
    "expectedAmountOut": "427350427350427350427350"
  }
}
```

***

## Get Sell Quote

Get a price quote for selling tokens for native currency.

**Endpoint:** `/evm/sell/quote`

| Parameter  | Type   | Required    | Description                                      |
| ---------- | ------ | ----------- | ------------------------------------------------ |
| `chain`    | string | Yes         | Chain identifier                                 |
| `token`    | string | Yes         | Token contract address                           |
| `swapMode` | string | Yes         | `ExactIn` or `ExactOut`                          |
| `amountIn` | string | Conditional | Amount of tokens to sell. Required for `ExactIn` |
| `wallet`   | string | Yes         | Wallet address                                   |
