How it works
1
Request a gasless quote
Pass
gasless: true on the quote request. The quoter returns only routes that can be executed this way.2
Check the response
Eligible quotes come back with
gasless set. Surface it before the user commits, because what they are about to approve is a signature rather than a transaction.3
The user signs a message
No native token is spent and nothing is broadcast from their wallet.
4
A relayer submits it
Mayan’s relayer puts the order onchain. From here the swap proceeds exactly like any other.
5
Track it by order hash
Because no transaction was sent from the user’s wallet, there is no source transaction hash.
swapFromEvm returns an order hash string instead, which the Explorer API accepts in its place.Key concepts
- A signature, not a transaction. The user signs, and a Mayan relayer submits the transaction and pays the gas.
- The return value changes. On a normal quote
swapFromEvmreturns a transaction. On a gasless quote it returns an order hash string. Code that assumes a transaction object will break, so branch onquote.gasless. - Not every route supports it. Requesting
gasless: truenarrows the routes the quoter will return. If nothing comes back for a pair, that pair cannot be executed gaslessly. - Refunds go back to the signer. A gasless Swift order requires the refund address to match the wallet that signed.
swiftRefundAddressis rejected on a gasless quote, so requestgasless: falseif you need a refund to land somewhere else. See executing swaps.
Requesting it
Tracking a gasless swap
Where it is used
First-time users. Someone arriving in an ecosystem for the first time holds one asset and no gas. Gasless removes the step where they have to go acquire the native token before they can do anything. Withdrawals. A user leaving an app should not need to top up gas on the chain they are leaving in order to leave it. Consumer flows. Any interface where you would rather not explain gas at all.Next steps
Executing Swaps
The swap call on EVM, Solana and Sui.
Track Transactions
Follow a swap, or a gasless order, to a terminal status.
Quote API
Every quote parameter, including
gasless.