Skip to main content
We highly recommend using Mayan SDK for integration as it simplifies the integration process. Before performing a swap we need find the best route and get the swap rate for the token pair using quote API.

API Reference

Swagger UI

Example:

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

Request:

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:

ParameterTypeRequiredDescription
amountInNumberYes*Input amount in human-readable format (e.g. 100 for 100 USDC). Either amountIn or amountIn64 must be provided.
amountIn64StringYes*Input amount in base units (smallest denomination, e.g. 100000000 for 100 USDC). Either amountIn or amountIn64 must be provided.
fromTokenStringYesToken address on the source chain (use 0x0000000000000000000000000000000000000000 for native tokens)
fromChainStringYesSource chain name (e.g. solana, ethereum, bsc, avalanche, arbitrum, base, optimism, polygon, sui)
toTokenStringYesToken address on the destination chain
toChainStringYesDestination chain name
slippageBpsNumberYes*Maximum slippage in basis points (e.g. 300 = 3%, max 500). Either slippageBps or slippage must be provided.
slippageNumberYes*Maximum slippage as a decimal (e.g. 0.03 = 3%). Either slippageBps or slippage must be provided.
swiftBooleanNoEnable Swift routes
mctpBooleanNoEnable MCTP routes
fastMctpBooleanNoEnable Fast MCTP routes
wormholeBooleanNoEnable Wormhole Swap routes
gaslessBooleanNoEnable gasless swap mode
solanaProgramStringNoMayan Solana program address
forwarderAddressStringNoMayan Forwarder contract address
sdkVersionStringNoSDK version in major_minor_patch format (e.g. 13_1_0)
referrerStringNoReferrer Solana address that receives the referrer fee
referrerBpsNumberNoDefault is 0. The basis points the integrator earns through the referral program
gasDropNumberNoDefault is 0. Amount of native gas to deliver to the user on the destination chain
fullListBooleanNoDefault is false. Enables returning all available quote options instead of the default limited (fastest and best-return) results
destinationAddressStringNoHelps provide a more accurate quote, for example by checking whether the Solana ATA exists.
apiKeyStringNoDefines an API key that prevents the rate-limit-exceeded error on a per-IP basis.

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.
{
  "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:
FieldTypeDescription
typeStringDetermines the bridge method which can be “WH”, “SWIFT”, “MCTP” or “FAST_MCTP”
effectiveAmountInNumberThe actual input amount that will be deducted from user’s wallet
expectedAmountOutNumberExpected output amount that user receives
minAmountOutNumberMinimum output amount of auction
minReceivedNumberThe minimum amount that user receives after deducting relayer fees
priceNumberThe amount of output token that user receives per 1 unit of input token
solanaRelayerFeeNumberFor “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.
redeemRelayerFeeNumberFor “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.
RefundRelayerFeeNumberFor “WH” and “SWIFT” types this fee is denominated in input token. For “MCTP” type the fee is denominated in USDC.
clientRelayerFeeSuccessNumberTotal dollar value of relayer fees in the success scenario
clientRelayerFeeRefundNumberTotal dollar value of relayer fee in the refund scenario
etaNumberestimated time of arrival in minutes
client etaStringhuman readable string of eta
fromTokenObjectInput token details
fromChainStringSource network name
toTokenObjectOutput token details
toChainStringDestination network name

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:

Swagger UI

Example:

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 in the query .

Supported Chains

GET sia.mayan.finance/v10/init

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

Example:

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.