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’sdata 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:
valueisholdingstimes the token’s price.unrealizedPnlisvalueminusholdingstimesavgCost.totalPnlisrealizedPnlplusunrealizedPnl.pnlPctistotalPnl.usddivided byinvested.usd, times 100. It staysnullwheninvested.usdis zero.
Initial snapshot
- Subscribe.
- Read every page of Positions with the same wallets,
chainsset to the subscription’s chain, andhideLowLiquidity=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 requestlifecycle=closed. - Merge the REST response and the updates on
version.