> ## Documentation Index
> Fetch the complete documentation index at: https://docs.predexon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Polymarket Protocol V2

> Receive Protocol V2 (ExchangeV3) fills on the orders channel

Polymarket began rolling out new markets on **Protocol V2** on November 23, 2026. These markets use ExchangeV3 and hold positions in PositionManager. Existing markets continue trading on the earlier contracts until they close.

> [!NOTE]
>
> This is different from the April 2026 exchange upgrade (pUSD collateral, `version: 2` on events), which is covered in the [pUSD migration guide](https://docs.predexon.com/websocket/v2-migration.md).

## What is covered

| Channel | Protocol V2 |
| - | - |
| `orders` (confirmed and pending fills) | Available by default on fresh connections, including combo fills |
| `orderbook`, `activity`, `lifecycle`, `oracle` | Not yet. These channels keep covering the existing contracts. |

## Subscribe to trades

Open a **fresh connection** to `wss://wss.predexon.com/v1/<API_KEY>`. The existing `orders` request receives matching legacy and Protocol V2 fills by default. If you still have a legacy-only subscription on an older connection, reconnect and resend the same request.

```json theme={null}
{
  "action": "subscribe",
  "platform": "polymarket",
  "version": 1,
  "type": "orders",
  "filters": {
    "users": ["0x..."],
    "status": "confirmed"
  }
}
```

* Optionally set the top-level `protocol_versions` field to `["v1"]` for legacy CTF fills, `["v2"]` for native V2 fills, or `["v1", "v2"]` for both.
* Keep `version: 1` for the Predexon subscription schema.
* Filters, plan limits and wildcard rules are the same as for any [subscription](https://docs.predexon.com/websocket/subscriptions.md). `status: "pending"` and `"all"` work as described in [Pending Trades](https://docs.predexon.com/websocket/pending-trades.md).
* The selection is fixed for the life of the subscription. To change it, unsubscribe and subscribe again.

### Check the acknowledgement

When the subscription includes native V2, the `ack` reports the selected `protocol_versions` and supported `capabilities`.

```json theme={null}
{
  "type": "ack",
  "subscription_id": "sub_2f4b15b33798",
  "channel": "trades",
  "protocol_versions": ["v1", "v2"],
  "capabilities": ["v2.trades.finalized", "v2.trades.pending"]
}
```

Check that `protocol_versions` includes `"v2"` and `capabilities` includes `v2.trades.finalized`. For `status: "pending"` or `"all"`, also check for `v2.trades.pending`.

## Identifying Protocol V2 fills

Protocol V2 fills use the same `order_filled` event, with these differences:

| Field | Protocol V2 value |
| - | - |
| `protocol_version` | `"v2"` |
| `exchange_version` | `3` |
| `module_id` | `1` single-question market, `2` neg-risk (multi-outcome) market, `3` combo |
| `token_id`, `complement_token_id` | uint256 **decimal strings**. Keep them as strings or bigints, never a JavaScript number. A Protocol V2 position ID is not the market's old CTF token ID. |
| `shares`, `shares_normalized` | Integer microshares and decimal whole shares, respectively. |
| `shares_raw`, `collateral_amount_raw`, `fee_raw` | Exact integer strings with six implied decimal places. Use `shares_raw` for exact arithmetic, especially above JavaScript's safe integer range. |
| `log_index` | Hex string, for example `"0x1a"` (`null` on pending fills) |
| `block_number` | Decimal string (`null` on pending fills) |
| `event_id` | Stable ID for deduplication |
| `source_finality` | `"finalized"` for confirmed fills, `"pending"` for pending fills |
| `metadata_status` | `"verified"` for a match to a Gamma market record, `"onchain_definition"` for verified combo legs, or `"unavailable"` when enrichment is missing. |
| `role` | `"maker"` or `"taker"` |

Protocol V2 fills do not carry the `version` field from the April 2026 upgrade.

```json theme={null}
{
  "type": "event",
  "subscription_id": "sub_2f4b15b33798",
  "data": {
    "event_type": "order_filled",
    "protocol_version": "v2",
    "exchange_version": 3,
    "module_id": 1,
    "status": "confirmed",
    "source_finality": "finalized",
    "event_id": "137:0x5e1c...9a2b:418:order_filled",
    "user": "0x...",
    "taker": "0x...",
    "role": "maker",
    "side": "BUY",
    "token_id": "452440832404858215162679085576950387637887756615587043540997176327736918016",
    "outcome": "Yes",
    "price": 0.62,
    "shares": 25000000,
    "shares_normalized": 25,
    "shares_raw": "25000000",
    "collateral_amount_raw": "15500000",
    "fee_raw": "0",
    "tx_hash": "0x5e1c...9a2b",
    "log_index": "0x1a2",
    "block_number": "97270115",
    "timestamp": 1794611200,
    "market_slug": "example-market-slug",
    "title": "Example market question?",
    "metadata_status": "verified"
  }
}
```

### Combo fills

Combo fills (`module_id: 3`) are part of the WebSocket trade stream. They carry the native position and condition IDs, trade amounts, and transaction hash. When the combo definition is available, `combo_legs` contains the on-chain leg position IDs and `metadata_status` is `"onchain_definition"`. A combo can have an empty `market_slug` and null `title` and `market_id` because its metadata comes from the on-chain definition.

Use a wallet filter, the combo's own condition ID, or a wildcard subscription to receive these fills. A slug filter can only match fills with that slug, so a leg's market slug does not match the combo. REST trade history excludes combo fills.

### Volume

A maker fill and the matching taker fill describe the two sides of one trade. Do not add both sides together when computing traded volume.

### Pending fills

Pending Protocol V2 fills are mempool predictions with `prediction: true`, `execution_verified: false`, `source_finality: "pending"`, and `null` block and log fields. They can be dropped, replaced, or reverted. Early pending fills on newly seen regular markets can be withheld while metadata is being verified. A pending fill and its confirmed fill have different `event_id` values. Correlate them by `tx_hash` and `order_hash`.

## Source status messages

Protocol V2 subscribers also receive `source_status` messages:

```json theme={null}
{"type": "source_status", "subscription_id": "sub_2f4b15b33798", "channel": "trades", "protocol_version": "v2", "status": "ready", "reason": "sources_current"}
```

New connections receive the initial state and subsequent changes. The gateway forwards each `gap` and sends a fresh `ready` when the source recovers. Read trade fills from top-level `type: "event"` frames. If you receive `gap`, `paused`, or `unavailable`, reconcile the affected period using a history source that covers the market and ledger. A later `ready` confirms current health without replaying missed trades.

## Timing

Confirmed Protocol V2 fills are published once their block is finalized, normally a few seconds after the block. During an upstream source problem a fill can occasionally arrive up to 10 minutes late, still with its real block `timestamp`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.