Prediction Markets

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.

  1. Log in to polymarket.com
  2. Navigate to Settings → API
  3. Generate an API key and API secret
  4. 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

EndpointLimitNotes
REST API (CLOB)Rate-limited per API key tierDocumented in Polymarket API docs
WebSocketPer connectionReal-time order book and trade updates
Order placementPer API key tierIncludes 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

ErrorCauseFix
CONNECTION_REFUSEDAPI key invalid or authentication failedVerify API key, secret, and passphrase in adapter config
RATE_LIMITEDToo many requests for API key tierIncrease rate_limit_ms in adapter config
INSUFFICIENT_FUNDSWallet balance (USDC on Polygon) too low for proposed tradeFund the wallet with additional USDC on Polygon
MARKET_NOT_FOUNDInvalid market_id or market has resolvedVerify market_id at polymarket.com or via the Gamma API
MANDATE_INTEGRITY_VIOLATIONConfig file modified while bot is runningStop the bot, verify config, restart

Related guides


One bot. $129. No subscription. No $749/mo platform. → Build for Polymarket


Build your Polymarket bot

botwir3 compiler

1 Platform

2 Objective