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:
List of request parameters:
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: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. The quote endpoint derives it for you inline, so there is no separate address-generation call to make.
Set destinationAddress on the request, because the address is derived from the final recipient. Without it, the response has no mpsDepositAddress.
Pass your apiKey as well. The address is created under the integrator linked to your key, and only that key can track it through the deposit address API. A quote sent without a key creates the address under Mayan’s shared default integrator instead.
The address is deterministic. It is derived from your API key, mpsUserId, the destination chain, destinationAddress and the destination token, so the same values always return the same address and changing any of them returns a different one. mpsUserId is optional. It is an integrator-scoped identity, given as a 0x-prefixed hex string whose value fits in 20 bytes (for example 0x1). When you omit it, Mayan derives one from your API key, and the value used is echoed back in mpsUserId.
A deposit address is offered only on Swift (V2) and mono-chain quotes, and only when the source chain and token are indexed for deposit addresses (see supported tokens) and the amount clears the token’s minimum. When an address is offered, the response contains only those quotes, and they all carry the same address. If neither route serves the pair, the request returns ROUTE_NOT_FOUND. If an address can’t be offered for another reason, for example because the amount is below the minimum or the cost can’t be priced, the quotes come back as usual, without an mpsDepositAddress and with nothing deducted. A missing address is not an error.
Deposit-address quotes are priced on the deposit minus Mayan’s settlement cost. This cost covers gas for the swap and, on the first deposit on each chain, the deployment of the wallet. effectiveAmountIn64 remains the full amount the payer sends. swapRelayerFee64 (in source-token base units) and swapRelayerFee show the deducted cost, and clientRelayerFeeSuccess includes it in USD. expectedAmountOut and minReceived describe what the recipient gets. The cost is estimated at quote time, and the amount charged at settlement follows the gas price at that moment. On a first native SOL deposit, the cost also includes the rent-exempt reserve that stays in the deposit address.
A quote that carries mpsDepositAddress is meant to be paid by a transfer to that address. To swap directly, request the quote without mpsDeposit.
The referrer and referrerBps (or referrers) sent with the quote are saved on the deposit address and apply to every deposit settled from it, up to 200 bps. Each new quote replaces them, so send the same referrer every time, because a quote without one removes it. Use a referrer address of the same type as the deposit address, which means a 0x… address for EVM sources and a Solana address for Solana.
The Mayan SDK (v15.2.2+) exposes this as
fetchQuote options mpsDeposit and mpsUserId, and reads it back as quote.mpsDepositAddress. If you call the API directly, send sdkVersion 15_2_2 or later, or no address is returned.mpsDepositAddress through detection, settlement, and delivery with the events stream or by polling GET /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:Swagger UI
Example:
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:
originActive: Specifies whether the chain is supported as a source chain.destinationActive: Specifies whether the chain is supported as a destination chain.
API Key:
TheapiKey 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.