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 quote, the MPS panel and the event WebSocket. The deposit address is tied to the key you quote with, so use the same key for all three. 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.