Skip to main content
Streams a wallet’s full position in a token each time a trade, a transfer or the token’s price 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 counts as one address against the address limit.
integer
default:"1000"
A top-level subscribe option, next to filters. Sends at most one update per position in this many milliseconds, up to 60,000. The default is 1,000, and 0 also means 1,000, so updates are always throttled.
A subscription can have at most 10,000 positions. See Limits.

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. Each row is priced the same way as the REST endpoint, so value, unrealizedPnl, totalPnl and pnlPct are null only where the REST response has null. A trade or transfer raises version. Any change to the token of an open position, such as a new price, sends the row again with the same version. A closed position is sent once, and later price changes send nothing. Replace your row with an update whose version is equal to or higher than yours. If you keep only a strictly higher version, you miss every price change.

Cost

Each update costs one third of a credit. An open position is sent again whenever its token changes, at most once per throttleMs. A wallet with 100 open positions in active tokens can use about 33 credits per second at the default of 1,000. Set a larger throttleMs when the positions do not need to be live to the second.

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, as Message format describes.
Repeat the REST request after every reconnect.

Errors