
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. Orders identify each outcome by its token ID. See Market Data to find a different market.
- TypeScript
- Python
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.That’s it—you placed your first market order on Polymarket.
- TypeScript
- Python
