py-clob-client v2 (2026): Migrating to the Unified Polymarket SDK

The Short Answer
Polymarket's documentation now moves Python integrations from py-clob-client-v2 to the unified polymarket-client package, with a migration guide for the switch, and the original py-clob-client lost order support at the CLOB V2 cutover in April 2026. Remove py-clob-client-v2, py-builder-relayer-client and py-builder-signing-sdk, then run pip install polymarket-client, which is at 0.13.0 as of 13 October 2026 and needs Python 3.11 or newer. One call, AsyncSecureClient.create(), replaces the credential setup, create_and_post_order(OrderArgs(...)) becomes await client.place_limit_order(...) with keyword arguments, and the SDK resolves tick size, negative risk, fees and allowances for you. TypeScript moves from @polymarket/clob-client-v2 to @polymarket/client the same way.
Key Takeaways
- Polymarket ended support for V1 SDKs and V1-signed orders at the CLOB V2 cutover on 28 April 2026, which retired the original
py-clob-clientfor trading. py-clob-client-v2still ships, with 1.2.0 out on 25 September 2026, but Polymarket's guide moves CLOB, relayer and builder-signing code into one client.AsyncSecureClient.create()derives or creates your CLOB credentials and resolves the wallet, sosignature_typeandfundergo away.- The new methods take keyword arguments, return typed models and must be awaited on the async client.
- A default changed: market orders were FOK in
py-clob-client-v2and are FAK inpolymarket-client.
Why are py-clob-client and py-clob-client-v2 being replaced?
Two changes happened in sequence. On 28 April 2026, Polymarket's CLOB V2 went live with new Exchange contracts, pUSD as collateral and a new order struct, and the changelog was explicit: "Legacy V1 SDKs and V1-signed orders are no longer supported on production." That ended the original py-clob-client and @polymarket/clob-client for trading. The V2 clients, py-clob-client-v2 and @polymarket/clob-client-v2, carried integrations through the cutover.
The unified SDKs are the second step. Polymarket's guide migrates "from the previous CLOB, relayer, and builder-signing clients to the unified SDK," so one client now covers market discovery, order books, trading, positions, gasless wallet actions and the Gamma and Data APIs. New features land there too: the SDK changelog adds session keys, PolyBolt price streams and Combos quotes to the unified clients.
Neither registry marks the older packages as deprecated, and py-clob-client-v2 got a 1.2.0 release on 25 September 2026. Polymarket's docs and examples, though, are written for the unified clients. These are the versions checked on 13 October 2026:
| Package | Registry | Latest version | Role |
|---|---|---|---|
py-clob-client | PyPI | 0.34.6 | V1 client, no longer supported for orders |
py-clob-client-v2 | PyPI | 1.2.0 | V2 client the guide migrates from |
polymarket-client | PyPI | 0.13.0 | Unified Python SDK |
@polymarket/clob-client-v2 | npm | 1.2.0 | V2 client the guide migrates from |
@polymarket/client | npm | 0.13.0 | Unified TypeScript SDK |
How do you install the unified Polymarket SDK?
# Python: remove the old clients, then install the unified SDK
pip uninstall -y py-clob-client-v2 py-builder-relayer-client py-builder-signing-sdk
pip install polymarket-client
# TypeScript: the same move on npm
npm uninstall @polymarket/clob-client-v2 @polymarket/builder-relayer-client @polymarket/builder-signing-sdk
npm install @polymarket/client@latest viem
Both unified packages are at 0.13.0 as of 13 October 2026, and Polymarket's SDK changelog lists the same version. polymarket-client needs Python 3.11 or newer, and @polymarket/client needs Node.js 24 or newer. With uv or Poetry, use uv remove and uv add, or poetry remove and poetry add, with the same names. The import changes too, from py_clob_client_v2 to polymarket. Which client suits which project is covered in the Polymarket SDK guide.
What changes in authentication?
This is the biggest structural change. With py-clob-client-v2, you built a client, derived credentials, then built a second client with the credentials, a signature type and a funder address:
import os
from py_clob_client_v2 import OrderArgs, Side
from py_clob_client_v2.client import ClobClient
from py_clob_client_v2.order_utils.model import SignatureTypeV2
HOST = "https://clob.polymarket.com"
KEY = os.environ["POLYMARKET_PRIVATE_KEY"]
creds = ClobClient(HOST, chain_id=137, key=KEY).create_or_derive_api_key()
client = ClobClient(
HOST,
chain_id=137,
key=KEY,
creds=creds,
signature_type=SignatureTypeV2.POLY_1271,
funder=os.environ["POLYMARKET_WALLET_ADDRESS"],
)
response = client.create_and_post_order(
OrderArgs(token_id="YOUR_TOKEN_ID", price=0.52, size=10, side=Side.BUY)
)
print(response)
With polymarket-client, one awaited call does all of that, and the client works as an async context manager:
import asyncio
import os
from polymarket import AsyncSecureClient
async def main() -> None:
async with await AsyncSecureClient.create(
private_key=os.environ["POLYMARKET_PRIVATE_KEY"],
wallet=os.environ["POLYMARKET_WALLET_ADDRESS"],
) as client:
response = await client.place_limit_order(
asset_id="YOUR_TOKEN_ID",
price="0.52",
size="10",
side="BUY",
)
if response.ok:
print(response.order_id, response.status)
else:
print(response.code, response.message)
asyncio.run(main())
We checked both versions against the installed packages, py-clob-client-v2 1.2.0 and polymarket-client 0.13.0: every call binds to the real signatures, and an accepted order's ok is typed as True and a rejected one's as False, so checking response.ok narrows the type. asset_id is the current name for the token, and token_id still works as a deprecated alias.
The rest of the authentication changes follow the same pattern:
- Credentials.
create_or_derive_api_key()runs insidecreate(), which "derives or creates CLOB credentials, resolves the account wallet, and configures signing." - Wallet.
signature_typeandfunderbecomewallet=. Leave it out to use the default Deposit Wallet flow. If the signer and wallet split is unclear, the Polymarket proxy wallet guide explains it. - Resuming. Store
client.credentialsand pass it back ascredentials=. - Revoking.
delete_api_key()becomesend_authentication(), which revokes the key and returns a public client. - Builder and relayer keys.
BuilderConfigandRelayClientgive way toapi_key=BuilderApiKey(...)orapi_key=RelayerApiKey(key=..., address=...).
How do py-clob-client-v2 methods map to the unified SDK?
| py-clob-client-v2 | polymarket-client (awaited on the async client) |
|---|---|
ClobClient(host, chain_id=137) | AsyncPublicClient() |
create_or_derive_api_key() plus a second client | AsyncSecureClient.create(private_key=..., wallet=...) |
create_and_post_order(OrderArgs(...)) | place_limit_order(asset_id=..., price=..., size=..., side="BUY") |
create_and_post_market_order(MarketOrderArgs(...)) | place_market_order(asset_id=..., side="BUY", amount=..., order_type="FOK") |
create_order(), create_market_order() | create_limit_order(), create_market_order() |
post_orders([PostOrdersV2Args(...)]) | post_orders([first_order, second_order]) |
cancel_order(OrderPayload(orderID=...)) | cancel_order(order_id=...) |
cancel_orders([...]) | cancel_orders(order_ids=[...]) |
cancel_market_orders(OrderMarketCancelParams(...)) | cancel_market_orders(market=...) |
get_order(order_id) | get_order(order_id=...) |
get_open_orders(OpenOrderParams(...)) | list_open_orders(market=...), a paginator |
get_trades(TradeParams(...)) | list_account_trades(market=...), a paginator |
get_order_book(token_id) | get_order_book(asset_id=...) |
get_price(token_id, side) | get_price(asset_id=..., side="BUY") |
get_prices_history(PricesHistoryParams(...)) | list_price_history(asset_id=..., interval="1d") |
calculate_market_price(...) | estimate_market_price(...) |
get_market_trades_events(condition_id) | list_trades(condition_id=[...]) |
get_tick_size(), get_neg_risk() | market.trading.minimum_tick_size, market.state.neg_risk |
update_balance_allowance() | Handled during order placement |
get_ok(), get_server_time() | Not needed |
Two rows differ from Polymarket's migration guide. Its Python examples still show get_price_history and list_trades(market=...), but SDK 0.10.0 replaced them with list_price_history and condition_id, and in our check of 0.13.0, get_price_history no longer exists. The SDK changelog is the safer reference when the two disagree.
What are the common migration pitfalls?
- Missing
await. Methods onAsyncSecureClientare coroutines. For scripts,SecureClient.create()offers the same methods synchronously, but realtime subscriptions are async only. - Positional arguments. Most new methods are keyword-only, so
get_order_book("TOKEN_ID")raises aTypeError. Writeget_order_book(asset_id="TOKEN_ID").post_orderandpost_ordersare the exceptions, taking signed orders directly. - The market order default.
create_and_post_market_orderdefaulted to FOK, whileplace_market_orderdefaults to FAK andestimate_market_pricestill models FOK. Passorder_typeexplicitly. user_usdc_balanceis notmax_spend. The old field supplied your balance for fee adjustment.max_spendis the most you want to spend including fees, so set it equal toamountfor an all-in budget or leave it out to pay fees on top.- Rejections are values. A rejected order comes back with
okset toFalse, acodeand amessage, so checkresponse.ok. Restarts and post-only mode raiseRequestRejectedErrorinstead. - Lists are paginators.
list_open_orders,list_account_tradesandlist_tradesreturn paginators, so callfirst_page()or iterate withiter_items().
Trading involves risk, and a changed default can change how an order fills, so run the migrated bot with small orders before you size it back up.
Where does Predictefy fit in a Python stack?
A migration is a good moment to separate venue plumbing from strategy code. The Predictefy API and its Python SDK, predictefy, read 15+ venues through one normalized schema, with a non-custodial trading workflow. Paper trading costs 0 credits on every plan, which makes it an easy place to rehearse a migrated bot's order flow before it trades for real.
Frequently Asked Questions
Is py-clob-client deprecated?
Polymarket's docs do not use that word, but the original py-clob-client is a V1 SDK, and V1-signed orders have not been supported on production since 28 April 2026. The docs' migration guide then moves py-clob-client-v2 users to polymarket-client.
What replaces py-clob-client-v2?
The unified polymarket-client package on PyPI, imported as polymarket. It provides AsyncSecureClient and SecureClient for trading and account data, and AsyncPublicClient and PublicClient for public reads.
What is the latest version of polymarket-client?
As of 13 October 2026 it is 0.13.0 and requires Python 3.11 or newer. The TypeScript SDK, @polymarket/client, is also at 0.13.0 and requires Node.js 24 or newer.
What replaces create_and_post_order?
place_limit_order on a secure client, called with keyword arguments such as asset_id, price, size and side, and awaited on the async client. Market orders move to place_market_order, which defaults to FAK.
Do I still need signature_type and funder?
No. Pass your account wallet as wallet when you create the secure client, and the SDK resolves the wallet type and signing. Leave wallet out to use the default Deposit Wallet flow for your signer.
Is there a unified SDK for TypeScript and Rust?
TypeScript has @polymarket/client, which replaces @polymarket/clob-client-v2 the same way. A unified Rust SDK is in progress, and until it ships, Polymarket's guide points Rust users to polymarket_client_sdk_v2, naming version 0.7.0, although crates.io listed 0.8.0 on 3 October 2026.