What you sign, and what a refund returns
A swap is three steps. Choose the token and chain you send. Choose the token and chain you receive. Sign once. Any major wallet works. The same three steps are what fetchQuote and swapFromEvm perform.
The two numbers
A quote shows an expected amount and a minimum. The swap will not execute below the minimum you sign. minAmountOut is part of the instruction. An order that cannot clear it is not filled short. It is refunded. Price impact is on the quote. A high number means the size is moving that market.
Most quotes are a range between those two numbers. Guaranteed Price removes the range on eligible routes. There is no flag to request it. Read swiftAuctionMode on the quote.
swiftAuctionMode | What arrives | What to show |
|---|---|---|
| 2 | At least minAmountOut, usually near the expected amount | Both numbers |
| 3 | Exactly expectedAmountOut | The expected amount, as a fixed figure |
Mode 3 is offered on USDC to USDC, USDT to USDT, and ETH to ETH, on any pair of supported chains. It is not offered on other same-asset pairs, and it is not offered on a cross-asset swap. A pair that returns mode 3 once can return mode 2 on the next order, so the field has to be read each time. The guarantee is the amount. The order still has a deadline, and an unfilled order is refunded rather than settled short.
Refunds
Every quote carries deadline64, the timestamp after which the order can be refunded and can no longer be filled. If no driver takes it, the input goes back to the sender. Mayan does not hold the funds either way. A refund is its own on-chain action. The quote returns refundRelayerFee and clientRelayerFeeRefund so the cost is visible before you sign. Explorer’s clientStatus for that outcome is REFUNDED, not COMPLETED.
On Swift, the input may already have been swapped into USDC or ETH before the order opened. A refund then returns that asset. The interface has to say so before the signature. A gasless Swift refund has to go back to the wallet that signed. swiftRefundAddress is rejected on a gasless quote. If the refund needs to land somewhere else, the quote has to be requested with gasless: false.
Gasless execution
Pass gasless: true and the quoter returns only routes that can be executed that way. Eligible quotes come back with gasless set. The user signs a message. A relayer submits the transaction and pays the source-chain gas. Nothing is broadcast from the user’s wallet, so there is no source transaction hash. swapFromEvm returns an order-hash string. Code that expects a transaction object has to branch on quote.gasless. Look the order up by that hash. clientStatus is INPROGRESS, COMPLETED, or REFUNDED. If a gasless request returns no quote, that pair cannot be done this way. Gas drop is a different feature: it delivers a native token on the destination so the next transaction there is possible. It does not remove the need for gas on the source.
Where an integrator starts
The SDK package is @mayanfinance/swap-sdk. Contract addresses are exported as addresses, including addresses.MAYAN_FORWARDER_CONTRACT, so a build can read them instead of copying this paper. Referrer fees are set by the integrator. The fee manager that holds them on routes which do not pay out directly is 0x54914A963c4197172130C26D496a367bD6609D88 on EVM. The widget, fee splitting, and manual transaction building use the same SDK. HyperCore deposits and withdrawals, USDC into a spot or perps balance and back out to an EVM chain, go through it as well. Deposit addresses are a permanent address per payment, from the factory at 0xfa829c5E1efc9d788280a8213cb0713be5474F7d.
Mayan