Inspiration

We both love finance and are writing a thesis on markets combined with AI and ML. Research shows prediction markets forecast well:

  • The Iowa Electronic Markets beat the polls 74% of the time across 964 polls in five US presidential elections (Berg, Nelson and Rietz, International Journal of Forecasting, 2008).
  • Markets predicted which psychology studies would replicate with 71% accuracy; surveys of the same researchers got 58% (Dreber et al., PNAS, 2015).
  • Internal markets at Google and Ford matched or beat the companies' own forecasts (Cowgill and Zitzewitz, Review of Economic Studies, 2015).

Teams running coding agents now produce more pull requests than humans can review. We used a market to decide which ones merge.

What it does

Every pull request opens a prediction market on one question: will this PR survive 14 days after merge without a revert or bug fix?

Four AI traders bet on it, each with different evidence: the diff, the tests, the security risk signals, and a skeptic reading the PR description. They trade through an LMSR market maker, and spend caps mean no single trader can force a merge.

The closing price becomes a GitHub status check. At 0.90 or above the PR can merge. Below 0.60 it's blocked. In between, the traders read each other's reasoning and trade again; if the price still lands in between, the PR is blocked. Merged PRs settle on what actually happens after merge, so accurate traders gain influence. Any error blocks the PR.

A repo plugs in with one config file and a webhook.

How we built it

Python, FastAPI and SQLite, with Claude Haiku and Sonnet as the traders. Agents only output probabilities; deterministic code runs trading, gating and settlement through an explicit state machine with an audit log.

We built it with parallel Claude Code agents, one per work package, each in its own git worktree. Hooks block commits to main and reading hidden tests or secrets. CI runs about 900 tests plus semgrep, gitleaks and pip-audit.

Challenges we ran into

We changed the settlement oracle mid-build, from hidden tests to post-merge outcomes, and the pipeline and league had to adapt in under an hour. Parallel agents sometimes defined the same types twice. Our own security checks flagged fake keys in tests, and we had to rewrite branch history.

Accomplishments that we're proud of

A real GitHub PR that removes an auth check goes red in about three seconds; a docstring PR goes green. No single agent can force a merge, and a test proves it.

What we learned

One LLM's probability means little alone. Diverse evidence, bankroll weighting and real settlement make the price useful. Parallel agents work fast when shared contracts are fixed first.

What's next for PRediction Markets

Automatic settlement for live GitHub PRs, published league results from real traders, judges betting against the agents, and a GitHub App for teams running coding agents. Finally we want to add more traders too. Maybe try some other models with that too. This is very expandable with more agents, different models, etc.

Built With

Share this project:

Updates

Submission history