BrainResearchHub
Independent research on prediction markets, perpetual futures, and trading infrastructure

The Polymarket Python SDK in October 2026: A Migration-Proof Guide

Ahmed Trading· sdk · Updated October 2026

The official Polymarket Python SDK in October 2026 is polymarket-client v0.5.0 (released August 9, 2026, requires Python 3.11+). You install polymarket-client but import it as polymarket — the old py-clob-client is archived, and any code that survived the pUSD migration by upgrading to py-clob-client 0.40+ should now move to the unified client.

Which SDK should I use?

Three names, one survivor:

Package Status Role
py-clob-client archived (0.34.x line retired April 29, 2026) legacy CLOB client
py-clob-client 0.40+ pUSD-aware, superseded interim bridge release
polymarket-client current (v0.5.0, Aug 9, 2026) unified SDK

The full migration path: py-clob-client → py-clob-client-v2 (July 2026) → polymarket-client (final). New code should target polymarket-client only — and if you are still pinned to py-clob-client, your order signatures reference whatever collateral address the constants module ships with, which is exactly how the April 28, 2026 pUSD cutover silently broke un-upgraded bots.

What is the install/import trap?

The package name and the import name differ:

pip install polymarket-client
import polymarket

Code written against import polymarket_client fails at runtime even though the install succeeded. This catches almost everyone migrating from tutorials — including the official docs’ own examples, which consistently use from polymarket import ....

Which clients exist?

Four client classes, split by sync/async and read/trade:

Realtime streams are async-only: subscribe([MarketSpec(...), SportsSpec(...), UserSpec(...)]) attaches handlers for market and user channels.

What did the pUSD migration change under the hood?

April 28, 2026 moved settlement collateral from USDC.e to pUSD (an ERC-20 on Polygon, 6 decimals, 1:1 backed by native USDC). For SDK users three things broke at once:

  1. The collateral address inside every EIP-712 order signature changed — orders signed against the old address fail verification
  2. Resting USDC.e orders were cancelled at the snapshot block
  3. Allowances had to be re-approved for the exchange contract — without it, every order returns INSUFFICIENT_ALLOWANCE

The identifiers that did NOT change: conditional token contract, condition_id, token_id, your proxy wallet address, API credentials, and WebSocket schemas (only the asset field in fill events now reads pUSD).

How do I export data?

Every stream and query result converts to a dataframe:

What errors should I handle?

The exception taxonomy is three-deep:

Plus two CLOB-level strings worth matching in logs: INSUFFICIENT_ALLOWANCE (stale allowance after a collateral migration) and signature verification failures (stale constants or a pinned old package).

FAQ

Q: Does polymarket-client work on Python 3.10? A: No. The requirement is Python 3.11+ as of v0.5.0.

Q: Is py-clob-client still maintained? A: No — the 0.34.x line was retired the day after the April 28, 2026 pUSD migration, and the July 2026 interim package py-clob-client-v2 is deprecated in favor of polymarket-client.

Q: Are realtime streams available synchronously? A: No. subscribe() with MarketSpec/SportsSpec/UserSpec is async-only.

Q: Do I need to re-approve allowances after upgrading? A: If you came through the pUSD migration on an old client — yes, once: update_balance_allowance(asset_type="COLLATERAL"). Fresh installs on polymarket-client handle approval automatically.

Sources

Disclaimer

Not financial advice. Educational purposes only. Updated October 2026.