Quote API
Last updated
Last updated
We highly recommand using Mayan SDK for integration as it simplfies the process for you.
Before performing a swap we need find the best route and get the swap rate for the token pair using quote API.
The request to get the quote for swapping BNB tokens from Binance Smart Chain (BSC) to receive USDC tokens on Solana would be like this:
amountIn
Number
Yes
Human readable amount of input token (e.g for 100 USDC it should be 100)
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
gasDrop
Number
No
Default is 0. the amount of gas drop that must be delivered to user on delivered on destination network
The following table shows the common fields of response:
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
You can get list of supported tokens using Token API:
To get the aggregated list of tokens from all chains remove chain
from in the query .
To get the list of supported chains you can use Chain API:
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.