Skip to content
Back to search

oracle3-prediction-market-agent

Oracle3: open-source trading engine and MCP server for prediction markets. Finds fee-adjusted no-arbitrage violations across related event contracts and trades them live on Kalshi, Polymarket and Solana, or on paper, under pre-trade risk limits. 13 MCP tools, JSON CLI, agent skills, 600+ tests.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/YichengYang-Ethan/oracle3-prediction-market-agent with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/YichengYang-Ethan/oracle3-prediction-market-agent'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/yichengyang-ethan--oracle3-prediction-market-agent/badge.svg)](/listings/yichengyang-ethan--oracle3-prediction-market-agent)

HTML

<a href="/listings/yichengyang-ethan--oracle3-prediction-market-agent"><img src="/api/listings/yichengyang-ethan--oracle3-prediction-market-agent/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 138 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. <!-- mcp-name: io.github.YichengYang-Ethan/oracle3 -->
  2. # Oracle3
  3. **Build prediction-market agents that discover markets, analyze opportunities, and test strategies.**
  4. Connect AI agents to Kalshi and Polymarket through MCP. Give them reusable Skills for market research and strategy development, then build on a Python engine for paper and live execution.
  5. **14 MCP tools · 6 agent Skills · Kalshi & Polymarket data · Python 3.10+**
  6. [![Tests](https://github.com/YichengYang-Ethan/oracle3-prediction-market-agent/actions/workflows/pytest.yml/badge.svg)](https://github.com/YichengYang-Ethan/oracle3-prediction-market-agent/actions/workflows/pytest.yml)
  7. [![GitHub stars](https://img.shields.io/github/stars/YichengYang-Ethan/oracle3-prediction-market-agent?style=social)](https://github.com/YichengYang-Ethan/oracle3-prediction-market-agent/stargazers)
  8. [![PyPI](https://img.shields.io/pypi/v/oracle3)](https://pypi.org/project/oracle3/)
  9. [![License](https://img.shields.io/badge/license-Apache%202.0-green)](LICENSE)
  10. [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.20062548.svg)](https://doi.org/10.5281/zenodo.20062548)
  11. [Quickstart](#quickstart) · [MCP tools](docs/mcp.md) · [Agent Skills](#reusable-agent-skills) · [Project and contributions](docs/research-review.md) · [Documentation](https://yichengyang-ethan.github.io/oracle3-prediction-market-agent/)
  12. ## Why Oracle3
  13. - **A connected research workflow.** Discover contracts, inspect their rules and order books, compare related outcomes, and track simulated positions.
  14. - **Calculations that include trading costs.** Five relationship checks return candidate baskets, per-leg fees, and calculated net edge.
  15. - **Tools and workflows for agents.** Use MCP for structured access and Skills for repeatable research, strategy authoring, and operations.
  16. - **An engine you can extend.** Build strategies with Python interfaces, risk controls, and paper/live venue adapters.
  17. - **A foundation for experiments.** Reproducible software checks, automated tests, and installed-package validation make the implementation inspectable.
  18. Public Kalshi and Polymarket market reads need no exchange credentials. MCP provides market data, calculations, and a local paper ledger; real-order execution uses the separate CLI/Python engine.
  19. ## Quickstart
  20. Install the current development checkout:
  21. ```bash
  22. git clone https://github.com/YichengYang-Ethan/oracle3-prediction-market-agent.git
  23. cd oracle3-prediction-market-agent
  24. python -m venv .venv
  25. .venv/bin/python -m pip install -e .
  26. ```
  27. Connect it to Claude Code from this directory:
  28. ```bash
  29. claude mcp add oracle3 -- "$PWD/.venv/bin/oracle3-mcp"
  30. ```
  31. For other MCP clients, configure the absolute path to `.venv/bin/oracle3-mcp` as the command with an empty argument list. On Windows, use `.venv\Scripts\python.exe` and `.venv\Scripts\oracle3-mcp.exe`.
  32. [Client configuration and first tool call](docs/agent-quickstart.md) · [Published-package installation](docs/mcp.md)
  33. ### Give your agent a first task
  34. > Find Kalshi and Polymarket contracts about the next Fed rate decision. Compare their outcome definitions, resolution rules, and order-book quotes. Summarize the markets with their IDs, prices, and the assumptions needed to compare them.
  35. For a calculation that works offline after installation:
  36. > Use Oracle3 to check an implication: A implies B. A has a YES bid of $0.60 and B has a YES ask of $0.55. Use the default Kalshi taker fee schedule and 100 contracts per leg. Show the basket, gross edge, fees, and net edge.
  37. The synthetic example returns **$5.00 gross edge − $3.4125 fees = $1.5875 calculated net edge**, conditional on the supplied implication and quotes. [See exact inputs and output](docs/agent-quickstart.md#first-call-a-deterministic-fee-check).
  38. ## What agents can do
  39. | Task | Tools | Result |
  40. |---|---|---|
  41. | Discover markets | `search_markets`, `get_market` | Contracts, metadata, and available resolution rules |
  42. | Inspect market conditions | `get_quote`, `get_orderbook` | Prices, fee information, and displayed depth |
  43. | Analyze related contracts | `check_constraint`, `check_constraint_live` | Baskets and net edge under a stated relationship |
  44. | Calculate fees and model values | `trading_fee`, `fair_value` | Fee estimates and parameterized model outputs |
  45. | Get a calibrated probability | `model_probability` | A machine-learning probability next to the market price, with the model's out-of-sample scores ([how it was built and tested](docs/ml.md)) |
  46. | Try a paper entry | `paper_order`, `paper_portfolio` | Simulated fills and holdings in a local ledger |
  47. Relationship checks cover **implication, exclusivity, complement, same event, and event sum**. They expose assumptions with their results, giving agents and researchers a common calculation layer.
  48. [All 14 MCP tools](docs/mcp.md) · [Workflow examples](docs/agent-quickstart.md)
  49. ## Reusable agent Skills
  50. The repository includes six workflows that help agents move from individual tool calls to complete tasks:
  51. | Skill | Use it to |
  52. |---|---|
  53. | [Data discovery](skills/pm-data-discovery/SKILL.md) | Find markets and organize research inputs |
  54. | [Constraint arbitrage](skills/pm-constraint-arbitrage/SKILL.md) | Examine related contracts and calculate fee-aware baskets |
  55. | [Quant strategy authoring](skills/pm-quant-strategy-authoring/SKILL.md) | Develop strategies with Oracle3's Python interfaces |
  56. | [Agent strategy authoring](skills/pm-agent-strategy-authoring/SKILL.md) | Build agent-driven decision workflows |
  57. | [Paper operations](skills/pm-paper-trade-ops/SKILL.md) | Run and inspect simulated trading sessions |
  58. | [Live operations](skills/pm-live-trade-ops/SKILL.md) | Configure and operate the separate live engine |
  59. Claude Code project copies are included in [`.claude/skills/`](.claude/skills/). Open the checkout as your project, or use your client's supported Skill installation mechanism. [Skill setup](docs/agent-quickstart.md#agent-skills).
  60. **For AI agents:** start with [`llms.txt`](llms.txt) for task routing, the [MCP reference](docs/mcp.md) for tool schemas, and [`AGENTS.md`](AGENTS.md) for contributing code.
  61. ## Build with Python and the CLI
  62. Use the same project for research scripts, agent strategies, and engine operations:
  63. ```bash
  64. .venv/bin/oracle3 market search --exchange kalshi --query "fed" --json
  65. .venv/bin/oracle3 market search --exchange polymarket --query "fed decision" --json
  66. ```
  67. | Component | Build with it |
  68. |---|---|
  69. | [MCP server](oracle3/mcp_server/) | Structured market access and local paper operations for agents |
  70. | [Relations and fees](oracle3/arbitrage.py) | Shared calculations for related-contract strategies |
  71. | [Strategies](oracle3/strategy/) | Logical-relation, statistical, and model-driven approaches |
  72. | [Trading engine](oracle3/trader/) | Paper/live adapters for Kalshi, Polymarket, and Solana via DFlow |
  73. | [Pricing](oracle3/pricing/) | Wang-transform models and estimators for research |
  74. | [oracle3-extras](https://github.com/YichengYang-Ethan/oracle3-extras) | Optional venue, data-provider, and wallet integrations |
  75. [CLI guide](docs/CLI_MONITORING.md) · [Integration guide](docs/extras.md) · [Execution reference](docs/runtime-integrity.md)
  76. ## Built for experimentation
  77. Oracle3 combines a concrete decision environment with structured tools, observable state, and a software validation harness. This supports work on agent interfaces, workflow guidance, and reproducible evaluation.
  78. [CI](https://github.com/YichengYang-Ethan/oracle3-prediction-market-agent/actions/workflows/pytest.yml) runs automated tests and checks the built package through real MCP sessions on SDK 1.x and 2.x. The [harness documentation](docs/agent-harness.md) explains the reproducible checks. Model-level agent evaluation is a next research direction.
  79. [Project overview and Yicheng Yang's contributions](docs/research-review.md) · [Fee-frontier study](docs/research/fee-frontier.md) · [Companion pricing research](https://github.com/YichengYang-Ethan/prediction-market-pricing)
  80. ## Contribute
  81. Help build better agent workflows, labeled evaluation tasks, strategy examples, and client integrations. New venue, data-provider, and wallet integrations start in [oracle3-extras](https://github.com/YichengYang-Ethan/oracle3-extras).
  82. [Contributing guide](.github/CONTRIBUTING.md) · [Open problems](https://github.com/YichengYang-Ethan/oracle3-prediction-market-agent/issues?q=is%3Aissue+label%3Aopen-problem) · [Discussions](https://github.com/YichengYang-Ethan/oracle3-prediction-market-agent/discussions)
  83. ## Origin and attribution
  84. Oracle3 began as `ulab-uiuc/oracle3`, developed by Yicheng Yang and Haofei Yu at U Lab (University of Illinois Urbana-Champaign). It also bundles the lab's [Coinjure](https://github.com/ulab-uiuc/coinjure) package. Yicheng Yang continues to develop and maintain the extensions in this repository. [Read the project story and contributions](docs/research-review.md).
  85. We acknowledge the foundational work of the Coinjure team at the University of Illinois Urbana-Champaign—Haofei Yu, Yicheng Yang, Yuxiang Liu, and Prof. Jiaxuan You—on which Oracle3 builds.
  86. For software citation, use [CITATION.cff](CITATION.cff) and [Zenodo](https://doi.org/10.5281/zenodo.20062548). For the pricing model, see the [working paper](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=6468338).
  87. ## License
  88. Apache 2.0; see [LICENSE](LICENSE). Original U Lab and Coinjure portions retain their MIT license in [NOTICE](NOTICE).
  89. *This software is for research and education. Trading involves financial risk.*

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.