Skip to main content
Streams a wallet’s full position in a token each time a trade or transfer changes it. Subscribe on an open stream connection. See WebSocket streams for connections, frames and reconnection.

Filters

string
required
Chain slug of the positions.
string[]
required
One or more wallet addresses on chain. For a single wallet, wallet with one address is also accepted. Each wallet uses one unit of the address limit.

Message format

Each update’s data is a wallet’s full position in one token after a change, in the same row shape that Positions returns. Keep one row per chain, walletAddress and token, choosing the row with the highest version. Streamed positions do not include prices. value, unrealizedPnl, totalPnl and pnlPct are null, as is every token field except chain and address. To price a row, follow its token on spot.tokens and apply the same formulas as the REST endpoint:
  • value is holdings times the token’s price.
  • unrealizedPnl is value minus holdings times avgCost.
  • totalPnl is realizedPnl plus unrealizedPnl.
  • pnlPct is totalPnl.usd divided by invested.usd, times 100. It stays null when invested.usd is zero.

Initial snapshot

  1. Subscribe.
  2. Read every page of Positions with the same wallets, chains set to the subscription’s chain, and hideLowLiquidity=false. The stream does not filter anything out, so the REST request must not either. The request returns only open positions; to keep closed rows, also request lifecycle=closed.
  3. Merge the REST response and the updates on version.
Repeat the REST request after every reconnect.

Errors