Skip to main content
Unauthenticated Socket.IO feed for public portfolio snapshots. The wire shape mirrors GET /users/portfolio — same filters, same data / meta payload. Real-time updates are pushed after trades on the subscribed wallet or market.

Connection

No authentication is required. Identity is supplied per subscription via the user field (wallet address or username). Private profiles return an empty paginated result — the same rule as the REST endpoint.

Client events (emit)

portfolio_subscribe

Starts or updates a subscription and emits an immediate snapshot. Required field: Optional filter fields (same semantics as GET /users/portfolio):

portfolio_refresh

Rebuilds the snapshot using the current subscription filters, or updates filters when a payload is supplied.
Subscribe with portfolio_subscribe before calling portfolio_refresh.

portfolio_unsubscribe

Clears the subscription and leaves wallet / market rooms.

Server events (listen)

portfolio_snapshot

Main data event. data and meta match the REST response from GET /users/portfolio.
The server pushes refreshed snapshots when:
  • the subscribed wallet executes a trade, or
  • a fill moves the price on a market the socket is scoped to (via marketId or contractMarketId).

portfolio_error

Validation, lookup, or snapshot-build failures.
Common messages:
  1. Connect to /portfolio-public (no auth header).
  2. On connect, emit portfolio_subscribe with user and active filters.
  3. Replace local portfolio state on every portfolio_snapshot.
  4. On filter changes, emit portfolio_subscribe again with updated params.
  5. On explicit refresh, emit portfolio_refresh.
  6. On leaving the view, emit portfolio_unsubscribe or disconnect.
Do not poll REST on an interval while this socket is active.

REST equivalent

Equivalent subscribe payload: