TL;DR
Polymarket is migrating from V1 contracts (USDC.e collateral) to V2 contracts (pUSD collateral). The WebSocket service now handles both — V1 and V2 events flow through the same channels and subscription semantics. Four additive changes:- New
versionfield onorder_filled, activity, and lifecycle events (1or2) - New
builderandmetadatafields on V2order_filledevents - New
collateralchannel for pUSD deposit/withdrawal events - New
condition_preparedevent type on the lifecycle channel
Breaking Change: token_registered Only Fires for V1
| Event | V1 Markets | V2 Markets |
|---|---|---|
token_registered | Yes | No longer emitted |
condition_prepared | Yes (new) | Yes (new) |
condition_resolution | Yes | Yes |
condition_prepared event fires earlier than token_registered. For binary markets (most Polymarket markets), the service derives token IDs deterministically from condition_id + is_neg_risk and includes them in the tokens array — no extra API call needed. Token labels are placeholders ("Yes" / "No"); resolve canonical labels from Gamma/CLOB if needed. Non-binary markets have tokens: null.
New Fields on Existing Events
Trade events (order_filled)
V1 fills are byte-identical to pre-migration plus a single new version field:
builder and metadata (bytes32 hex, zero until Polymarket populates them):
- No
fee_refundevents on V2 — V2 has no refund flow. The net fee is emitted directly onorder_filledat match time. - V1
fee_refundbehavior is unchanged.
Lifecycle events
Now carry aversion field (1 or 2) indicating which contracts emitted them. All other fields unchanged.
Activity events
Now carry aversion field. Currently always 1 — V2 activity (split/merge/redeem on V2 contracts) uses the same V1 emission path for now.
New Channel: collateral
V2 replaces USDC.e with pUSD as the trading collateral. When users deposit/withdraw, the pUSD contract emits Wrapped / Unwrapped events. These flow through a new opt-in collateral channel.
Subscribe:
users filter or wildcard. Does not accept condition_ids, market_slugs, or token_ids — collateral flow isn’t tied to a market.
Event shape:
event_type:"polyusd_wrapped"(deposit: underlying → pUSD) or"polyusd_unwrapped"(withdrawal: pUSD → underlying)user: end-recipient of the operationasset: underlying ERC-20 address (typically USDC.e)amount/amount_normalized: 6-decimal (same as USDC)
Activity events (splits, merges, redeems) are not mixed into the collateral channel. Subscribe to both if you need full wallet flow.
Accepted Channel Types
type | Status |
|---|---|
orders | Unchanged |
activity | Unchanged — pUSD events not mixed in |
lifecycle | Unchanged filters; may deliver condition_prepared |
oracle | Unchanged |
orderbook | Unchanged |
collateral | New |
Contract Addresses
| Role | Address |
|---|---|
| V2 CTF Exchange | 0xe111180000d2663c0091e4f400237545b87b996b |
| V2 NegRisk Exchange A | 0xe2222d279d744050d28e00520010520000310f59 |
| V2 NegRisk Exchange B | 0xe2222d002000ba0053cef3375333610f64600036 |
| PolyUSD (pUSD) | 0xc011a7e12a19f7b1f670d46f03b03f3342e82dfb |
| ConditionalTokens (V1+V2) | 0x4D97DCd97eC945f40cF65F87097ACe5EA0476045 |
Backwards-Compatibility Guarantees
- No field removed, no field renamed, no filter semantic changed.
- V1 clients that don’t parse
version,builder, ormetadatawill ignore them — same JSON shape as before plus extra keys. - Clients with strict JSON schemas that reject unknown properties need a one-line schema update (allow additional properties, or add the new optional fields).
- Clients with a closed enum for
event_typeshould add"condition_prepared","polyusd_wrapped","polyusd_unwrapped"if they want to surface those.
Recommended Migration Steps
Update your event handlers (optional)
Read the new
version field on trade/activity/lifecycle events if you want to branch on V1 vs V2 behavior.Fix token discovery (required if you relied on token_registered)
If you used
token_registered as your “new market” signal, add a handler for condition_prepared. Query Gamma or CLOB by condition_id to resolve token IDs.Subscribe to collateral (optional)
If you track wallet deposit/withdrawal flow, subscribe to the new
collateral channel with type: "collateral".