oracle3-prediction-market-agent
AGENTS.md309 starsChanged 2 months agoApache-2.0View on GitHub
Instructions for AI coding agents working in this repository. Humans may find it useful too. Oracle3 is a trading engine (live on Kalshi, Polymarket and Solana, or on paper) and an MCP server for prediction markets. It checks whether prices of related event contracts violate probability bounds after each venue's fees, and paper-trades the baskets that survive under pre-trade risk limits. See README.md. CI runs all four on every push to main. New code needs tests; venue APIs must be…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,736 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository14 other files it gives its agents.
- docs/llms.txtllms.txt
- llms.txtllms.txt
- pm-agent-strategy-authoringSkill
- pm-constraint-arbitrageSkill
- pm-data-discoverySkill
- pm-live-trade-opsSkill
- pm-paper-trade-opsSkill
- pm-quant-strategy-authoringSkill
- pm-agent-strategy-authoringSkill
- pm-constraint-arbitrageSkill
- pm-data-discoverySkill
- pm-live-trade-opsSkill
- pm-paper-trade-opsSkill
- pm-quant-strategy-authoringSkill
The file
We split this AGENTS.md into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 40
Default to paper: Never run oracle3 live run or any command that places real orders unless the user explicitly asks for live trading in …
- Very specific: line 44
Never print, commit or log credentials (KALSHI_*, POLYMARKET_*, Solana keypairs).
- Distinctive: line 50
Do not describe paper or backtest results as live performance, and do not add performance claims to the README without a reproducible …
- Very specific: line 51
Keep server.json, pyproject.toml, oracle3/__init__.py and CITATION.cff versions in sync (commitizen bumps all four).
≈ “Common” is an estimate: at least 1 in 5 of the 16,597 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
Instructions for AI coding agents working in this repository. Humans may find it useful too.
What this project is
Oracle3 is a trading engine (live on Kalshi, Polymarket and Solana, or on paper) and an MCP server for prediction markets. It checks whether prices of related event contracts violate probability bounds after each venue's fees, and paper-trades the baskets that survive under pre-trade risk limits. See README.md.
Setup and checks
poetry install --all-extras # Python 3.10+
poetry run pytest # tests (coverage report included)
ruff check . && ruff format . # lint and format (single quotes, 88 columns)
poetry run mypy --config-file pyproject.toml . # type check
codespell -c pyproject.toml # spellingCI runs all four on every push to main. New code needs tests; venue APIs must be mocked in tests (see tests/test_mcp_server.py for an httpx.MockTransport example).
Layout
| Path | Contents |
oracle3/fees.py | Kalshi and Polymarket fee schedules as published; per-market schedules from the venue APIs |
oracle3/arbitrage.py | Static no-arbitrage checks: implication, exclusivity, complement, same event, event sum |
oracle3/mcp_server/ | MCP server (oracle3 mcp or oracle3-mcp), public venue adapters, paper ledger |
oracle3/strategy/ | Strategies; contrib/ holds the constraint, statistical and model-driven ones |
oracle3/pricing/ | Wang-transform fair-value engine and estimators |
oracle3/market/ | Relation store and statistical validation of relations |
oracle3/trader/ | Paper and live traders, spread executor |
oracle3/cli/ | Click CLI (oracle3 ...) |
oracle3/experimental/ | Prototypes that are not on the trading path |
coinjure/ | Bundled package from the original U Lab codebase (MIT; see NOTICE) |
skills/ | Agent skills, mirrored to .claude/skills/ |
docs/ | MkDocs site, including docs/research/fee-frontier.md |
Safety rules
- Default to paper. Never run
oracle3 live runor any command that places real orders unless the user explicitly asks for live trading in this session. - Commands that only read data (safe to run):
oracle3 market ...,oracle3 news fetch,oracle3 trade status|state, and every MCP tool except thepaper_*ones.oracle3 research ...reads local history files and writes only to output paths you pass. - Commands with local side effects:
oracle3 paper run,oracle3 data record,oracle3 trade pause|resume|swap|stop|killswitch, and the MCPpaper_order/paper_resettools (local JSON ledger only). - Order-placing commands:
oracle3 live runand the live traders inoracle3/trader/. The MCP server imports none of them. - Never print, commit or log credentials (
KALSHI_*,POLYMARKET_*, Solana keypairs).
Conventions
- English only in code, comments, docs and commit messages.
- Fees come from
oracle3.fees; do not hard-code new fee constants. - Do not describe paper or backtest results as live performance, and do not add performance claims to the README without a reproducible script.
- Keep
server.json,pyproject.toml,oracle3/__init__.pyandCITATION.cffversions in sync (commitizen bumps all four).
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.

