Skip to main content
MPS emits two event types across its whole lifecycle. Consume them live over Socket.IO, and catch up on anything missed after a disconnect with the GET /events replay endpoint.

Event types

status_changed is the single lifecycle signal: a completed payment is status_changed with status: "completed", and a freshly deployed wallet rides on the status_changed into pending_swap (carrying its deploy txHash).

Socket.IO

The live stream is served over Socket.IO (bun add socket.io-client). Connect to the base URL and pass your API key in the handshake auth:
On a successful connection the server emits a connected event with your integrator name:
Socket.IO keeps the connection alive with its own heartbeat and auto-reconnects on a drop, so you don’t manage pings yourself. Fan-out is still best-effort β€” after a reconnect, catch up on anything missed via GET /events.

deposit_detected

queued tells you whether the deposit entered the settlement queue. If false, ignoredReason explains why (below_token_min, below_min, no_adapter, enqueue_error) β€” so a dust/spam deposit that will never produce a swap is an explicit signal, not a detection with no follow-up. below_token_min is the per-token minimum (see GET /source-config); below_min is the chain-level USD floor.

status_changed

  • queueItemId is the settlement id (matches GET /swaps id).
  • error is null except on failing/deferred states (see the error model).
  • txHash carries the wallet-deployment tx on the transition into pending_swap, and the swap/settle tx on the transition into completed.
  • To react only to final outcomes, filter on terminal: true (completed = success, dead = failure).

Delivery and replay

Socket.IO fan-out is live and best-effort: events are pushed only to currently-connected sockets and are not buffered per connection. Socket.IO auto-reconnects, but events that fired while you were disconnected are not resent β€” catch up with the replay endpoint rather than relying on the socket.
Returns your events in chronological (ascending) order strictly after since (omit since to start from the oldest retained event). Page forward with nextCursor until it is null.
Events are retained for 30 days and pruned afterwards, so replay only reaches back over the retention window. Treat events as idempotent β€” dedupe on the event id (from GET /events), or on data.queueItemId + data.status.