Skip to main content
These are full, copy-paste examples: get a deposit address from a quote, have a user send ~5 USDC, and watch it settle to the destination over the WebSocket.

Setup

The API key is used for the MPS panel and the event WebSocket. Getting the deposit address from a quote works without one. Need a key? Email support@mayan.finance.

Shared listener (Socket.IO)

The event stream is served over Socket.IO. The listener below resolves once a settlement is terminal (completed / dead) for a given wallet. Both examples import it. Install the client once:
Socket.IO handles the connection for you. A built-in heartbeat keeps it alive through idle gaps and it auto-reconnects on a drop, so there’s no manual keepalive to maintain.
listen.ts

Shared quote helper

The deposit address comes from a Mayan quote with mpsDeposit enabled, not a separate API call. The helper below fetches a quote and returns the mpsDepositAddress (the deterministic address on the quote’s source chain). Both examples import it.
mps-quote.ts

Base (EVM): deposit USDC on Base

The user sends ~5 USDC to the quote’s deposit address on Base; it’s settled as USDC to your destination wallet on Arbitrum.
evm-base.ts
Run it, then send ~5 USDC to the printed address:
Sample output:

Solana: deposit USDC on Solana

A quote from a Solana source returns a Solana vault as its mpsDepositAddress. The user sends ~5 USDC to it on Solana; it’s settled as USDC to your destination wallet on Arbitrum.
solana.ts
Run it, then send ~5 USDC to the printed vault:
Sample output:
The status chain differs by source chain. EVM runs pending_deploy β†’ deploying β†’ pending_swap β†’ swapping β†’ completed; Solana runs pending_settle β†’ settling β†’ completed. See Swap Statuses for the full lifecycle and the error field.