Skip to main content
WS channel: wallet-portfolio Enabled on your key on request: contact us. The positions of a wallet on a chain with their live value: USD value, unrealized PnL and share of the portfolio, repriced as the market moves. The full list on subscribe, then each position as its value or its size changes. Rows are those of the Wallet Positions Stream plus the valuation fields of REST /v1/wallet/positions, and every message carries the totals of the wallet. One subscription is one wallet on one chain.

Delivery model

  • Snapshot, then deltas. Right after the ack you receive a snapshot: every open position of the wallet on the chain, valued. From then on you receive a delta each time a position changes: a trade of the wallet, or a price move of a token it holds.
  • At your pace. Changes within your updatePeriod (100 ms by default) are grouped into one message. A portfolio shown as a single total reads well at 1000; a trading screen keeps 100.
  • Totals in every message. summary carries the value, the unrealized PnL and the realized PnL of the wallet, over the rows you hold: no need to add the rows yourself.
  • A fresh copy every minute. Every 60 s, if the portfolio or the USD rate moved, you receive the complete snapshot again ("reason": "periodic"), free: replace your list with it.
  • Always consistent. Messages are numbered (seq, prev). Whenever the exact sequence cannot be delivered, you receive a fresh snapshot instead.

Parameters

string
required
Public chain id, evm:<id> or solana. Example: evm:8453
string
required
The wallet address (EVM hex, case-insensitive; Solana base58). Example: 0x9f1c3b6a2e5d4c7b8a9f0e1d2c3b4a5968778695
integer
Milliseconds, 0 to 60000, default 100: at most one delta per period, carrying every change of the period. The ack carries the value applied (snapped up to 0, 100, 250, 500, 1000, 2000, 5000, 10000, 30000, 60000). See Choosing your pace.

Messages

Every message is the data of an event frame.
  • enter: full rows of positions that open.
  • update: { "key": "<chain>:<token address>", … } with only the fields that changed. A field that became null is sent as null.
  • leave: the keys of the positions that closed.
  • summary: { positions, realizedPnlUsd, totalValueUsd, unrealizedPnlUsd, totalPnlUsd, valued } over the rows you hold. valued is the number of rows with a known value: the ones totalValueUsd adds up.

Applying a delta

  1. Remove every key listed in leave.
  2. Apply every update: the fields present replace those of the row.
  3. Add every row of enter.
Rows are not ranked: keep them by key and sort them as you like. A snapshot replaces everything you hold. It carries up to 1,000 positions, the largest first; page through REST for more.

The row

Every field of the Wallet Positions Stream row (decimals and labels included), plus, after them:

Resume

Events carry a cursor. After a reconnect, send the same subscribe with "since": "<cursor>": you receive the deltas you missed, or a snapshot of the current portfolio followed by what comes next. Either way, applying what you receive is all there is to do. See Reconnect & resume in the Streams overview.

Billing

1 credit per message delivered. The snapshot of a subscription ("reason": "subscribe") costs 1, whatever its size; every delta costs 1, whatever it carries. Snapshots sent on our own after that first one ("reason": "periodic" every 60 s, "reason": "resync" after a hiccup) and deltas flagged "replay": true are free; the snapshot sent when you resume with since costs 1, like the one of a new subscription. The connection is free. A longer updatePeriod means fewer messages, and fewer credits: at 1000, a wallet holding active tokens costs at most 60 credits per minute. GET /v1/usage/breakdown reports this channel under WS wallet-portfolio, where requests is the number of messages delivered.

Errors

Close codes

Ack
type:object

Server acknowledgement: the subscription is live.

Snapshot
type:object

The complete view, in order: right after the ack ("reason": "subscribe", 1 credit), every 60 s if the view moved (periodic, free) and whenever the view has to be replaced (resync, free).

Delta
type:object

Each change of the view, at most one per updatePeriod: 1 credit per message.

Subscribe
type:object

Client frame opening the subscription (additive, ack is explicit).