> ## 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.

# SVM Quotes

> Fetch buy and sell quotes for Solana token swaps without executing a transaction.

Get price quotes for token swaps without executing transactions.

## Get Buy Quote

Get a price quote for buying tokens with SOL.

**Endpoint:** `/svm/buy/quote`

| Parameter   | Type   | Required    | Description                                                                                                                 |
| ----------- | ------ | ----------- | --------------------------------------------------------------------------------------------------------------------------- |
| `chain`     | string | Yes         | Always `sol`                                                                                                                |
| `token`     | string | Yes         | Token mint address                                                                                                          |
| `swapMode`  | string | Yes         | `ExactIn` or `ExactOut`                                                                                                     |
| `amountIn`  | string | Conditional | Amount of SOL in lamports. Required for `ExactIn`                                                                           |
| `amountOut` | string | Conditional | Amount of tokens. Required for `ExactOut`                                                                                   |
| `wallet`    | string | Yes         | Wallet public key                                                                                                           |
| `pool`      | string | No          | When supplied, this parameter restricts quoting to the specified pool, subject to liquidity and compatibility requirements. |

**Example:**

<Tabs>
  <Tab title="Socket.IO">
    ```typescript theme={null}
    socket.emit("/svm/buy/quote", {
      chain: "sol",
      token: "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263", // BONK
      swapMode: "ExactIn",
      amountIn: "1000000000", // 1 SOL in lamports
      wallet: "YourSolanaWalletPublicKey",
      pool: "PoolAddress", // Optional: specific pool address
    });
    ```
  </Tab>

  <Tab title="HTTP">
    ```typescript theme={null}
    await fetch("https://api.chainworks.co/svm/buy/quote", {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        Authorization: CHAINWORKS_API_AUTH_TOKEN,
      },
      body: JSON.stringify({
        chain: "sol",
        token: "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263", // BONK
        swapMode: "ExactIn",
        amountIn: "1000000000", // 1 SOL in lamports
        wallet: "YourSolanaWalletPublicKey",
        pool: "PoolAddress", // Optional: specific pool address
      }),
    });
    ```
  </Tab>
</Tabs>

**Response:**

```json theme={null}
{
  "success": true,
  "result": {
    "chain": "sol",
    "isBuy": true,
    "token": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
    "swapMode": "ExactIn",
    "dex": "RaydiumV4",
    "price": 0.00000156,
    "priceImpact": 0.0008,
    "amountIn": "1000000000",
    "expectedAmountOut": "641025641025641"
  }
}
```

## Get Sell Quote

Get a price quote for selling tokens for SOL.

**Endpoint:** `/svm/sell/quote`

| Parameter  | Type   | Required    | Description                                                                                                                 |
| ---------- | ------ | ----------- | --------------------------------------------------------------------------------------------------------------------------- |
| `chain`    | string | Yes         | Always `sol`                                                                                                                |
| `token`    | string | Yes         | Token mint address                                                                                                          |
| `swapMode` | string | Yes         | `ExactIn` or `ExactOut`                                                                                                     |
| `amountIn` | string | Conditional | Amount of tokens. Required for `ExactIn`                                                                                    |
| `wallet`   | string | Yes         | Wallet public key                                                                                                           |
| `pool`     | string | No          | When supplied, this parameter restricts quoting to the specified pool, subject to liquidity and compatibility requirements. |
