← Protocols
Mayan Finance
Cross-chain / Bridge·EVM · Solana · Sui · Aptos · Multi-chain

Mayan Finance

01Description

Cross-chain swap protocol with Solana at the hub. Routes any-to-any swaps across EVM, Solana, Sui, Aptos, and HyperEVM via three engines: Swift (intent/auction-based, fastest), MCTP (CCTP-backed for native USDC), and Wormhole Swap (legacy any-asset).

02Best for
  • 01EVM <-> Solana swaps
  • 02intent-based fills with auctions
  • 03native USDC routing via CCTP (MCTP)
  • 04Sui / Aptos / HyperEVM cross-chain swaps
  • 05embedded cross-chain widgets
03Install
  • pnpm add @mayanfinance/swap-sdk viem
04Environment variables
VariableScopeDescription
MAYAN_REFERRER_ADDRESSClientOptional referrer address that earns a share of swap fees. Pass as `referrerAddresses` in `fetchQuote` / `swapFromEvm` / `swapFromSolana`.
05Prompt snippet
Use `@mayanfinance/swap-sdk`. Call `fetchQuote({ amount, fromToken, toToken, fromChain, toChain, slippageBps, gasDrop, referrer })` — the response contains an array of routes, one per engine (`SWIFT`, `MCTP`, `WH`). Pick a quote and execute with `swapFromEvm({ quote, swapperAddress, destinationAddress, referrerAddresses, signer, permit })` for EVM origins or `swapFromSolana({ quote, swapperWalletAddress, destinationAddress, referrerAddresses, signTransaction, connection })` for Solana origins. Track status via the Mayan Explorer API at `https://explorer-api.mayan.finance/v3/swap/trx/{sourceTxHash}` until `clientStatus === 'COMPLETED'`. For permit-style EVM swaps use `getSwapFromEvmTxPayload` to build the calldata manually and submit through your own wallet.
06Gotchas
  • Three engines have different trade-offs: Swift is auction-based and can fail if no solver bids (handle `SWIFT_NO_BID` and fall back to MCTP/WH); MCTP is gated to USDC pairs via CCTP and inherits CCTP's ~15-min finality on Ethereum; WH (Wormhole) is the broadest but slowest.
  • Quotes have a short TTL (~30s) — re-quote before signing. The `deadline` baked into Swift orders also expires, after which solvers will not fill and the user must reclaim funds.
  • Solana origins require an associated-token-account (ATA) for the input mint and SOL for rent + tx fees; the SDK does not auto-fund or auto-create remote-chain ATAs on the destination — pre-flight or pass `gasDrop` to seed the destination wallet.
  • Refund path on a failed Swift order is a separate `refund` tx the user must trigger after the deadline — surface this in the UI rather than letting funds sit.
  • `amount` is a decimal number (not raw base units) in the SDK — different from most bridges. Mixing units is the most common integration bug.
  • HyperEVM / HyperCore has its own permit flow (`getHyperCoreUSDCDepositPermitParams`); do not assume the standard EVM `swapFromEvm` path works for Hyperliquid deposits.
07Alternatives