Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/crp4222/pmq/agents-mdgit clone --depth 1 https://github.com/crp4222/pmqWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/crp4222/pmq/agents-md)<a href="https://agentmods.dev/instructions/crp4222/pmq/agents-md"><img src="https://agentmods.dev/badge/instructions/crp4222/pmq/agents-md.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00689 | $0.00689 |
| Opus 5 | $0.00345 | $0.00345 |
| Sonnet 5 | $0.00138 | $0.00138 |
| Haiku 4.5 | $0.00069 | $0.00069 |
Grade A, and why
pmq AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 52 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Working with pmq (agent instructions)
pmq is a small Python library for Polymarket CLOB V2 with two layers, plus
an MCP server (pmq-mcp) exposing both to any MCP client; its trading
tools exist only when the operator sets PMQ_MCP_LIVE=1 (live) or
PMQ_MCP_PAPER=1 (fills simulated against the real live books, keyless,
nothing reaches the exchange, wins over live), capped per order
(PMQ_MCP_MAX_USD) and per UTC day (PMQ_MCP_DAILY_USD).
Data layer (no credentials, safe anywhere)
import pmq
m = pmq.parse_market(pmq.get_market(slug)) # condition id + token ids
book = pmq.get_book(m["token_a"]) # REAL TIME, trade off this
bid, bid_sz, ask, ask_sz = pmq.best_bid_ask(book)
pmq.fee(price, shares) # taker $, crypto rate 0.07
Never make live decisions from get_tape (data-api): it lags matching by 1
to 3 minutes. It is for offline scoring at least 5 minutes after close.
Execution layer (needs POLY_PRIVATE_KEY; treat as production)
Rules an agent MUST follow:
- Default to reading data, not trading. Only place orders when the user explicitly asked for live execution in this session.
- Book only
fill.matched_sharesandfill.matched_usd. A falsyFillmeans nothing happened, whatever the request was. - Wrap every order in
try/except OrderUncertain; on that exception callexecutor.reconcile(condition_id)and do not place new orders on that market until it returns. - Call
executor.require_collateral(stake)before a session of trading. If it reports 0 while the user says the account is funded, the signature_type is wrong: the Polymarket app's default wallet needssignature_type=3(deposit wallet). - Budget with fees: a share at price p costs
p + pmq.fee(p, 1). - Never print or log POLY_PRIVATE_KEY or any environment secret. Addresses and builder codes are public; keys are not.
- FAK buys spend dollars (
buy_fak(token, price_cap, usd)), FAK sells spend shares. Amounts are rounded down internally to exchange accuracy. - Builder attribution: the library defaults to the maintainer's
zero-commission builder code. Respect the user's choice if they set
builder_code=Noneor their own code; do not change it silently. - Shared wallets: when several senders trade one wallet, each configures
its own append-only registry (
POLY_ORDER_LOG) and lists the others inPOLY_FOREIGN_ORDER_LOGS(colon-separated).trades_totals()then counts only OUR orders, andreconcile()claims trades unknown to every registry (post-uncertainty recovery). Sound only if every sender keeps a registry; withoutPOLY_ORDER_LOGbehavior is unchanged.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 52 lines · 689 tokens per session scan A 004a69eee867
pmq AGENTS.md is an instructions file published in the GitHub repository crp4222/pmq (0 stars, last pushed 1mo ago), licensed MIT. It adds 689 tokens to every session, about $0.0034 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
parlay-mcp GEMINI.md
Instructions for parlay-run/parlay-mcp, covering parlay — prediction market tools, what this is, when to use which tool, venue coverage (phase 1 validated) and critical caveats.
kalshi-trading-bot-cli AGENTS.md
Instructions for OctagonAI/kalshi-trading-bot-cli, covering repository guidelines, project structure, build, test, and development commands, coding style & conventions and llm providers.
polymarket-tennis CLAUDE.md
Instructions for livetennisapi/polymarket-tennis: This package is the data layer for Polymarket tennis trading: market discovery (Polymarket Gamma API, keyless), market↔live-match matching (never guesses; returns None on ambiguity), and a joined LiveMarketView of market price vs live score.
polymarket-agent-mcp CLAUDE.md
Claude Code instructions for demwick/polymarket-agent-mcp, covering claude.md, build & test commands, architecture, entry point & mcp server and layers.
polymarket-sports-analysis CLAUDE.md
Instructions for sarviinageelen/polymarket-sports-analysis, covering claude.md, project overview, commands, install dependencies (uses venv with python 3.12) and run tests.
polymarket-agents CLAUDE.md
Instructions for ryan-yuuu/polymarket-agents, covering claude.md, commands, install dependencies, start the system (three separate terminals) and optional flags.