prediction-position message is sent when your position in a market changes.
It reports the current state of that position, not a delta.
Access
Requires an API key with theread scope. Send an
authenticate frame; there is no separate subscribe
for the private stream.
Fields
Positions are keyed by market and outcome together. A market in which you
hold both YES and NO reports two separate positions. Key your local state on
the
(eventMarketId, outcome) pair, not on eventMarketId alone, or the
second message will overwrite the first.Example
Notes
- Snapshot, not delta.
qtyis the position after the change, so replace your stored value rather than adding to it. realizedPnlcovers closed quantity only. Unrealized P&L is yours to compute, fromavgEntryPriceagainst a current quote from Market Ticker.costBasisis derived asqty×avgEntryPriceat publish time, not a running sum of what you historically paid.realizedPnlis in cents and can be negative.- A position that goes to zero is reported with
qty: 0rather than being omitted, so you can clear it from your local state. - Positions are published as the engine settles matches, so a single order crossing several resting orders may produce one position update rather than one per fill. Do not expect a 1:1 correspondence with fills.