Announcing Struct v0.5: CLOB v2, Analytics, and Oracle Events

Polymarket's biggest infrastructure migration in years cuts over on April 28. Struct already speaks v2, and we're shipping a brand-new analytics namespace and an oracle events stream alongside it.

Struct Team
Struct Team
5 min read
Announcing Struct v0.5: CLOB v2, Analytics, and Oracle Events

On April 28, Polymarket cuts over to CLOB v2, a full rewrite of the Exchange contracts, a new collateral token (pUSD), a new order schema, and a new builder attribution model. V1 SDKs stop working at the cutover. It is the biggest infrastructure change Polymarket has shipped in years.

Struct v0.5 ships today, three days early, and it speaks v2 natively. If you build on Struct, you do not have to migrate anything.

We're also shipping two major new surfaces in the same release: an Analytics API and an Oracle Events stream. Here is everything that's new.

No breaking changes

Every integration built on Struct continues to work without modification. CLOB v2 is wired in transparently behind the existing surfaces. Order, trade, and account fields are additive, not replaced. You do not need to update your code to keep running.


1. CLOB v2, Day One

Polymarket's v2 migration touches almost every part of the order lifecycle. The v1 order struct (with nonce, feeRateBps, taker, expiration) is gone. The new order carries timestamp, metadata, and a builder field. Fees are no longer embedded in the signed order; they're operator-determined at match time. Collateral moves from USDC.e to pUSD. Builder authentication moves from HMAC headers and a separate signing SDK to a single on-chain builderCode per order.

Every Struct surface that exposes order, trade, or account data now reflects v2:

  • builder_fee and builder_code on order trades: every trade we surface now carries the v2 builder attribution fields, so you can track integrator-sourced flow without touching the chain.
  • CTFExchangeV2 and NegRiskExchangeV2 exchange types: the exchange discriminator on every order and trade now identifies the new v2 contracts alongside the existing v1 types (CTFExchange, NegRiskExchange). Filter, route, or attribute by exchange version with a single field.
  • pUSD in the accounts websocket: the realtime accounts stream now emits pusd_update events alongside usdce_update and matic_update. Balance changes for the new collateral are first-class.
  • v2-shaped order objects everywhere: REST endpoints, websocket trade rooms, and webhook trade events all reflect the new order schema. No conditional logic in your code.

If you've been dreading the v2 cutover, this is the easy path. Point at Struct, and the migration is done.


2. The Analytics API

Until now, if you wanted Polymarket-wide analytics like total volume across a tag, weekly fees on a single market, or a trader's PnL curve over 30 days, you stitched it together from raw trade data. v0.5 ships a dedicated /analytics namespace that does it for you.

Every analytics endpoint comes in three flavors:

  • Deltas: per-bucket aggregates (volume, fees, txns, unique traders, merges, splits) at your chosen resolution.
  • Changes: percent change vs. the prior period across every metric.
  • Timeseries: cumulative values over time, ready to chart.

And every flavor is available across five scopes:

  • Global (analytics.getCounts): every metric across all of Polymarket, in one call.
  • Event: drill into a single event (e.g. the 2026 election).
  • Market: drill into a single condition.
  • Tag: aggregate across every market with a given tag.
  • Trader: a single wallet's activity across all markets.

Bucket resolutions span 60 minutes, 4 hours, 1 day, 1 week, and 1 month, so the same endpoint feeds both an intraday chart and a quarterly report.

A few details we're particularly happy with:

  • Merge/split volume tracking: every bucket separates ordinary buys and sells from position merges (combining YES + NO) and splits (creating YES + NO from collateral). Critical for understanding actual capital flow vs. position rebalancing.
  • Buy distribution histogram: every metric response includes a USD-bucketed histogram of buys (<$10, $10–100, $100–1k, $1k–10k, $10k–50k, $50k+). One call tells you whether a market is retail-driven or whale-driven.
  • Distinct-address counters: at every scope, we return the number of unique addresses that traded in the bucket, not just the trade count. Real engagement, not noise.

This is the data layer for dashboards, leaderboards, market screeners, and AI agents that need to reason about market state at any timescale. We've built a live frontend on top of it at explorer.struct.to/analytics, so you can see exactly what's possible before writing a line of code.


3. The Oracle Events Stream

Polymarket markets resolve through UMA's optimistic oracle. Until today, watching a resolution happen meant subscribing to UMA's contracts directly, mapping assertion IDs back to Polymarket conditions, and stitching it all together.

v0.5 ships a dedicated Oracle Events stream, available as both a websocket room (polymarket_oracle_events) and a webhook event type. We index every UMA assertion that touches a Polymarket condition and emit a typed event the moment it lands. Sixteen event types are covered, including:

  • AssertionMade, AssertionDisputed, AssertionSettled: the full UMA assertion lifecycle.
  • ProposePrice, DisputePrice, Settle: price requests on the way to resolution.
  • QuestionResolved, QuestionEmergencyResolved, QuestionReset, QuestionPaused: terminal and intermediate condition states.
  • NegRiskOutcomeReported: outcomes for negative-risk (multi-outcome) markets.

Each event arrives with full on-chain metadata: block number, transaction hash, oracle contract, the actors involved, and the asserted/disputed prices. Pending events appear in the stream from the mempool before chain confirmation, with confirmed events following once the block lands.

If you're building anything that reacts to resolutions (settlement bots, dispute monitors, P&L finalization, or a UI that needs to flip a market to "Resolved" the moment it happens), this is the primitive you wanted.


What Else Is in v0.5

The three big pillars get the headlines, but a lot of smaller things landed too:

  • Top traders endpoints on events, markets, and positions, ranked by realized PnL over 1d, 7d, 30d, or lifetime.
  • Tag sorting and timeframes: sort tags by volume, txns, unique traders/makers/takers, or fees, over 1h, 24h, 7d, 30d, 1mo, 1y, or lifetime.
  • Bond market sorting: sort bond markets by APY, liquidity, volume, or end date.
  • Many more room and alert filters: websocket subscriptions and webhook filters got a broad expansion, especially around oracle metadata and trader scoping.
  • Better-typed event unions: oracle events, trade events, and account updates now use stricter discriminated unions, so TypeScript narrows correctly without manual casting.

Start Building

v0.5 is live now. The TypeScript SDK is on npm, the API is live in production, and full docs are up.

Get started at struct.to/dashboard
Explore live analytics at explorer.struct.to/analytics
Read the Analytics docs
Install the TypeScript SDK
Polymarket CLOB v2 migration guide

Start exploring with Struct

Get started for free — chat with AI agents or integrate our API in minutes. No credit card required.

Get Started