What you’ll build: a live holder count for a market, event, or position that ticks as wallets enter and exit, with historical candles backfilled from REST. Useful for a “holders” counter on a market page or for spotting markets gaining holders fast.
polymarket_holder_metrics streams real-time holder counts for positions, conditions (markets), and events, batched per block. It answers questions like “is this market gaining holders?” and “how concentrated is this position?” without polling. This recipe subscribes to the families you care about, tracks holder growth over time, and backfills history from REST.
When to use this
- A “holders” counter on a market or event page that ticks up as wallets enter.
- Spotting momentum: an event whose holder count is climbing fast.
- Showing a position’s distribution: total balance and cost basis across all holders.
The three families
You subscribe with at least one id array, and only the families you filter for are delivered. Up to 500 identifiers total per subscription.| Filter | Event | Row |
|---|---|---|
position_ids | holder_metrics_position_batch | PositionHolderMetricsRow |
condition_ids | holder_metrics_condition_batch | ConditionHolderMetricsRow |
event_slugs | holder_metrics_event_batch | EventHolderMetricsRow |
ts (Unix seconds), block, and holder_count. Position rows add total_balance and total_cost_basis, plus condition_holder_count and event_holder_count so a single position subscription can also report the holder counts of its parent market and event.
Step 1: subscribe to what you are watching
Pass the ids for the surfaces on screen. A market page tracking one event and its markets passes bothevent_slugs and condition_ids.
holder_metrics_event_batch and holder_metrics_condition_batch but not position batches.
Step 2: track holder growth for a market or event
Keep the latest count per id and, if you want a trend, append each tick to a small series so you can show direction.holder_count between ticks is the clearest signal that a market is drawing fresh participation.
Step 3: read a position’s balance and cost basis
Position rows carry the distribution figures.total_balance is the combined outcome-token balance across all holders and total_cost_basis is what they paid in aggregate, so the two together describe how much capital is committed to that position.
Backfilling historical candles from REST
The room streams changes going forward. To draw a holder-growth chart with history, pull candles from the REST history methods, then attach the live stream on top by the same id.getPositionHoldersHistory, getMarketHoldersHistory, and getEventHoldersHistory, one per grain. Seed the chart from the candles, then let the stream extend it.
Push without a socket: webhooks
If you do not want to hold a socket open, the same data is available as webhooks:position_holder_metrics, condition_holder_metrics, and event_holder_metrics. Each requires its id array (position_ids, condition_ids, or event_slugs respectively) and delivers the same row as the matching stream family. Register one with a POST /v1/webhooks body specifying url, event, and filters. Use webhooks for server-side counters and the stream for live UIs.
Follow-on
- Full payload schemas live on the Holder metrics room page.
- To pair holder growth with the trades driving it, see Building a live trending feed.