polymarket-trading
Skill389 starsChanged 23 days agoMITView on GitHub
Use when the user wants to actually PLACE, manage, or redeem bets on Polymarket (not just read odds — that's blockrun_markets). Covers setup (deposit wallet, funding, approvals), buy/sell with confirm gating, positions, redeeming winnings, geoblock handling, and the end-to-end demo flow.
3 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- machina-sports/sports-skillstheir own version, first seen Nov 5, 2026
- BlockRunAI/ClawRouteredited, first seen Oct 27, 2026
- joinQuantish/skillstheir own version, first seen Feb 17, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- BlockRunAI/ClawRouter★ 6.7k72% same
Wrote their own version · 2
- machina-sports/sports-skills★ 266same name
- joinQuantish/skills★ 13same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository18 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- blockrun-debugSkill
- blockrun-setupSkill
- blockrunSkill
- blockrun-upgradeSkill
- crypto-dataSkill
- decideSkill
- exa-researchSkill
- gentech-blockrunSkill
- image-promptingSkill
- modalSkill
- phoneSkill
- prediction-marketsSkill
- rpcSkill
- searchSkill
- signal-to-trade-demoSkill
- surfSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 24
Zero setup: no Polymarket account, no API keys, no gas token.
- Very specific: line 113
No manual creds are ever needed — the MCP bootstraps its builder key from the user's own wallet on first setup.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Polymarket Trading (blockrun_polymarket)
Real-money trading on Polymarket's CLOB V2 (Polygon), signed locally by the
user's BlockRun wallet key. Data discovery stays on blockrun_markets —
this tool only trades.
Mental model
- Signer = the BlockRun wallet key (
~/.blockrun/.sessionby default; aBLOCKRUN_WALLET_KEYenv var or an existing agentwallet.jsontakes precedence). Never leaves the machine.setupprints the actual signer address — back up the key behind it, wherever it lives (key file or env-var value). - 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. The budget ledger does NOT cover bets —
confirm:true+ caps do. - Zero setup: no Polymarket account, no API keys, no gas token. On first
setupthe MCP 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 Finland egress out of the box.
Golden rules for agents
- Never pass
confirm:trueunless the user explicitly approved that exact trade. Call once WITHOUT confirm → show the dry-run preview → ask → re-call withconfirm:true. - Per-order cap
POLYMARKET_MAX_BET_USD(default $25) and optional session cap are enforced server-side; don't try to split orders to sneak past them. The optionalPOLYMARKET_MAX_FUND_USDbounds a singlefundcall the same way. Awithdrawpreview marks anyto_addressthat is not the user's own agent wallet asCUSTOM— show the user that line verbatim before confirming. - 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 — the MCP bootstraps everything
# from the user's own wallet on first setup. (Geoblock is already handled:
# CLOB traffic routes through BlockRun's Finland egress by default. Set
# POLYMARKET_CLOB_HOST only to use your own egress, or to hit Polymarket
# directly from a permitted 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, then resolve the selected condition (paid data)
blockrun_markets path:"markets/search" params:{q:"Bitcoin",status:"open",venue:"polymarket",limit:"20"}
blockrun_markets path:"polymarket/markets/keyset" params:{condition_id:"0x...",status:"open",limit:"5"}
# 5. Preview, then place
blockrun_polymarket_read action:"preview" side:"buy" token_id:"..." amount_usd:5 order_type:"FOK"
blockrun_polymarket action:"buy" token_id:"..." amount_usd:5 order_type:"FOK" confirm:true
# 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_read action:"orders" # open orders
blockrun_polymarket action:"cancel" order_id:"..." # or all:true
blockrun_polymarket_read 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.
- A market-order preview states
worst fill ≤ X(buy) /≥ X(sell); the order is signed at that bound, so quote it to the user as the price limit. - Market buy =
amount_usd(dollars). Market sell =size(shares). - Limit orders:
price+size; default GTC;post_only:truefor 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 Finland egress, so setup
reports ✅ Region: order placement permitted out of the box; you don't need to
do anything. A user can override by pointing POLYMARKET_CLOB_HOST at their
own relay (or at Polymarket directly, from a permitted region), optionally
reached through their own proxy via POLYMARKET_CLOB_PROXY / HTTPS_PROXY
(POLYMARKET_CLOB_PROXY wins if both are set). A proxy alone does NOT change
the Polymarket-facing egress — CLOB traffic still exits from BlockRun's Finland
relay unless POLYMARKET_CLOB_HOST is also repointed. 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 manual creds are ever needed — the MCP 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. The CLOB may reject plain-EOA makers on order placement — treat it as a diagnostic fallback, not a guaranteed trading mode.) - Balance/allowance errors on a buy → the buy path auto-refreshes the CLOB's
balance cache and retries once; if it still fails, the vault genuinely lacks
pUSD or approvals — fund it, then
action:"setup" confirm:true. - A neg-risk market buy (multi-outcome "winner" markets) fails though setup
shows ready → a deposit wallet created before the pUSD→NegRisk Adapter approval
was added needs ONE more
action:"setup" confirm:trueto grant it (setup reads approvals on-chain every run, so it detects and signs the missing one). - A redeem reverts → same self-heal: wallets set up before 2026-07 lack the
collateral-adapter approvals redeem now pulls tokens through — one
action:"setup" confirm:truegrants them. - 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 as a last resortPOLYMARKET_SIG_TYPE=0(upstream clob-client-v2 issue #65; see the EOA-mode caveat above).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

