Skip to main content
Subscribe on an open stream connection. See Connecting to streams for the connection, frames and reconnecting.

Filters

string
required
The chain slug the positions are on.
string[]
required
One or more wallet addresses on chain. For one wallet, you can send wallet with a single address instead. Each wallet spends one unit of the address budget.

Update

Each update’s data is a wallet’s whole position in one token after a change, in the row shape Positions returns. Keep one row per chain, walletAddress and token, and keep the row with the highest version. A streamed position carries no price. value, unrealizedPnl, totalPnl and pnlPct are null, and so is every token field except chain and address. To price a row, follow its token on spot.tokens and use the formulas the REST read uses:
  • 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.

Snapshot, then stream

  1. Subscribe.
  2. Read every page of Positions with the same wallets, chains set to the subscription’s chain, and hideLowLiquidity=false. The stream filters nothing out, so the read must not either. The read returns open positions only; read lifecycle=closed as well if you keep closed rows.
  3. Merge the read and the updates on version.
Read again after every reconnect.

Errors