Skip to main content
Yuming Yang

Projects / resolution-rule-lint

Resolution Rule Linter

Two prediction markets with the same headline can settle differently. Which words decide it?

A linter that reads the contract terms Kalshi and Polymarket US file with the CFTC, flags what a resolution rule leaves open, and compares two rules field by field. Regular expressions only, so every value points at the text it came from. On ten held-out filings reviewed against the text it extracts 138 of 149 fields correctly.

RepositoryPython · regular expressions · CFTC filings · prediction markets
138 / 149
Fields extracted correctly on ten held-out filings reviewed against the text
4 / 6
Known disputes with a full CFTC filing that the linter flags in the dispute's category
100 / 100
Control edits to a filing that the diff correctly reports as no difference

01Problem

On a prediction market the headline is not the contract. Whether "Will the leader leave office?" pays Yes depends on what the rule says about death, which source decides, whether the event must happen or only be reported by the deadline, and whether a later revision counts. Two venues can list the same headline and settle it differently, and the difference is buried in the filing.

rrlint reads the rule text, flags what it leaves open, and compares two rules field by field. It is built on the contract terms that Kalshi and Polymarket US file with the CFTC, which are public regulatory records. It uses no language model, no price data, and no scraping of either venue's website.

02What it does

  • rrlint check lints one rule: a deadline with no time zone, a period whose endpoints are not stated, a trigger that does not say whether the event must happen or be reported, a single source with no fallback, an undefined word that decides the outcome.
  • rrlint diff compares two rules and, for each field that differs, gives a scenario in which the two contracts settle differently.
  • rrlint check --card writes a one-page plain-English card of what decides the contract.
  • rrlint report summarises rule quality by venue and year, and what amendments change.

03Results

EvaluationResult
Field extraction, 10 reviewed held-out filings92.6%: 138 of 149 fields
Field extraction, 31 filings the rules were tuned on97.4% (draft labels)
One-field edits to 60 filingsedited field reported in 85–100% of pairs; 100 of 100 controls clean
Known disputes with a full CFTC filing4 of 6 flagged in the dispute's category
  • The held-out split was committed before any rule, and no rule changed after the test score was seen. The gap between 97.4% and 92.6% is the overfitting the split was set up to measure.
  • The weakest fields are judgement calls. source_kind is right on 6 of the 10 reviewed filings; it and trigger_basis depend on reading more than on wording.
  • Dispute recall on titles is not informative. Most dispute texts are titles or fragments quoted in news coverage, where almost every rule fires; the figure that means something is the six cases with a full filing.

04Five differences between the venues

Each was checked against both filings; one was corrected in the process.

  1. A leader's death. Kalshi settles a departure caused only by death at the last traded price; the Polymarket US terms do not mention death.
  2. Which weather record. Polymarket US snowfall and temperature contracts settle on the NWS Daily Climate Report; Kalshi's 2026 snowfall and rain contracts put The Weather Company first.
  3. Which Dow number. Polymarket US reads a Chainlink feed at 3:55 PM ET; Kalshi uses the official close.
  4. A moment versus a window. Both use CF Benchmarks for bitcoin, but one asks about the value at one time and the other about a one-hour average by a deadline.
  5. Which release. Some Polymarket US contracts fix the first published value; Kalshi counts revisions until expiration.

05Design trade-offs

  • Rules, not a model. A model would do better on judgement fields. It was left out to avoid paid calls and because Kalshi's data terms forbid machine-learning use; in exchange, every value points at the span of text it came from.
  • CFTC filings, not venue websites. The filings are public and come with redlines. The cost is that they are templates, not the listed contracts with their dates and strikes.
  • No filing text in the repository. Only metadata, URLs and SHA-256 hashes; a command re-downloads and checks every document.
  • "Undetermined" over "equivalent". Two rules that are both silent on their source are never reported as the same.

06Limitations

  • Text is not the whole rule: each venue's rulebook and clarifications issued after listing also decide settlement.
  • Ten reviewed filings is a small sample, and the review is a second reading of the same guidelines, not an independent annotation. Dispute, pair and false-alarm labels are still drafts.
  • Documents for 426 of 5,428 indexed filings were downloaded; it is a sample, not a census.
  • It reports what a text leaves open, not how a dispute should be settled.

07Status

Version 1 is public under the MIT licence. Tests run offline on synthetic rules, and CI runs lint and tests on every push.

← All projects