Introduction
Clawmarket is a Model Context Protocol (MCP) server that enables OpenClaw AI agents to interact with prediction markets autonomously. By exposing Polymarket and Kalshi as callable MCP tools, Clawmarket transforms agents into first-class prediction market participants.
Overview
AI agents possess sophisticated reasoning for analyzing probabilistic outcomes but lack direct access to prediction market infrastructure. Clawmarket eliminates this gap through six MCP tools that abstract market complexity behind declarative semantics:
Market Discovery - Search and filter prediction markets
Data Retrieval - Fetch orderbook depth and trade history
Position Management - Open and close positions declaratively
Portfolio Monitoring - Track holdings and P&L
Event Analysis - Retrieve market-implied probabilities
Settlement Verification - Monitor resolution and claim payouts
Agents describe market intent using natural language. Clawmarket handles API authentication, order execution, position tracking, and settlement verification autonomously.
Quick Start
Installation
npm install -g clawmarketpip install clawmarketConfiguration
Create a configuration file at ~/.clawmarket/config.yaml:
Launch Server
Integrate with OpenClaw
Architecture
Clawmarket implements a three-layer architecture:
Agent Layer: OpenClaw agents receive high-level instructions and invoke MCP tools
MCP Server Layer: Clawmarket translates agent intent into platform API calls, manages authentication, and normalizes responses
Platform Layer: Polymarket and Kalshi provide prediction market infrastructure
Core Concepts
Markets
Prediction markets enable trading on event outcomes. Markets resolve to binary (YES/NO) or categorical outcomes based on real-world results.
Example Markets:
"Will Donald Trump win the 2024 U.S. presidential election?"
"Will the Federal Reserve cut interest rates in March 2026?"
"Will Bitcoin exceed $100,000 by year end?"
Positions
Positions represent ownership of outcome shares. Buying YES shares at $0.47 means the market implies a 47% probability of that outcome occurring.
Position Lifecycle:
Open position by buying outcome shares
Monitor market price changes
Close position by selling shares
Collect proceeds based on final outcome
Probabilities
Market prices reflect crowd-aggregated probability estimates. A YES price of $0.52 implies 52% probability; NO price of $0.48 implies 48% probability.
Agents analyze probability distributions to identify mispriced markets, arbitrage opportunities, and optimal entry/exit points.
Supported Platforms
Polymarket
Network: Polygon (Layer 2 Ethereum) Collateral: USDC Market Types: Binary and categorical outcomes Settlement: Automatic via UMA oracles Liquidity: $50M+ daily volume
Polymarket operates a Central Limit Order Book (CLOB) with continuous trading. Orders execute against the orderbook using EIP-712 signatures.
Kalshi
Network: Regulated US exchange Collateral: USD (bank transfer) Market Types: Event contracts (CFTC-regulated derivatives) Settlement: Automatic via exchange rules Liquidity: $10M+ daily volume
Kalshi is the first CFTC-regulated prediction market exchange in the United States. Contracts settle to $1 (winning outcome) or $0 (losing outcome).
Security
Clawmarket implements a non-custodial architecture. API keys and private keys remain under operator control with configurable approval policies.
Key Management:
Private keys stored locally, never transmitted to Clawmarket servers
API keys encrypted at rest
Support for hardware wallets (Ledger, Trezor)
Risk Controls:
Configurable position size limits
Daily loss limits with automatic trading suspension
Maximum exposure caps per market
Approval workflows for large trades
Audit Trail:
Complete position history logged locally
Transaction receipts for all trades
Portfolio snapshots for reconciliation
Use Cases
Arbitrage Detection Monitor probability discrepancies across platforms and execute trades when pricing inefficiencies exceed transaction costs.
Event-Driven Trading React to news, data releases, and social signals by adjusting positions in related markets.
Market-Making Provide liquidity by posting simultaneous buy/sell orders, profiting from bid-ask spreads.
Portfolio Rebalancing Maintain target exposure levels across categories by periodically adjusting positions.
Research and Analysis Extract market-implied probabilities for forecasting, research, and decision support.
Documentation Structure
Getting Started - Installation, configuration, and first market interaction MCP Tools Reference - Complete tool specifications with examples Platform Integration - Polymarket and Kalshi setup guides Security - Key management, approval policies, risk controls Examples - Agent workflows for common use cases API Reference - Low-level API documentation Error Handling - Error codes, recovery strategies, debugging
Support
Documentation: https://docs.useclawmarket.com GitHub: https://github.com/Clawmarket Email: [email protected] Twitter: @useclawmarket
License
Clawmarket is released under the MIT License. See LICENSE for details.
Last updated