Build a custom OpenClaw skill that monitors Polymarket prediction markets for price movements, volume spikes, and new listings. No API key needed — just one SKILL.md file and your agent tracks prediction markets in real time.
Why Your Agent Needs a Polymarket Monitor
Polymarket processes over $1 billion in monthly trading volume across hundreds of active markets. Prices on Polymarket are implied probabilities — a contract trading at $0.65 means the market assigns a 65% chance to that outcome. These prices move fast when news breaks, and by the time you manually check, the edge is gone.
If you’re building an autonomous betting agent, Polymarket is the richest source of real-time probability data available. But raw API responses are cluttered — nested JSON, multiple outcome tokens, volume spread across sub-markets. Your agent needs a skill that filters, formats, and surfaces the signal.
This guide builds polymarket-monitor — a Layer 3 (Trading) skill that handles prediction market surveillance for the Agent Betting Stack. The skill queries both the Gamma API (market metadata) and the CLOB API (order book depth), formats the data for agent consumption, and feeds downstream skills like arb-finder and cross-market pricing.
What You’re Building
The polymarket-monitor skill teaches your OpenClaw agent five operations:
- List trending markets — Top markets by volume and activity
- Get market details — Price, volume, liquidity, and time to resolution for a specific market
- Check order book depth — Bid/ask spread and book depth from the CLOB
- Detect volume spikes — Markets where 24h volume exceeds baseline thresholds
- Find new listings — Recently created markets your agent hasn’t seen before
The skill uses curl and jq — no Python runtime, no API key, no authentication. Polymarket’s public APIs are free and unauthenticated for read-only access.
Prerequisites
- OpenClaw installed and running — Any channel (WhatsApp, Telegram, Discord, WebChat)
- curl and jq — Pre-installed on macOS and most Linux distributions
- No API key required — Polymarket Gamma and CLOB APIs are publicly accessible
The Polymarket API Landscape
Polymarket exposes two complementary APIs that the skill uses together:
Gamma API (gamma-api.polymarket.com) — The metadata layer. Returns market titles, descriptions, outcome tokens, current prices, aggregate volume, and resolution dates. Think of it as the “what’s happening” API. Responses are paginated and filterable by status, tag, and volume.
CLOB API (clob.polymarket.com) — The trading layer. Returns live order books, bid/ask prices, spread, and recent trades for individual outcome tokens. Think of it as the “how deep is the liquidity” API. Each outcome (Yes/No) has its own token ID that you pass to the CLOB.
The skill maps user intents to the right API automatically: market discovery goes through Gamma, depth analysis goes through CLOB.
The Complete SKILL.md
Create the skill directory:
mkdir -p ~/.openclaw/skills/polymarket-monitor
Create ~/.openclaw/skills/polymarket-monitor/SKILL.md with this content:
---
name: polymarket-monitor
description: "Monitor Polymarket prediction markets for price movements, volume spikes, and new listings. Track specific markets, check order book depth, and surface trending predictions. Use when asked about Polymarket, prediction market prices, market volume, or contract probabilities."
metadata:
openclaw:
emoji: "🔮"
requires:
bins: ["curl", "jq"]
---
# Polymarket Monitor
Track prediction market prices, volume, and liquidity on Polymarket using the Gamma API and CLOB API.
# When to Use
Use this skill when the user asks about:
- Trending or popular Polymarket markets
- Current price or probability for a prediction market
- Volume or trading activity on a market
- Order book depth or liquidity for a specific outcome
- New or recently created prediction markets
- Price movements or volume spikes on Polymarket
# Key Concepts
- **Price = Implied Probability**: A contract at $0.65 means 65% implied probability
- **Token ID**: Each outcome (Yes/No) has a unique token ID used by the CLOB API
- **Condition ID**: The unique identifier for a market (question) in the Gamma API
- **CLOB**: Central Limit Order Book — where bids and asks are matched
# Operations
### 1. List Trending Markets
Show the top active markets sorted by 24-hour volume:
```bash
curl -s "https://gamma-api.polymarket.com/markets?closed=false&active=true&order=volume24hr&ascending=false&limit=10" \
| jq '[.[] | {
question: .question,
price_yes: (.outcomePrices // "[]" | fromjson | .[0] // "N/A"),
price_no: (.outcomePrices // "[]" | fromjson | .[1] // "N/A"),
volume_24h: ((.volume24hr // 0) | tonumber | round),
total_volume: ((.volumeNum // 0) | tonumber | round),
liquidity: ((.liquidityNum // 0) | tonumber | round),
end_date: .endDate
}]'
2. Search for a Specific Market
Find markets matching a search term:
curl -s "https://gamma-api.polymarket.com/markets?closed=false&active=true&limit=5" \
--data-urlencode "tag=SEARCH_TERM" \
| jq '[.[] | {
question: .question,
condition_id: .conditionId,
price_yes: (.outcomePrices // "[]" | fromjson | .[0] // "N/A"),
volume_24h: ((.volume24hr // 0) | tonumber | round),
total_volume: ((.volumeNum // 0) | tonumber | round),
outcomes: (.outcomes // "[]" | fromjson),
tokens: [(.clobTokenIds // "[]" | fromjson | .[] )]
}]'
Replace SEARCH_TERM with the topic (e.g., “election”, “bitcoin”, “fed”). To search by keyword in question text:
curl -s "https://gamma-api.polymarket.com/markets?closed=false&active=true&limit=10" \
| jq --arg q "KEYWORD" '[.[] | select(.question | ascii_downcase | contains($q | ascii_downcase)) | {
question: .question,
condition_id: .conditionId,
price_yes: (.outcomePrices // "[]" | fromjson | .[0] // "N/A"),
volume_24h: ((.volume24hr // 0) | tonumber | round),
tokens: [(.clobTokenIds // "[]" | fromjson | .[] )]
}]'
3. Get Market Detail
Fetch full details for a specific market by condition ID:
curl -s "https://gamma-api.polymarket.com/markets?condition_id=CONDITION_ID" \
| jq '.[0] | {
question: .question,
description: .description,
price_yes: (.outcomePrices // "[]" | fromjson | .[0] // "N/A"),
price_no: (.outcomePrices // "[]" | fromjson | .[1] // "N/A"),
outcomes: (.outcomes // "[]" | fromjson),
volume_24h: ((.volume24hr // 0) | tonumber | round),
total_volume: ((.volumeNum // 0) | tonumber | round),
liquidity: ((.liquidityNum // 0) | tonumber | round),
start_date: .startDate,
end_date: .endDate,
tokens: (.clobTokenIds // "[]" | fromjson)
}'
4. Check Order Book Depth (CLOB API)
Get the live order book for a specific outcome token. Use the token ID from the market detail response:
curl -s "https://clob.polymarket.com/book?token_id=TOKEN_ID" \
| jq '{
best_bid: (.bids[0] // {price: "none", size: "0"}),
best_ask: (.asks[0] // {price: "none", size: "0"}),
spread: (if (.asks[0].price // null) != null and (.bids[0].price // null) != null
then ((.asks[0].price | tonumber) - (.bids[0].price | tonumber)) | . * 10000 | round | . / 10000
else "N/A" end),
bid_depth_5: ([.bids[:5][]?.size // "0" | tonumber] | add // 0 | round),
ask_depth_5: ([.asks[:5][]?.size // "0" | tonumber] | add // 0 | round),
total_bids: (.bids | length),
total_asks: (.asks | length)
}'
5. Detect Volume Spikes
Find markets where 24-hour volume exceeds a threshold (default $50,000):
curl -s "https://gamma-api.polymarket.com/markets?closed=false&active=true&order=volume24hr&ascending=false&limit=25" \
| jq --argjson threshold 50000 '[.[] | {
question: .question,
price_yes: (.outcomePrices // "[]" | fromjson | .[0] // "N/A"),
volume_24h: ((.volume24hr // 0) | tonumber | round),
total_volume: ((.volumeNum // 0) | tonumber | round),
liquidity: ((.liquidityNum // 0) | tonumber | round)
} | select(.volume_24h > $threshold)]'
Adjust the threshold value as needed. For high-activity scans use 100000, for catching early movers use 10000.
6. Find New Listings
Show markets created in the last 48 hours:
curl -s "https://gamma-api.polymarket.com/markets?closed=false&active=true&order=startDate&ascending=false&limit=15" \
| jq --arg cutoff "$(date -u -d '2 days ago' '+%Y-%m-%dT%H:%M:%S' 2>/dev/null || date -u -v-2d '+%Y-%m-%dT%H:%M:%S')" \
'[.[] | select(.startDate >= $cutoff) | {
question: .question,
created: .startDate,
price_yes: (.outcomePrices // "[]" | fromjson | .[0] // "N/A"),
volume_24h: ((.volume24hr // 0) | tonumber | round),
liquidity: ((.liquidityNum // 0) | tonumber | round)
}]'
Output Rules
- Always show the market question, current Yes price, and 24-hour volume
- Express prices as both dollar amounts ($0.65) and implied probability (65%)
- When showing order books, calculate the bid-ask spread and total depth
- Flag markets with less than $5,000 in liquidity as “thin” markets
- For volume spikes, show the absolute volume number and rank by 24h activity
- When comparing to sportsbook odds, convert Polymarket prices to American odds: Yes $0.65 = -186, No $0.35 = +186
Error Handling
- If the Gamma API returns an empty array, the search term may be too specific — broaden the query
- If the CLOB API returns empty bids/asks, the market may have low liquidity or be newly created
- If curl times out, Polymarket APIs may be under load — retry after 30 seconds
- The CLOB token_id must be exact — get it from the Gamma API market detail response first
## Test It
Restart OpenClaw (or wait for hot-reload if your version supports it), then try these prompts:
| Prompt | Expected Behavior |
| -------------------------------------------------------- | ---------------------------------------------------- |
| "Show trending Polymarket markets" | Lists top 10 markets by 24-hour volume with prices |
| "What's the price on the presidential election market?" | Searches for election markets, returns Yes/No prices |
| "Any volume spikes on Polymarket today?" | Finds markets with 24h volume above $50K threshold |
| "Check order book depth for [market]" | Fetches CLOB data showing bid/ask spread and depth |
| "What new markets launched this week?" | Lists markets created in the last 48 hours |
| "What's the liquidity like on the Bitcoin $100K market?" | Returns market detail with liquidity and CLOB depth |
Your agent reads the SKILL.md, identifies the relevant operation, substitutes the right market or token ID, and runs the curl + jq pipeline.
## How It Works Under the Hood
OpenClaw skills are not plugins that execute code directly. The SKILL.md is a set of instructions that the LLM (Claude, GPT, etc.) reads and follows at runtime.
When you ask "show trending Polymarket markets," this is what happens:
User message → OpenClaw Gateway → LLM reads system prompt + active skills → LLM matches “trending Polymarket” to polymarket-monitor skill → LLM generates curl command targeting Gamma API → OpenClaw executes command via shell tool → JSON response piped through jq → LLM converts prices to implied probability and formats output
For multi-step queries like "check depth on the election market," the agent chains operations: first searching Gamma for the market to get token IDs, then querying the CLOB for order book data. The SKILL.md instructions guide this chaining by specifying that token IDs come from the Gamma response.
## Extending the Skill
### Add Cron-Based Price Alerts
OpenClaw supports cron jobs. Add a scheduled task that polls a specific market every 15 minutes and alerts you when the price crosses a threshold:
```json
{
"cron": "*/15 * * * *",
"prompt": "Check the Polymarket presidential election market. If the Yes price has moved more than 5 cents since the last check, alert me on Telegram with the current price and direction."
}
This turns passive market browsing into proactive price surveillance — your agent watches the market so you don’t have to.
Set Up Volume Anomaly Detection
Run a daily scan that compares current volume to a rolling baseline:
{
"cron": "0 9 * * *",
"prompt": "Scan all Polymarket markets with 24h volume over $100K. Flag any market where today's volume is 3x the average of the past week. Report the top 5 anomalies."
}
Volume spikes often precede price movements — catching them early gives your agent a window to evaluate and act.
Chain with Other Skills
The polymarket-monitor outputs structured data that downstream skills can consume:
- arb-finder — Compares Polymarket prices with Kalshi contracts and sportsbook odds to find cross-market arbitrage
- cross-market-pricer — Normalizes Polymarket implied probabilities alongside sportsbook American odds and Kalshi contract prices
- ev-calculator — Takes Polymarket prices as the “market probability” input for expected value analysis
- odds-converter — Converts Polymarket contract prices ($0.65) to American odds (-186) for comparison with traditional books
This is the power of the Agent Betting Stack — composable skills where each layer feeds the next.
Full Skill Series
This guide is part of the AgentBets OpenClaw Skills series. We’re building a complete library of betting-specific OpenClaw skills that map to the four layers of the Agent Betting Stack:
- Layer 1 — Identity: Agent reputation tracking via Moltbook
- Layer 2 — Wallet: Bankroll management, balance checking across platforms
- Layer 3 — Trading: Odds scanning, Polymarket monitoring (this guide), Kalshi tracking, arbitrage detection
- Layer 4 — Intelligence: EV calculation, Kelly sizing, CLV tracking, news sentiment
Each skill is a standalone SKILL.md you can install independently or compose into a full autonomous betting pipeline.
What’s Next
- Polymarket CLOB API Deep Dive — Full API documentation for order books, trades, and token resolution
- PolyClaw — Polymarket OpenClaw Skill — The community Polymarket skill on ClawHub
- Agent Betting Stack Overview — Understand the four-layer framework these skills map to
- Prediction Market API Reference — Polymarket + Kalshi API documentation
- Build an Arb Finder Skill — Detect cross-market arbitrage using Polymarket data
