Web3 Polymarket
Polymarket/agent-skills
Polymarket integration for prediction market trading on Polygon.
Polymarket exchange mechanics — on-chain Polygon CTF, Gamma/CLOB/Data APIs, EIP-712 auth, identifier model, WebSocket, settlement, and geo/KYC constraint
$ npx skills add agiprolabs/claude-trading-skills --skill polymarket-api -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install agiprolabs/claude-trading-skills polymarket-api --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/polymarket-api .claude/skills/polymarket-api && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "polymarket-api" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/polymarket-api into .claude/skills/polymarket-api/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "polymarket-api", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/polymarket-apiType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add agiprolabs/claude-trading-skills --skill polymarket-api -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install agiprolabs/claude-trading-skills polymarket-api --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/polymarket-api .agents/skills/polymarket-api && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "polymarket-api" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/polymarket-api into .agents/skills/polymarket-api/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "polymarket-api", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add agiprolabs/claude-trading-skills --skill polymarket-api -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install agiprolabs/claude-trading-skills polymarket-api --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/polymarket-api .cursor/skills/polymarket-api && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "polymarket-api" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/polymarket-api into .cursor/skills/polymarket-api/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "polymarket-api", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/agiprolabs/claude-trading-skills.git --path skills/polymarket-api--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add agiprolabs/claude-trading-skills --skill polymarket-api -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install agiprolabs/claude-trading-skills polymarket-api --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/polymarket-api .gemini/skills/polymarket-api && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "polymarket-api" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/polymarket-api into .gemini/skills/polymarket-api/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "polymarket-api", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install agiprolabs/claude-trading-skills polymarket-apiInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add agiprolabs/claude-trading-skills --skill polymarket-api -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/polymarket-api .github/skills/polymarket-api && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "polymarket-api" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/polymarket-api into .github/skills/polymarket-api/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "polymarket-api", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add agiprolabs/claude-trading-skills --skill polymarket-api -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install agiprolabs/claude-trading-skills polymarket-api --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/polymarket-api .opencode/skills/polymarket-api && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "polymarket-api" agent skill from https://github.com/agiprolabs/claude-trading-skills/tree/main/skills/polymarket-api into .opencode/skills/polymarket-api/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "polymarket-api", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
polymarket-apiPolymarket exchange mechanics — on-chain Polygon CTF, Gamma/CLOB/Data APIs, EIP-712 auth, identifier model, WebSocket, settlement, and geo/KYC constraint
Polymarket API is an agent skill from agiprolabs/claude-trading-skills. Polymarket exchange mechanics — on-chain Polygon CTF, Gamma/CLOB/Data APIs, EIP-712 auth, identifier model, WebSocket, settlement, and geo/KYC constraint
Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/clob-and-gamma-apis.md` and `references/settlement-and-ops.md`).
It sits in Backend & APIs, covering Smart contracts, Realtime and WebSockets and Capture the flag. It works with Polymarket and Circle USDC. The repository describes itself as: 68 trading, DeFi, and quantitative finance Agent Skills. Works with Claude Code, Cursor, Codex, Gemini CLI, and 30+ other tools. The licence is MIT.
2 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 981e1d7. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
uvFrom the folder's file list and the shell code blocks in SKILL.md.
Hosts in commands or code, which the agent is likely to contact:
gamma-api.polymarket.comclob.polymarket.comdata-api.polymarket.comAlso links to:
docs.polymarket.comgithub.comFrom URLs in SKILL.md, links to its own repository left out.
Names these keys or tokens, usually read from environment variables:
POLYMARKET_PRIVATE_KEYFrom names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Polymarket API loads about 1.6k tokens when it runs, and up to ~3.9k if it reads all its reference files. Until then it costs about 42 tokens; SKILL.md has 512 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from agiprolabs/claude-trading-skills at commit 981e1d7, republished under its MIT licence (© agiprolabs). 512 words, ~1,586 tokens.
.claude/skills/polymarket-api/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.Polymarket is a prediction market on Polygon mainnet. Every market is a pair of YES/NO ERC-1155 tokens issued by the Conditional Token Framework (CTF), collateralized 1:1 in USDC. Off-chain CLOB matching, on-chain settlement, zero taker fees. Prices are in [0.00, 1.00] USDC; YES + NO ≈ 1.0 per market.
Before you write any API code — read the live docs first.
- Docs: https://docs.polymarket.com
- Official Python SDK: https://github.com/Polymarket/py-clob-client
Polymarket endpoints and auth flows have changed without notice. Prefer the official
py-clob-clientSDK over hand-rolled HTTP; it handles EIP-712 derivation, API credential management, and order signing. Only hand-roll when the SDK doesn't expose what you need.
You will juggle four distinct IDs — get them confused and queries silently return wrong data.
| ID | What it is |
|---|---|
condition_id | On-chain hex ID of the market (the CTF condition) |
clob_token_ids | The YES/NO pair of ERC-1155 token IDs — a two-element list |
token_id | A single outcome token — what you pass to order-book and WebSocket queries |
event_id | Parent grouping (e.g. all brackets for "NYC high today") |
import httpx
# CRITICAL: default sort is OLDEST-first — always override or you silently get closed markets
events = httpx.get("https://gamma-api.polymarket.com/events", params={
"tag_id": 103040, # category tag (e.g. weather)
"order": "endDate",
"ascending": "false", # must be string "false", not bool
"closed": "false",
}).json()
# Each event → markets[], each market has:
# condition_id, clob_token_ids (YES/NO pair), question, outcomes, outcomePrices
for event in events:
for mkt in event.get("markets", []):
yes_token, no_token = mkt["clobTokenIds"] # split the pair here
print(mkt["question"], mkt["outcomePrices"])Pagination: limit=100&offset=N, step by 100.
uv pip install py-clob-clientimport os
from py_clob_client.client import ClobClient
client = ClobClient(
"https://clob.polymarket.com",
chain_id=137, # Polygon mainnet
key=os.environ["POLYMARKET_PRIVATE_KEY"], # wallet private key — env only, NEVER hardcode
signature_type=2, # 2 = Gnosis Safe proxy (Polymarket UI accounts)
# 0 = direct EOA you fully control
)
# Derives API key/secret/passphrase from the wallet signature — call once per session
client.set_api_creds(client.create_or_derive_api_creds())
token_id = "<yes_token_from_clob_token_ids>"
book = client.get_order_book(token_id) # bids/asks for one outcome token
price = client.get_price(token_id, side="BUY")signature_type=2 is for the proxy/Safe accounts the Polymarket web UI creates (the funder address is the Safe). Use signature_type=0 for a raw EOA you control directly. Read the live SDK docs — the type you choose affects how orders are signed on-chain.
Wallet env vars: POLYMARKET_PRIVATE_KEY, POLYMARKET_FUNDER. Never hardcode keys.
| API | Host | Auth | Purpose |
|---|---|---|---|
| Gamma | https://gamma-api.polymarket.com | none | Events/markets/conditions/prices metadata |
| CLOB | https://clob.polymarket.com | EIP-712 | Order book, order placement/cancel |
| Data | https://data-api.polymarket.com | none | Historical trades |
| WebSocket | wss://ws-subscriptions-clob.polymarket.com/ws/ | none (market) / JWT (user) | Real-time book + trade ticks |
Chain: Polygon mainnet chain_id=137. Collateral: USDC.e at 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174.
# Connect to: wss://ws-subscriptions-clob.polymarket.com/ws/market
# Subscribe message:
{"type": "market", "assets_ids": ["<token_id>", "<token_id2>"]}Event types: book (full snapshot on subscribe), price_change (delta updates), last_trade_price.
For user-level order/fill events, connect to /ws/user with a JWT derived from your API credentials.
Polymarket weather markets resolve via Weather Underground ("History" tab), on the metro's local clock with DST, midnight-to-midnight. This differs from Kalshi, which uses LST (no DST) and NWS CLI — see kalshi-weather-markets for the divergence.
After resolution, winning tokens must be redeemed manually on-chain:
# Call CTF contract redeemPositions() — the SDK or direct web3.py call
# Winnings are NOT auto-swept to your walletDisputes on the international book escalate to the UMA optimistic oracle (token-holder vote). This is a real resolution-divergence risk vs. Kalshi's CFTC-CCP settlement — factor it into any cross-venue comparison.
US persons are blocked from Polymarket. API calls from a US IP typically require a SOCKS5 proxy from an allowed jurisdiction (use a USE_PROXY env flag pattern; never hardcode the proxy address). This constraint — combined with on-chain capital lockup and USDC/USD friction — is why most Kalshi/Polymarket arbitrage is not executable at retail scale.
prediction-market-strategykalshi-apikalshi-weather-marketsreferences/clob-and-gamma-apis.md — Full API surface, all endpoints, EIP-712 auth detail, pagination, order schema, trading-parameter defaultsreferences/settlement-and-ops.md — WU/UMA resolution, redeemPositions, truth-source priority (IEM > WU > Open-Meteo), known-bad dates, geo/KYC, host-segregation, two-exchange architecture notes© agiprolabs, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 2 other files (references) in skills/polymarket-api of agiprolabs/claude-trading-skills.
Open the folder on GitHubat commit 981e1d7
Polymarket API next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Polymarket API this skillagiprolabs/claude-trading-skills | 410 | — | ~1.6k | Automated safety check: Pass | MIT | |
| Web3 PolymarketPolymarket/agent-skills | 191 | 2 repos | ~2k | Automated safety check: Pass | None | |
| Deposit QrSuperior-Trade/superior-skills | 214 | 1 repos | ~1.1k | Automated safety check: Pass | MIT | |
| Okx Dapp Discoveryinternet-court/internet-court-skill | 6.4k | 2 repos | ~6.9k | Automated safety check: Pass | MIT | |
| Okx Dex Marketinternet-court/internet-court-skill | 6.4k | 1 repos | ~1.7k | Automated safety check: Pass | MIT | |
| Capacitrmajiayu000/claude-skill-registry | 666 | 1 repos | ~3k | Automated safety check: Pass | MIT |
Polymarket/agent-skills
Polymarket integration for prediction market trading on Polygon.
Superior-Trade/superior-skills
A skill your agent uses when a user needs a QR code or wallet payment URI to fund a Superior-managed EVM wallet on a specific chain before using Lighter, Polymarket, Hyperliquid, or other Superior…
internet-court/internet-court-skill
Plugin router for 20 third-party DeFi protocols (Polymarket, Aave, Hyperliquid, PancakeSwap, Morpho, Raydium, Curve, Compound, Pendle, Lido, ether.fi, GMX, Kamino, Orca, Meteora, Clanker, pump.fun…
internet-court/internet-court-skill
HARD BLOCK — never use for prediction-market/Polymarket UpDown queries; route to okx-dapp-discovery when a named DApp (Polymarket/Aave/Hyperliquid/PancakeSwap/Morpho) appears with a timeframe, or…
majiayu000/claude-skill-registry
Paste a URL or free text and get matched Polymarket / Hyperliquid / Deribit markets with Quotient edge scores.
aiskillstore/marketplace
Plugin router for 20 third-party DeFi protocols (Polymarket, Aave, Hyperliquid, PancakeSwap, Morpho, Raydium, Curve, Compound, Pendle, Lido, ether.fi, GMX, Kamino, Orca, Meteora, Clanker, pump.fun…
agiprolabs/claude-trading-skills
Event-driven backtesting with bar-by-bar execution, complex order types, multiple analyzers, and custom indicators
agiprolabs/claude-trading-skills
Solana token market data via Birdeye — prices, OHLCV, trades, token metadata, security checks, and trader activity
agiprolabs/claude-trading-skills
Broad crypto market data from CoinGecko covering 13,000+ tokens.
agiprolabs/claude-trading-skills
Cointegration testing for pairs trading using Engle-Granger, Johansen, and rolling stability analysis
agiprolabs/claude-trading-skills
Wallet evaluation, monitoring, and copy-trade strategy design for Solana DEX trading
agiprolabs/claude-trading-skills
Cross-asset correlation analysis including rolling correlation, hierarchical clustering, tail dependence, and regime-dependent correlation
Works with
Categories
Polymarket exchange mechanics — on-chain Polygon CTF, Gamma/CLOB/Data APIs, EIP-712 auth, identifier model, WebSocket, settlement, and geo/KYC constraint. Polymarket API is an agent skill from agiprolabs/claude-trading-skills.
Polymarket API fits situations like: tasks that involve Smart contracts; tasks that involve Realtime and WebSockets; tasks that involve Capture the flag.
Run `npx skills add agiprolabs/claude-trading-skills --skill polymarket-api -a claude-code`. Or copy the skill folder (skills/polymarket-api in agiprolabs/claude-trading-skills) into .claude/skills/polymarket-api in your project. Claude Code loads it when a task matches its description.
Run `npx skills add agiprolabs/claude-trading-skills --skill polymarket-api -a codex`. Or copy the skill folder (skills/polymarket-api in agiprolabs/claude-trading-skills) into .agents/skills/polymarket-api in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add agiprolabs/claude-trading-skills --skill polymarket-api -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/polymarket-api, .gemini/skills/polymarket-api, .github/skills/polymarket-api and .opencode/skills/polymarket-api in your project.
Going by SKILL.md and its folder, Polymarket API needs the command-line tools its instructions call (uv) and credentials named POLYMARKET_PRIVATE_KEY. Our summary lists: Python 3; A credential in POLYMARKET_PRIVATE_KEY.
SKILL.md names 5 domains. In commands or code: gamma-api.polymarket.com, clob.polymarket.com and data-api.polymarket.com; the agent is likely to contact these when it follows the instructions. As links in the text: docs.polymarket.com and github.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Polymarket API is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.6k tokens (SKILL.md is roughly 6.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.3k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Polymarket API: Web3 Polymarket (Polymarket/agent-skills, 191 stars), Deposit Qr (Superior-Trade/superior-skills, 214 stars), Okx Dapp Discovery (internet-court/internet-court-skill, 6.4k stars) and Okx Dex Market (internet-court/internet-court-skill, 6.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
agiprolabs (a GitHub user) maintains it in agiprolabs/claude-trading-skills, which has 410 GitHub stars. The repository holds 68 skills in this directory. The repository was last updated on September 3, 2026.
Source: agiprolabs/claude-trading-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.