Polymarket Autonomous Trader
Facilitates on-chain trading on Polymarket by interacting with the Polygon blockchain for transaction execution and wallet management.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Polymarket Autonomous Trader Search for markets about the 2026 US midterm elections"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Polymarket Autonomous Trader
Claude-powered autonomous trading system for Polymarket prediction markets.
Features
Thesis → Markets: Describe an investment thesis in natural language; Claude finds, scores, and recommends the best markets to trade
Autonomous Trading: Claude monitors markets continuously and executes within configurable risk limits
MCP Integration: All trading capabilities exposed as MCP tools in Claude Desktop / Claude Code
Risk Management: Configurable position limits, daily loss limits, exposure caps
HFT Extension Point: Abstract pricing engine interface ready for Kelly criterion, ML models, or poker-inspired strategies
Confirm-Before-Trade: Safe default mode — Claude proposes, you approve
Related MCP server: polymarket-mcp
Prerequisites
Python 3.11+
uv package manager
A Polymarket account with USDC on Polygon
Your wallet's private key
An Anthropic API key
Setup
1. Install dependencies
curl -LsSf https://astral.sh/uv/install.sh | sh
cd /path/to/Polymarket
uv sync2. Configure secrets
cp .env.example .env
# Edit .env with your POLYMARKET_PRIVATE_KEY, POLYMARKET_WALLET_ADDRESS, and ANTHROPIC_API_KEY3. Generate CLOB API credentials (one-time)
uv run python scripts/setup_credentials.py
# Copy the printed API_KEY, API_SECRET, API_PASSPHRASE into .env4. Configure risk limits
Edit config.yaml to set position sizes, loss limits, and approval mode.
5. Connect to Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"polymarket-trader": {
"command": "uv",
"args": [
"--directory",
"/Users/parthgosalia/Desktop/Polymarket",
"run",
"python",
"-m",
"polymarket_trader.mcp.server"
]
}
}
}Restart Claude Desktop. The trading tools will appear automatically.
Usage
Search markets
"Search for markets about the 2026 US midterm elections"
Thesis-driven trading
"Analyze my thesis: AI regulation will pass in the EU before end of 2026"
Check portfolio
"Show me my current positions and P&L"
Autonomous loop
"Start monitoring markets for my thesis that crypto will have a major regulatory event in 2026"
Toggle autonomous mode
"Set approval mode to autonomous" (trades within your risk limits without asking)
Risk Limits (config.yaml)
Setting | Default | Description |
|
|
|
| 100 | Max size per single position |
| 500 | Max total open exposure across all positions |
| 50 | Halt trading if daily losses exceed this |
| 0.03 | Min probability edge (3%) required to trade |
| 0.25 | Cap Kelly sizing at 25% of theoretical |
HFT Extension
To plug in a custom pricing engine (e.g., ML-based or poker-inspired HFT):
Subclass
PricingEnginefromsrc/polymarket_trader/pricing/base.pyImplement
compute_signal()andcalibrate()Register the engine name in
config.yamlunderapi.pricing_engine
See src/polymarket_trader/pricing/base.py for the full interface.
Architecture
MCP Server (Claude ↔ Tools)
↓
TradeExecutor (orchestration)
├── CLOBConnector ← py-clob-client (orders, orderbook, auth)
├── GammaConnector ← market search
├── DataConnector ← positions, P&L
├── ClaudeAnalyst ← thesis scoring, probability estimation
├── PricingEngine ← Kelly/HFT signal generation
└── RiskManager ← limits, approval gatesRunning Tests
uv run pytestAvailable Tools
22 toolsanalyze_thesisA
Analyze an investment thesis and find the best Polymarket markets to trade.
Claude will:
Extract keywords from your thesis
Search for relevant markets
Score each market by relevance, edge, and liquidity
Return ranked trade recommendations
Example thesis: "I believe Trump will sign a crypto executive order before June 2026"
Inputs: thesis (required), max_markets. Returns: result
approve_tradeA
Approve a pending trade decision and execute it immediately. Only needed in confirm mode (the default).
Inputs: decision_id (required). Returns: result
cancel_all_ordersA
Cancel all open orders across all markets.
Inputs: no named parameters. Returns: result
cancel_orderA
Cancel a specific open order.
Inputs: order_id (required). Returns: result
estimate_market_probabilityB
Ask Claude to estimate the true probability for a market's YES outcome. Optionally provide additional context to inform the estimate.
Inputs: condition_id (required), context. Returns: result
find_arbitrageB
Check if YES + NO prices sum to something other than 1.0, indicating a potential arbitrage.
Inputs: condition_id (required). Returns: result
get_balanceA
Return USDC balance available for trading.
Inputs: no named parameters. Returns: result
get_loop_statusA
Return current loop state, active thesis, pending decisions, and iteration count.
Inputs: no named parameters. Returns: result
get_market_detailsB
Get full details for a specific market including live orderbook snapshot.
Inputs: condition_id (required). Returns: result
get_open_ordersB
List all live (unfilled) orders.
Inputs: no named parameters. Returns: result
get_orderbookB
Get live orderbook (bids and asks) for a specific outcome token.
Inputs: token_id (required). Returns: result
get_pnl_summaryA
Return daily realized P&L, total unrealized P&L, and portfolio value.
Inputs: no named parameters. Returns: result
get_portfolioA
Show all current positions with unrealized P&L and current prices.
Inputs: no named parameters. Returns: result
get_risk_statusA
Return current risk limits, daily loss consumed, exposure, and limit utilization.
Inputs: no named parameters. Returns: result
get_trending_marketsA
Return top Polymarket markets by 24-hour volume.
Inputs: limit. Returns: result
place_orderA
Place a limit order on a market.
In confirm mode (default): returns a pending decision for your approval. In autonomous mode: executes immediately if within risk limits.
Args: condition_id: Market condition ID side: "YES" to buy YES shares, "NO" to buy NO shares price: Limit price (0.01 – 0.99) size_usdc: Position size in USDC order_type: "GTC" (Good Till Cancel) or "FOK" (Fill or Kill)
Inputs: side (required), price (required), size_usdc (required), condition_id (required), +1 more. Returns: result
reject_tradeB
Reject a pending trade decision without executing it.
Inputs: decision_id (required), reason. Returns: result
search_marketsB
Search Polymarket markets by keyword. Returns markets with current prices, volume, and liquidity.
Inputs: query (required), limit, active_only. Returns: result
set_approval_modeA
Toggle trading approval mode.
'confirm' = Claude proposes trades, you must approve each one (safe default) 'autonomous' = Claude executes trades within risk limits without asking
Inputs: mode (required). Returns: result
start_autonomous_loopA
Start continuous market monitoring for a given investment thesis.
Claude will scan markets every poll_interval_seconds, identify opportunities, and either propose trades (confirm mode) or execute them automatically (autonomous mode).
Inputs: thesis (required), poll_interval_seconds. Returns: result
stop_autonomous_loopB
Gracefully stop the autonomous trading loop.
Inputs: no named parameters. Returns: result
update_risk_limitsA
Update runtime risk limits without restarting the server.
Args: max_position_usdc: Max size per individual position in USDC daily_loss_limit_usdc: Halt trading if daily losses exceed this amount max_exposure_usdc: Max total open exposure across all positions min_edge: Minimum probability edge (e.g. 0.03 = 3%) required to trade
Inputs: min_edge, max_exposure_usdc, max_position_usdc, daily_loss_limit_usdc. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 22 tools
Each tool has a clearly distinct purpose. Market exploration tools (search, details, trending, orderbook) are separated by scope, while analysis, trading, portfolio, approval, autonomous loop, and risk tools are each uniquely defined with no meaningful overlap.
All tool names follow a consistent verb_noun pattern using lowercase with underscores (search_markets, get_market_details, place_order, update_risk_limits). No mixed conventions or camelCase, making the set predictable and easy to navigate.
22 tools is in the 16-25 range, which feels heavy even though the domain of autonomous trading justifies a larger surface. While many tools are necessary (market, order, risk, loop management), the count is above the typical 3-15 sweet spot and could potentially be consolidated.
The tool set covers the full lifecycle of trading: market discovery, analysis, order placement/cancellation, portfolio tracking, risk management, approval modes, and autonomous loop control. Minor gaps like a dedicated trade history tool or explicit sell position are absent, but agents can work around them via existing functionality.
Maintenance
Related MCP Connectors
Polymarket & Kalshi live prediction market odds aggregator and cross-venue arbitrage scanner MCP.
Polymarket MCP — prediction-market data via Gamma + CLOB + Data public APIs.
Matched Kalshi and Polymarket markets across sports, crypto, weather, and economics over MCP.
Polymarket in your AI: market rules, real fill costs, who is trading, top traders. Read-only.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables Claude to autonomously trade, analyze, and manage positions on Polymarket prediction markets with 45 comprehensive tools covering market discovery, analysis, trading execution, portfolio management, and real-time monitoring with enterprise-grade safety features.MIT
- AlicenseNot gradedqualityBmaintenanceAn MCP server and Python toolkit that provides AI agents with real-time tools for Polymarket prediction markets, including liquidity scanning, arbitrage detection, and slippage estimation. It also offers advanced wallet intelligence, portfolio risk calculation, and probabilistic reasoning to enhance market analysis and strategy.46 PyPI1MIT
- FlicenseNot gradedqualityDmaintenanceMCP server that exposes Polymarket prediction markets via CLI wrapper. Enables AI agents to discover markets, check prices, and place trades programmatically.-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to autonomously trade, analyze, and manage positions on Polymarket prediction markets with 45 tools, real-time WebSocket monitoring, and enterprise-grade safety features.MIT