Comment on page
Quote API
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:
curl 'https://price-api.mayan.finance/v3/quote?amountIn=5&fromToken=0x0000000000000000000000000000000000000000&fromChain=bsc&toToken=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&toChain=solana&slippage=0.05&gasDrop=0.001'
{
"effectiveAmountIn":4.99957634,
"expectedAmountOut":1478.182,
"price":295.6,
"priceImpact":0,
"minAmountOut":1404.2729,
"route":[
{
"protocol":"Serum",
"fromToken":"9gP2kCy3wA1ctvYWQk75guqXuHfrEomqydHLtcTCqiLa",
"fromSymbol":"WBNB",
"toToken":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"toSymbol":"USDC",
"address":"4UPUurKveNEJgBqJzqHPyi8DhedvpYsMXi7d43CjAg2f"
}
],
"swapRelayerFee":0.00057634,
"redeemRelayerFee":0,
"refundRelayerFee":0.00115
}
You can get list of supported tokens using Token API:
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 .To get the list of supported chains you can use Chain API:
curl -X 'GET' \
'https://price-api.mayan.finance/v3/chains' \
-H 'accept: application/json'
Last modified 6mo ago