Skip to content

Kalshi MarketOutcome label inconsistent. Kalshi UnifiedEvent description inconsistent. #69

Closed

Description

@Maxmokat
import pmxt
kalshi = pmxt.Kalshi()
kalshi_event_1 = kalshi.fetch_event(slug="kxcabout-26mar")
kalshi_event_2 = kalshi.fetch_event(slug="kxgovca-26")
print(kalshi_event_1)
print(kalshi_event_2)

Two issues for Kalshi, the first is the UnifiedEvent description. For kalshi_event_1 the description is description='If {x}0, 2026, then the market resolves to Yes.' Rather than the correct "If {x} is the first member of the Cabinet of Donald Trump to leave or announce they will leave (such as by quitting, being fired, or being impeached) after Mar 10, 2026, then the market resolves to Yes." I assume this is because the underlying code is looking for a common suffix to the description. However a new option was added to the event with slightly different suffix: "If Markwayne Mullin is the first member of the Cabinet of Donald Trump to leave or announce they will leave (such as by quitting, being fired, or being impeached) after Mar 30, 2026, then the market resolves to Yes."

Second is the label in MarketOutcome. In kalshi_event_1 the label is working as intended, however in kalshi_event_2 the label is label=':: Democratic' or label='Not :: Democratic'.

Activity

  1. 0xharryriddle commented on Apr 7, 2026

    @0xharryriddle
    Contributor

    Just opened PR #75 to solve this problem. Hope to review sir, @realfishsam

  2. realfishsam commented on Apr 9, 2026

    @realfishsam
    Contributor

    Fixed in 2.27.6 via #75 (plus follow-up hardening commits on the same branch).

    • UnifiedEvent.description no longer malforms when markets in the same event have slightly different trailing dates — replaced the prefix/suffix slicing with template-voting over rules_primary with the candidate name substituted for {x}.
    • MarketOutcome.label no longer surfaces structural :: Democratic values — label derivation now prefers yes_sub_title and ignores any value starting with ::.

    Additional hardening: only templates containing {x} are eligible to win the vote (so an untemplatable rule can never leak a candidate name into the event description), and Unicode-aware word boundaries so non-ASCII candidate names template correctly. Regression tests cover both original cases plus no-majority and non-ASCII edge cases.

    Merged to main as e3f7736. Will ship in the next npm/PyPI release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions