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.
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 subscribed wallet executes a trade, or
- a fill moves the price on a market the socket is scoped to (via
marketIdorcontractMarketId).
portfolio_error
Validation, lookup, or snapshot-build failures.
Recommended flow
- Connect to
/portfolio-public(no auth header). - On
connect, emitportfolio_subscribewithuserand active filters. - Replace local portfolio state on every
portfolio_snapshot. - On filter changes, emit
portfolio_subscribeagain with updated params. - On explicit refresh, emit
portfolio_refresh. - On leaving the view, emit
portfolio_unsubscribeor disconnect.