We highly recommand using Mayan SDK for integration as it simplfies 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.Documentation Index
Fetch the complete documentation index at: https://mayan-fix-swift-v2-fees.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
API Reference
Swagger UI
Example:
The request to get the quote for swapping BNB tokens from BNB Smart Chain (BSC) to receive USDC tokens on Solana would be like this:Request:
List of request parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| solanaProgram | String | Yes | Mayan Wormhole Swap program address |
| amountIn64 | String | Yes | is the token amount encoded in base units (smallest denomination), 1000000 USDC equals 1 USDC |
| fromToken | String | Yes | Token address of input token |
| fromChain | String | Yes | Wormhole chain ID of source network |
| toToken | String | Yes | Token address of output Token |
| toChain | String | Yes | Wormhole chain ID of destination network |
| slippageBps | Number | Yes | Maximum slippage in bps, If the output token amount exceeds the slippage the swap will refund, (Max=100) |
| referrer | String | No | Referrer address that receives the referrer fee |
| referrerBps | Number | No | Default is 0, The expected basis points the integrator intends to earn through the referral program |
| gasDrop | Number | No | Default is 0. the amount of gas drop that must be delivered to user on delivered on destination network |
| 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 | Defined an API 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 thefullListrequest parameter totrueto 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 theetaSecondsandexpectedAmountOutfields in each item.
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” or “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 of auction |
| 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 |
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:
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:
originActive: Specifies whether the chain is supported as a source chain.destinationActive: Specifies whether the chain is supported as a destination chain.