- If you use a standalone CLOB SDK, complete the unified SDK migration first to update client setup.
- If upgrading from before 0.10.0 and using portfolio or history reads, also apply the Data API v2 migration.
1
Upgrade the SDK
- TypeScript
- Python
Upgrade
@polymarket/client to the latest release (0.12.0 or later) using your preferred
package manager.2
Ensure Trading Approvals
- TypeScript
- Python
Keep calling
setupTradingApprovals() on your SecureClient. It also
approves the contracts required for Polymarket Protocol V2.
Gasless wallets need a configured
Relayer or Builder API key.3
Select the Trading ID
- TypeScript
- Python
Given a
market, for example returned by fetchMarket(), check its
version: use the desired outcome’s positionId for V2 or tokenId
for V1. This example selects YES:4
Trade as Usual
- TypeScript
- Python
Use the selected Use the selected ID for order books, prices, and market subscriptions too.
assetId:Verify the Migration
Verify BUY and SELL fills and balances on both a V2 market and a CTF market.Read Balances and Allowances
- TypeScript
- Python
Read balances and allowances using the asset ID selected earlier:Balances and allowances are returned in base units. Allowances are keyed
by spender address. To refresh before reading, import
updateBalanceAllowance
from @polymarket/client/actions and pass client followed by the same
parameters.Update Resolution Reads
If your integration tracks V2 market resolution:- TypeScript
- Python
Call Use payouts only from a row whose
fetchResolutions for the selected market:status is "resolved".