Polymarket Setup Guide
Time: 10 minutes | Difficulty: Moderate | Market: Prediction Markets Mode: Full automation | API: CLOB API (REST + WebSocket) | Docs: docs.polymarket.com
This guide wires a Polymarket trading bot to the CLOB API using the botwir3 runtime. Configure credentials, connect to event contracts, and run automated prediction market strategies locally.
Before you start
Verify that automated operation is permitted under Polymarket's current terms of service before deploying. botwir3 provides tools for building structured automation. The user is responsible for compliance with the platform's terms and all applicable regulations.
Polymarket Terms of Service | Last verified: May 2026
What you need
- A Polymarket account with identity verification complete
- A funded wallet (USDC on Polygon)
- The botwir3 runtime downloaded and unzipped
- A strategy config file from the builder
Step 1: Create API credentials
Polymarket uses the CLOB (Central Limit Order Book) API for programmatic trading.
- Log in to polymarket.com
- Navigate to Settings → API
- Generate an API key and API secret
- Note the API passphrase (required for authentication)
Permissions required: Trading access is enabled by default on CLOB API keys. Permissions to disable: N/A — Polymarket API keys are trading-only. Withdrawals require the wallet interface.
🔒 Security. Polymarket API keys cannot initiate withdrawals. Fund transfers require direct wallet interaction.
Step 2: Configure the adapter
Create adapter.json in the bot directory:
{
"adapter": "polymarket",
"credentials": {
"api_key": "paste-api-key-here",
"api_secret": "paste-api-secret-here",
"api_passphrase": "paste-passphrase-here"
},
"market_id": "will-the-fed-cut-rates-in-june-2026",
"environment": "live",
"rate_limit_ms": 200
}
market_id: Find market identifiers at polymarket.com or via the Gamma API. Each event contract has a unique slug or condition ID.
API keys are stored in a local config file on the machine running the bot. They are not transmitted to botwir3 or any third party. botwir3 never sees, stores, or has access to platform credentials.
Step 3: Test the connection
botwir3 test --adapter polymarket
Expected output:
[botwir3] Adapter: polymarket
[botwir3] Connection: OK
[botwir3] Permissions: trading
[botwir3] Rate limit: per API key tier
Step 4: Start the bot
botwir3 start --config my-strategy.json
The runtime loads the strategy, computes the spec hash, connects to Polymarket's CLOB API via the local credentials, and begins evaluating signals. The gate function compares proposed actions against the configured spec. The user is responsible for monitoring the bot and verifying execution outcomes.
Rate limits and considerations
| Endpoint | Limit | Notes |
|---|---|---|
| REST API (CLOB) | Rate-limited per API key tier | Documented in Polymarket API docs |
| WebSocket | Per connection | Real-time order book and trade updates |
| Order placement | Per API key tier | Includes new, cancel, and modify |
ℹ USDC on Polygon. Polymarket operates on the Polygon network. The wallet funding the account must hold USDC on Polygon. Bridging from Ethereum mainnet to Polygon is required if funds are on L1.
Event contract structure. Polymarket contracts are binary (Yes/No) with prices between $0.00 and $1.00. A $0.60 "Yes" contract pays $1.00 if the event occurs and $0.00 if it does not. The bot evaluates whether the market price diverges from the configured probability model.
Resolution. Contracts resolve based on the event outcome as determined by Polymarket's resolution source (typically UMA's optimistic oracle). Resolution is not instant — disputed outcomes may take additional time. All actions and decisions are recorded in the local ledger.
Common Polymarket bot configurations include probability model arbitrage (comparing the bot's calibrated probability against the market price), market-making across high-volume contracts, and event-driven strategies on Fed decisions, elections, and macro indicators.
Troubleshooting
| Error | Cause | Fix |
|---|---|---|
CONNECTION_REFUSED | API key invalid or authentication failed | Verify API key, secret, and passphrase in adapter config |
RATE_LIMITED | Too many requests for API key tier | Increase rate_limit_ms in adapter config |
INSUFFICIENT_FUNDS | Wallet balance (USDC on Polygon) too low for proposed trade | Fund the wallet with additional USDC on Polygon |
MARKET_NOT_FOUND | Invalid market_id or market has resolved | Verify market_id at polymarket.com or via the Gamma API |
MANDATE_INTEGRITY_VIOLATION | Config file modified while bot is running | Stop the bot, verify config, restart |
Related guides
- Kalshi Setup Guide — prediction markets, CFTC-regulated, US-legal
- Manifold Markets Setup Guide — prediction markets, play-money (Mana)
- PredictIt Signal Monitor Setup Guide — prediction markets, signal-only (read-only API)
One bot. $129. No subscription. No $749/mo platform. → Build for Polymarket