Polymarket Trading logo

Polymarket Trading

OrganizationPopular
BlockRunAI
polymarket-trading

Use when the user wants to actually PLACE, manage, or redeem bets on Polymarket (not just read odds — that's the blockrun_predexon_* data tools). Covers setup (deposit wallet, funding, approvals), buy/sell with confirm gating, positions, redeeming winnings, geoblock handling, and the end-to-end flow.

Overview

PublisherBlockRunAI
RepositoryClawRouter
Skill namepolymarket-trading
Stars
6.6K
Forks
650
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by BlockRunAI on GitHub. Read the source before you install it.

Installation

Install the Polymarket Trading AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/BlockRunAI/ClawRouter.git /tmp/ClawRouter
mkdir -p .claude/skills
cp -r /tmp/ClawRouter/skills/polymarket-trading .claude/skills/polymarket-trading
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Polymarket Trading in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Polymarket Trading on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Polymarket Trading is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Polymarket Trading (blockrun_polymarket)

Real-money trading on Polymarket's CLOB V2 (Polygon), signed locally by the user's ClawRouter wallet key. Data discovery stays on the blockrun_predexon_* toolsblockrun_polymarket only trades.

Mental model

  • Signer = the ClawRouter wallet key (~/.openclaw/blockrun/wallet.key, or BLOCKRUN_WALLET_KEY) — the SAME wallet that pays for LLM calls. Never leaves the machine.
  • Deposit wallet = a Polygon vault contract derived from that key (POLY_1271). It holds the betting funds in pUSD and only honors the signer's EIP-712 signatures. Deploy/approve/redeem are gasless (relayer).
  • Money separation: bets spend pUSD on Polygon; x402 API fees spend USDC on Base — but both come from the ONE ClawRouter wallet. The x402 budget ledger does NOT cover bets — confirm:true + caps do.
  • Zero setup: no Polymarket account, no API keys, no gas token. On first setup ClawRouter bootstraps a builder key from the user's OWN wallet, then derives + deploys the vault (all gasless). Geoblock is handled by default — CLOB traffic routes through BlockRun's Tokyo egress out of the box.

Golden rules for agents

  1. Never pass confirm:true unless the user explicitly approved that exact trade. Call once WITHOUT confirm → show the dry-run preview → ask → re-call with confirm:true.
  2. Per-order cap POLYMARKET_MAX_BET_USD (default $25) and optional session cap are enforced locally; don't try to split orders to sneak past them.
  3. On ANY error, read the message — it says exactly what to do next (fund, approve, region, re-run setup). Don't retry blindly.

End-to-end flow

# 0. No Polymarket account or API keys needed — ClawRouter bootstraps everything
#    from the user's own wallet on first setup. (Set POLYMARKET_CLOB_HOST to a
#    permitted-region egress only if the user is in a geoblocked region.)

# 1. Provision + inspect (idempotent, safe to re-run any time)
blockrun_polymarket action:"setup"
# → deposit wallet address + funding instructions + region status

# 2. Fund the vault from the user's Base USDC — gasless x402, one call ($0.01 fee,
#    non-custodial). pUSD credit is ASYNC (minutes) — re-run setup to watch it. Min $2.
blockrun_polymarket action:"fund" amount_usd:5             # dry-run preview
blockrun_polymarket action:"fund" amount_usd:5 confirm:true

# 3. Sign the one-time gasless approval batch (after user consent)
blockrun_polymarket action:"setup" confirm:true

# 4. Find a market + token (data tool, paid data)
blockrun_predexon_markets ...   # → clobTokenIds, conditionId (Polymarket /v1/pm data)

# 5. Preview, then place
blockrun_polymarket action:"buy" token_id:"..." amount_usd:2            # dry-run
blockrun_polymarket action:"buy" token_id:"..." amount_usd:2 confirm:true  # market FOK
#   or limit: price:0.45 size:10 (GTC; order_type:"GTD" + expires_at for expiry)
#   or via condition: condition_id:"0x..." outcome:"Yes"

# 6. Manage
blockrun_polymarket action:"orders"                     # open orders
blockrun_polymarket action:"cancel" order_id:"..."      # or all:true
blockrun_polymarket action:"positions"                  # holdings + PnL + redeemable

# 7. Claim winnings after resolution (gasless)
blockrun_polymarket action:"redeem" condition_id:"0x..."             # preview
blockrun_polymarket action:"redeem" condition_id:"0x..." confirm:true

# 8. Cash out — pUSD → native USDC on Base, back to the user's agent wallet
blockrun_polymarket action:"withdraw"                                # dry-run (full balance)
blockrun_polymarket action:"withdraw" confirm:true                   # (partial: amount_usd:5)

Order semantics

  • Prices are probabilities 0–1, auto-rounded to the market's tick grid.
  • Market buy = amount_usd (dollars). Market sell = size (shares).
  • Limit orders: price + size; default GTC; post_only:true for maker-only.
  • FOK fails whole-or-nothing; FAK fills what it can. On "FOK not filled", offer FAK or a limit at the shown book price.

Regions / geoblock

Order placement is IP-geoblocked (US/UK/EU + many regions). Handled by default — CLOB traffic routes through BlockRun's Tokyo egress, so setup reports ✅ Region: order placement permitted out of the box; you don't need to do anything. A user can override with POLYMARKET_CLOB_HOST (their own relay), or POLYMARKET_CLOB_PROXY / HTTPS_PROXY. Respecting Polymarket's ToS for the user's jurisdiction is the user's responsibility — never suggest evading it.

Troubleshooting

  • "No deposit wallet configured" → run action:"setup".
  • "No ClawRouter wallet found" → generate one via the /wallet command (or set BLOCKRUN_WALLET_KEY) before trading.
  • No manual creds are ever needed — ClawRouter bootstraps its builder key from the user's own wallet on first setup. (Advanced: POLYMARKET_SIG_TYPE=0 = plain EOA mode; needs POL gas + pUSD in the EOA, and is read-only for orders.)
  • Balance/allowance errors right after funding → setup again (refreshes the CLOB's balance cache).
  • 403 → region issue; see setup's region line.
  • "order signer address has to be the address of the API KEY" → auto-recovered once (creds re-derived); if persistent, setup, then consider POLYMARKET_SIG_TYPE=0 (upstream clob-client-v2 issue #65).

Frequently asked questions

What does the Polymarket Trading AI skill do?

Use when the user wants to actually PLACE, manage, or redeem bets on Polymarket (not just read odds — that's the blockrun_predexon_* data tools). Covers setup (deposit wallet, funding, approvals), buy/sell with confirm gating, positions, redeeming winnings, geoblock handling, and the end-to-end flow.

Why use Polymarket Trading on TypingMind?

Because you install it once and use it with any model. Polymarket Trading is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Polymarket Trading in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/BlockRunAI/ClawRouter/tree/main/skills/polymarket-trading. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Polymarket Trading?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Polymarket Trading?

As many as you like. As long as a model supports skills, you can use Polymarket Trading with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Polymarket Trading AI skill free?

Yes. It is published on GitHub by BlockRunAI under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇