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’sdata 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:
valueisholdingstimes the token’s price.unrealizedPnlisvalueminusholdingstimesavgCost.totalPnlisrealizedPnlplusunrealizedPnl.pnlPctistotalPnl.usddivided byinvested.usd, times 100. It staysnullwheninvested.usdis zero.
Snapshot, then stream
- Subscribe.
- Read every page of Positions with the same wallets,
chainsset to the subscription’s chain, andhideLowLiquidity=false. The stream filters nothing out, so the read must not either. The read returns open positions only; readlifecycle=closedas well if you keep closed rows. - Merge the read and the updates on
version.