

1
Authenticate
First, authenticate with the CLOB.
- TypeScript
- Python
Pass the signer and wallet address to
createSecureClient.This example uses Viem. See Wallet
Integrations to connect a
signer from another supported wallet library.
2
Choose an Outcome
Then, fetch the market and select the outcome you want to buy. See
Market Data to find a different market.Choose an outcome (YES in this example) and select its trading identifier based on the market version.The unified SDK uses
- TypeScript
- Python
assetId for an outcome’s trading identifier: a token
ID for a CTF market or a position ID for a Polymarket Protocol V2 market.
Use the identifier exposed for that outcome.3
Place a Market Order
Then, submit a small market buy. The order fills against available liquidity, and any unfilled amount is canceled instead of remaining open.
- TypeScript
- Python
Use
placeMarketOrder to place the market order.4
Wait for Settlement
Your order matched, but its trade settles on-chain asynchronously. Wait for settlement before checking your position.
- TypeScript
- Python
Use
waitForOrderFillSettlement to wait for the trade to settle.5
Check Your Position
Finally, list your positions for the selected market and find the outcome you bought.You placed your first market order on Polymarket.
- TypeScript
- Python