A direct route link opens swap.mayan.finance with the route already filled in. The user lands on the page with the source token, the destination token, and both chains selected, and only has to enter an amount and confirm.
Use it in campaign links, wallet integrations, token pages, or anywhere you want to send someone to one specific route.
There are two parameters:
default_from sets the chain and token the swap starts from.
default_to sets the chain and token the swap ends on.
Each value is the chain name, a hyphen, then the token’s contract address on that chain. Native tokens on EVM chains use the zero address.
Example
ETH on Ethereum to USDC on Solana:
Partial links
Both parameters are optional. Include only the one you need.
Destination only, so the user chooses what they are sending:
Source only, so the user chooses what they receive:
Common token values
Any token Mayan supports works, not only the ones above. Use the token’s contract address on its chain:
An older link format used source_chains, from_tokens, dest_chains, and to_tokens. Those parameters lock the route, so the user cannot change the fields. For campaign links, use default_from and default_to instead. They prefill the same fields and leave them editable.