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

# API Endpoints

> Introduction to the HyperBloom API

The `/swap/v1/price` endpoint in the HyperBloom protocol is designed to provide an indicative price for a transaction. Unlike the `/swap/v1/quote` endpoint, it does not return a transaction executable on an Ethereum node but rather offers pricing information that would be available for a similar call to `/swap/v1/quote`. This endpoint is particularly useful for Request for Quote (RFQ) scenarios.

### Request Schema

The request schema for `/swap/v1/price` mirrors that of `/swap/v1/quote`, with specific exceptions applicable across all supported chains:

#### Query Parameters

| Query Param                  | Description                                                                                                                                                                         |
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sellToken`                  | The ERC20 token address of the token you wish to sell. Always use the token address instead of symbols (e.g., ETH) to ensure API recognition.                                       |
| `buyToken`                   | The ERC20 token address of the token you wish to receive. Always use the token address instead of symbols (e.g., ETH) to ensure API recognition.                                    |
| `sellAmount`                 | (Optional) The amount of `sellToken` (in base units) you intend to send.                                                                                                            |
| `slippagePercentage`         | (Optional, default is 0.01) Maximum acceptable slippage for `buyToken` if `sellAmount` is provided, or for `sellAmount` if `buyAmount` is provided. Default is 1% if not specified. |
| `takerAddress`               | (Optional) Address that will fill the quote. Recommended for accurate gas estimation and transaction validation.                                                                    |
| `excludedSources`            | (Optional) Specifies liquidity sources to exclude (e.g., Uniswap, SushiSwap). Cannot be combined with `includedSources`.                                                            |
| `includedSources`            | (Optional) Specifies liquidity sources to include. Cannot be combined with `excludedSources`.                                                                                       |
| `integratorPercentageFee`    | (Optional) Fees to be charged. Example: 1% → `0.01`, 0.1% → `0.001`, 0.025% → `0.00025`                                                                                             |
| `integratorRecipientAddress` | (Optional) HyperEVM address to receive fees specified with `integratorPercentageFee`. Both `integratorPercentageFee` and `integratorRecipientAddress` are required together.        |

{/* | `buyAmount`                  | (Optional) The amount of `buyToken` (in base units) you wish to receive. Either `sellAmount` or `buyAmount` must be included. Note: Some on-chain sources do not support `buyAmount`, excluding them if used.| */}

{/* | `skipValidation`             | (Optional) Skips quote validation when set to `true`. Default for `/quote` is `false`, but can be overridden.                                                                                               | */}

### Response Schema

The response schema for `/swap/v1/price` is identical to `/swap/v1/quote`, except the `guaranteedPrice`, `to`, and `data` fields are always undefined.

#### Response Fields

| Field                  | Description                                                                                                                                             |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `price`                | Provides the price of `buyToken` in `sellToken` and vice versa, excluding slippage. Includes fee if `buyTokenPercentageFee` and `feeRecipient` are set. |
| `estimatedPriceImpact` | Estimated change in asset price due to swap execution. Returns `null` if estimation fails.                                                              |
| `value`                | Ether amount (in wei) to be sent with the transaction.                                                                                                  |
| `gasPrice`             | Gas price (in wei) for transaction submission. Must be equal to or lower than this value for success.                                                   |
| `gas`                  | Estimated gas limit for transaction settlement. Accurate estimate requires `takerAddress`.                                                              |
| `estimatedGas`         | Estimated actual gas usage, always less than `gas`.                                                                                                     |
| `protocolFee`          | Maximum ether amount for protocol fee (in wei).                                                                                                         |
| `minimumProtocolFee`   | Minimum ether amount for protocol fee (in wei).                                                                                                         |
| `buyAmount`            | Amount of `buyToken` to be acquired. Excludes sources not supporting `buyAmount`.                                                                       |
| `sellAmount`           | Amount of `sellToken` to be sold. Recommended for comprehensive on-chain source coverage.                                                               |
| `sources`              | Distribution of `buyAmount` or `sellAmount` across liquidity sources.                                                                                   |
| `buyTokenAddress`      | ERC20 token address for `buyToken`.                                                                                                                     |
| `sellTokenAddress`     | ERC20 token address for `sellToken`.                                                                                                                    |
| `allowanceTarget`      | Contract address requiring allowance for swap completion. Null address for "ETH" swaps.                                                                 |
| `sellTokenToEthRate`   | Exchange rate between ETH and `sellToken`.                                                                                                              |
| `buyTokenToEthRate`    | Exchange rate between ETH and `buyToken`.                                                                                                               |

{/* | `grossPrice`               | Similar to `price` but excludes fees.                                                                                                                                                                        | */}

{/* | `grossSellAmount`          | Similar to `sellAmount` but excludes fees.                                                                                                                                                                  | */}

### Example

**Get Price for Selling WETH to Buy feUSD**

To obtain a simple quote for exchanging 1 HYPE for feUSD, specify the `sellToken`, `buyToken`, and `sellAmount`.

**Request**

```bash theme={null}
curl https://api.hyperbloom.xyz/swap/v1/price?sellToken=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee&buyToken=0x02c6a2fa58cc01a18b8d9e00ea48d65e4df26c70&sellAmount=1000000000000000000   --header 'api-key: <API_KEY>'
```

**Response**

```json theme={null}
{
    "chainId": 999,
    "price": "36.749874001264005",
    "estimatedPriceImpact": "0",
    "value": "600000000000000000",
    "gasPrice": "47500000",
    "gas": "389135",
    "estimatedGas": "389135",
    "protocolFee": "0",
    "minimumProtocolFee": "0",
    "buyTokenAddress": "0x02c6a2fa58cc01a18b8d9e00ea48d65e4df26c70",
    "buyAmount": "22049924400758403000",
    "sellTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
    "sellAmount": "600000000000000000",
    "sources": [],
    "orders": [],
    "allowanceTarget": "0x0000000000000000000000000000000000000000",
    "sellTokenToEthRate": "1",
    "buyTokenToEthRate": "35.297931189190104285",
    "expectedSlippage": null
}
```
