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

Setup

Need a key? Email support@mayan.finance and ask to have MPS enabled on it β€” the quote returns mpsDepositAddress only for MPS-enabled keys.

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 MPS 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 ~2 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 ~2 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 ~2 USDC to it on Solana; it’s settled as USDC to your destination wallet on Arbitrum.
solana.ts
Run it, then send ~2 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.