Skip to content

mostlyright.markets.earnings.resolver

Kalshi earnings-mention resolver (Phase 27, 27-05).

KXEARNINGSMENTION{TICKER} / KXMENTIONEARN{TICKER} / KXBRKEM markets resolve on whether a target word is said by a company representative on a given earnings call. resolve(contract_id, event_date, target_word=...) is the deterministic mapping from a Kalshi market identifier to the frozen EarningsResolution tuple downstream code uses (CONTEXT §4 step 0).

This mirrors mostlyright.markets.catalog.kalshi_nhigh:

  • prefix dispatch over the (here THREE) root variants, suffix = ticker;
  • the suffix ticker is validated against the codegen’d EARNINGS_SERIES_ROSTER — a per- company enumeration, NEVER a global status=open sweep (EARN-27-03: the sweep loops over high-volume sports series and never reaches earnings-mention before timeout — RESEARCH-MARKETS §1.3);
  • event_date is a calendar date with NO time component — a datetime is rejected with TypeError (the coerceContractDate-style guard copied from kalshi_nhigh verbatim) because the time component would break the date-equality settlement match.
resolve(contract_id, event_date, *, target_word)Resolve a Kalshi earnings-mention contract to its frozen tuple.
EarningsResolution(ticker, target_word, …)The frozen tuple a Kalshi earnings-mention contract resolves to.

class mostlyright.markets.earnings.resolver.EarningsResolution(ticker, target_word, event_date, resolution_rule, resolution_status=‘qualifying_event’)

Section titled “class mostlyright.markets.earnings.resolver.EarningsResolution(ticker, target_word, event_date, resolution_rule, resolution_status=‘qualifying_event’)”

Bases: object

The frozen tuple a Kalshi earnings-mention contract resolves to.

Mirrors NHighResolution: an immutable (ticker, target_word, event_date, resolution_rule) carrier so a resolution cannot be mutated downstream (the frozen-tuple contract the TS twin mirrors via Object.freeze in W3/27-07).

  • Parameters:
    • ticker (str)
    • target_word (str)
    • event_date (date)
    • resolution_rule (str)
    • resolution_status (str)

Whether a qualifying call exists for this date. "qualifying_event" for a normal resolution; "no_qualifying_event" when the Polymarket derive sees a postponed/cancelled call (RESEARCH-MARKETS §2.1(6)). Defaulted so the Kalshi resolve path is unchanged.

mostlyright.markets.earnings.resolver.resolve(contract_id, event_date, , target_word)

Section titled “mostlyright.markets.earnings.resolver.resolve(contract_id, event_date, , target_word)”

Resolve a Kalshi earnings-mention contract to its frozen tuple.

The contract_id is the Kalshi market identifier — one of the three root variants KXEARNINGSMENTION<TICKER> (e.g. KXEARNINGSMENTIONNKE), KXMENTIONEARN<TICKER>, or the Berkshire fixed root KXBRKEM. The suffix is the ticker; it is validated against EARNINGS_SERIES_ROSTER.

  • Parameters:
    • contract_id (str) – Kalshi market identifier. Case-insensitive.
    • event_date (date) – The calendar date the call airs / the market settles for. Must be a datetime.date with NO time component.
    • target_word (str) – The word/phrase the market resolves on. Required, non-empty.
  • Return type: EarningsResolution
  • Returns: A frozen EarningsResolution.
  • Raises:
    • TypeErrorcontract_id is not a string, event_date is a datetime (or any non-date), or target_word is not a string.
    • ValueErrorcontract_id matches no known root, the ticker suffix is empty, the ticker is not in EARNINGS_SERIES_ROSTER, or target_word is empty.