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

# Quote API

We highly recommend using [Mayan SDK](https://github.com/mayan-finance/swap-sdk) for integration as it simplifies the integration process.

Before performing a swap, request a quote for the token pair. The response returns the available routes and the rate for each.

### API Reference

<Card title="Swagger UI" color="#83E72E" icon="circle-s" horizontal href="https://price-api.mayan.finance/swagger" />

### Example:

The request to get the quote for swapping 100 USDC on Avalanche to receive SOL on Solana would be like this:

#### Request:

```powershell theme={null}
curl -X 'GET' 'https://price-api.mayan.finance/v3/quote?amountIn=100&fromToken=0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e&fromChain=avalanche&toToken=0x0000000000000000000000000000000000000000&toChain=solana&slippageBps=300&gasDrop=0&swift=true&mctp=true&fastMctp=true&wormhole=true&solanaProgram=FC4eXxkyrMPTjiYUpp4EAnkmwMbQyZ6NDCh1kfLn6vsf&forwarderAddress=0x337685fdaB40D39bd02028545a4FfA7D287cC3E2&sdkVersion=13_1_0'
```

#### List of request parameters:

| Parameter | Type | Required | Description |
| - | - | - | - |
| amountIn | Number | Yes\* | Input amount in human-readable format (e.g. `100` for 100 USDC). Either `amountIn` or `amountIn64` must be provided. |
| amountIn64 | String | Yes\* | Input amount in base units (smallest denomination, e.g. `100000000` for 100 USDC). Either `amountIn` or `amountIn64` must be provided. |
| fromToken | String | Yes | Token address on the source chain (use `0x0000000000000000000000000000000000000000` for native tokens) |
| fromChain | String | Yes | Source chain name (e.g. `solana`, `ethereum`, `bsc`, `avalanche`, `arbitrum`, `base`, `optimism`, `polygon`, `sui`) |
| toToken | String | Yes | Token address on the destination chain |
| toChain | String | Yes | Destination chain name |
| slippageBps | Number | Yes\* | Maximum slippage in basis points (e.g. `300` = 3%, max `500`). Either `slippageBps` or `slippage` must be provided. |
| slippage | Number | Yes\* | Maximum slippage as a decimal (e.g. `0.03` = 3%). Either `slippageBps` or `slippage` must be provided. |
| swift | Boolean | No | Enable [Swift](/architecture/swift) routes |
| mctp | Boolean | No | Enable [MCTP](/architecture/mctp) routes |
| fastMctp | Boolean | No | Enable Fast MCTP routes |
| wormhole | Boolean | No | Enable [Wormhole Swap](/architecture/wh-swap) routes |
| gasless | Boolean | No | Enable gasless swap mode |
| solanaProgram | String | No | Mayan Solana program address |
| forwarderAddress | String | No | Mayan Forwarder contract address |
| sdkVersion | String | No | SDK version in `major_minor_patch` format (e.g. `13_1_0`) |
| referrer | String | No | Referrer Solana address that receives the referrer fee |
| referrerBps | Number | No | Default is 0. The basis points the integrator earns through the referral program |
| gasDrop | Number | No | Default is 0. Amount of native gas to deliver to the user on the destination chain |
| fullList | Boolean | No | Default is `false`. Enables returning all available quote options instead of the default limited (fastest and best-return) results |
| destinationAddress | String | No | Helps provide a more accurate quote, for example by checking whether the Solana ATA exists. |
| apiKey | String | No | Defines an API key that prevents the **rate-limit-exceeded** error on a per-IP basis. |
| mpsDeposit | Boolean | No | Default is `false`. When `true`, attaches a [deposit address](#deposit-address-mpsdeposit) (`mpsDepositAddress`) to each eligible quote so a payer can fund the swap with a plain transfer instead of signing a transaction. Requires `destinationAddress`. See [deposit address](#deposit-address-mpsdeposit). |
| mpsUserId | String | No | Integrator-scoped identity that keys the deposit address: a `0x`-prefixed hex string whose value fits in 20 bytes. Only used when `mpsDeposit` is `true`; when omitted it is derived from your `apiKey`. |

#### Response:

> The quote service returns an array of quotes. By default, it includes at most two items: the first is the fastest option, and the second is the best-return quote. If the fastest option also provides the best return, only one quote is returned.
>
> It is possible to set the `fullList` request parameter to `true` to retrieve all available quote options. In this case, more than two items may be returned, and no sorting is applied. Interfaces can apply their own sorting logic by considering the `etaSeconds` and `expectedAmountOut` fields in each item.

```json theme={null}
{
  "quotes": [
    {
      "meta": {
        "advertisedDescription": "Cheapest and Fastest",
        "advertisedTitle": "Best",
        "icon": "https://cdn.mayan.finance/fast_icon.png",
        "switchText": "Switch to the best route",
        "title": "Best"
      },
      "sendTransactionCost": 0,
      "gasless": false,
      "slippageBps": 300,
      "effectiveAmountIn": 100,
      "effectiveAmountIn64": "100000000",
      "expectedAmountOut": 1.201839546,
      "price": 0.01201963167985677,
      "minAmountOut": 1.16578436,
      "minReceived": 1.16578436,
      "solanaRelayerFee": null,
      "solanaRelayerFee64": null,
      "redeemRelayerFee": null,
      "redeemRelayerFee64": null,
      "refundRelayerFee": null,
      "refundRelayerFee64": "711",
      "cancelRelayerFee64": "9147",
      "submitRelayerFee64": "0",
      "clientRelayerFeeSuccess": null,
      "clientRelayerFeeRefund": 0.00902389942474755,
      "deadline64": "1774621897",
      "fromToken": {
        "name": "USD Coin",
        "symbol": "USDC",
        "mint": "FHfba3ov5P3RjaiLVgh8FTv4oirxQDoVXuoUUDvHuXax",
        "contract": "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e",
        "chainId": 43114,
        "wChainId": 6,
        "decimals": 6,
        "logoURI": "https://assets.coingecko.com/coins/images/6319/small/USD_Coin_icon.png?1547042389",
        "coingeckoId": "usd-coin",
        "realOriginContractAddress": "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e",
        "realOriginChainId": 6,
        "supportsPermit": true
      },
      "fromChain": "avalanche",
      "toToken": {
        "name": "SOL",
        "symbol": "SOL",
        "mint": "So11111111111111111111111111111111111111112",
        "contract": "0x0000000000000000000000000000000000000000",
        "chainId": 0,
        "wChainId": 1,
        "decimals": 9,
        "logoURI": "https://statics.mayan.finance/SOL.png",
        "wrappedAddress": "So11111111111111111111111111111111111111112",
        "coingeckoId": "solana",
        "realOriginContractAddress": "So11111111111111111111111111111111111111112",
        "realOriginChainId": 1,
        "supportsPermit": false
      },
      "toChain": "solana",
      "gasDrop": 0,
      "eta": 1,
      "etaSeconds": 3,
      "clientEta": "3s",
      "bridgeFee": 0,
      "suggestedPriorityFee": 0,
      "type": "SWIFT",
      "priceStat": {
        "ratio": 0.9996,
        "status": "GOOD"
      },
      "referrerBps": 0,
      "protocolBps": 3,
      "onlyBridging": false,
      "minMiddleAmount": 100,
      "sourceSwapExpense": 0,
      "swiftVersion": "V2",
      "swiftMayanContract": "0x40fFE85A28DC9993541449464d7529a922142960",
      "swiftAuctionMode": 2
    }
  ],
  "minimumSdkVersion": [
    7,
    0,
    0
  ]
}
```

### Response fields:

The following table shows the common fields of response:

| Field | Type | Description |
| - | - | - |
| type | String | Determines the bridge method which can be "WH", "SWIFT", "MCTP" or "FAST\_MCTP" |
| effectiveAmountIn | Number | The actual input amount that will be deducted from user's wallet |
| expectedAmountOut | Number | Expected output amount that user receives |
| minAmountOut | Number | Minimum output amount |
| minReceived | Number | The minimum amount that user receives after deducting relayer fees |
| price | Number | The amount of output token that user receives per 1 unit of input token |
| solanaRelayerFee | Number | For "WH" type this fee is denominated in input token. For "MCTP" type the fee is denominated in USDC. For "SWIFT" type the fee is zero. |
| redeemRelayerFee | Number | For "WH" type this fee is denominated in output token. For "MCTP" type the fee is denominated in USDC. For "SWIFT" type the fee is zero. |
| RefundRelayerFee | Number | For "WH" and "SWIFT" types this fee is denominated in input token. For "MCTP" type the fee is denominated in USDC. |
| clientRelayerFeeSuccess | Number | Total dollar value of relayer fees in the success scenario |
| clientRelayerFeeRefund | Number | Total dollar value of relayer fee in the refund scenario |
| eta | Number | estimated time of arrival in minutes |
| client eta | String | human readable string of eta |
| fromToken | Object | Input token details |
| fromChain | String | Source network name |
| toToken | Object | Output token details |
| toChain | String | Destination network name |
| mpsDepositAddress | String | Returned when `mpsDeposit` was requested and the quote is eligible: a deterministic deposit address on the **source** chain (`null` otherwise). Sending the input token to it settles the swap via [deposit addresses](/features/deposit-addresses), no signature required. See [deposit address](#deposit-address-mpsdeposit). |
| mpsIntegratorId | String | The integrator the deposit address was minted under, keyed to your API key. `null` unless `mpsDepositAddress` is set. |
| mpsUserId | String | Echoes the integrator-scoped `mpsUserId` used to derive the address (the value you sent, or the one derived from your API key). `null` unless `mpsDepositAddress` is set. |
| swiftAuctionMode | Number | Swift quotes only. Settlement mode of the order (see note below). |

<Tip>
  **Settlement modes** (Swift quotes only, `type = "SWIFT"`)

  * `2`: The user receives at least `minAmountOut`, typically around `expectedAmountOut` and possibly higher or lower.
  * `3`: Exact-out. The user is guaranteed to receive exactly `expectedAmountOut`.
</Tip>

### Deposit address (`mpsDeposit`)

Pass `mpsDeposit: true` to make a quote **fundable by a plain transfer**. On eligible quotes the response carries an `mpsDepositAddress`, a deterministic address on the *source* chain, plus `mpsIntegratorId` and `mpsUserId`. When the payer simply sends the input token to that address, Mayan detects the deposit and settles the swap to `destinationAddress` on the destination chain, with **no transaction to sign** and no SDK swap call. This is the recommended way to obtain a [deposit address](/features/deposit-addresses). The quote endpoint derives it for you inline, so there is no separate address-generation call to make.

Requirements and behavior:

* **`destinationAddress` is required.** Without it `mpsDepositAddress` is `null` (the address is keyed to the final recipient).
* **Deposit addresses must be enabled for your API key.** The address is minted under your integrator identity, so pass your `apiKey`; without an enabled key the field comes back `null`. Contact [support@mayan.finance](mailto:support@mayan.finance) to enable it.
* **`mpsUserId` is optional.** It's an integrator-scoped identity (a `0x`-prefixed hex string whose value fits in 20 bytes, e.g. `0x1`); the same id always yields the same deposit address. When omitted, it is derived from your `apiKey`, so deposits still bucket by caller. The value used is echoed back as `mpsUserId`.
* **Only eligible quotes get an address.** Mayan attaches it to Swift, mono-chain, and *direct* (no source swap) Fast MCTP quotes whose source chain and token are indexed for deposit addresses (see [supported tokens](/payment-service/api-reference#source-config)), and only when the amount clears the token's minimum. Other quotes in the same response return `mpsDepositAddress: null`.
* **Best-effort.** If the address can't be derived for any reason, the quote is still returned with `mpsDepositAddress: null`. Never treat a `null` as an error.

<Note>
  The [Mayan SDK](https://github.com/mayan-finance/swap-sdk) (v15+) exposes this as `fetchQuote` options `mpsDeposit` and `mpsUserId`, and reads it back as `quote.mpsDepositAddress`. Passing `mpsDeposit` forces the SDK's POST-body request path.
</Note>

Track a deposit made to an `mpsDepositAddress` through detection, settlement, and delivery with the [events stream](/payment-service/events) or by polling [`GET /swaps`](/payment-service/api-reference#list-swaps).

### **Supported Tokens**

Mayan is an intent-based protocol and supports any token as input or output, provided there is sufficient liquidity on the source or destination chains. We also maintain an approved, whitelisted token list for convenience:

<Card title="Swagger UI" color="#83E72E" icon="circle-s" horizontal href="https://price-api.mayan.finance/swagger/#/default/TokensController_getTokens" />

#### Example:

```powershell theme={null}
curl -X 'GET' \
  'https://price-api.mayan.finance/v3/tokens?chain=solana' \
  -H 'accept: application/json'
```

To get the aggregated list of tokens from all chains remove `chain` from the query.

### Supported Chains

#### `GET` `sia.mayan.finance/v10/init`

Returns configuration for every supported chain, including whether it can be used as an origin or destination chain.

#### Example:

```powershell theme={null}
curl -X 'GET' \
  'https://sia.mayan.finance/v10/init' \
  -H 'accept: application/json'
```

This endpoint provides a JSON response containing a comprehensive list of all chains supported by the platform. Each chain entry includes detailed metadata such as the chain's name, chain ID, and other relevant attributes.

Two key fields indicate the chain's functionality within the platform:

* `originActive`: Specifies whether the chain is supported as a source chain.
* `destinationActive`: Specifies whether the chain is supported as a destination chain.

Use this endpoint to determine compatibility and availability of specific chains for your operations.

### API Key:

The `apiKey` parameter is optional. If you are using the Mayan SDK on a frontend and your request volume is low or comes from multiple origins, you can omit the `apiKey` to use the public endpoint. We recommend starting without an API key and only requesting one if you hit rate limits. To obtain an API key, email [**support@mayan.finance**](mailto:support@mayan.finance).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.