mostlyright.markets.earnings.resolver
mostlyright.markets.earnings.resolver
Section titled “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 globalstatus=opensweep (EARN-27-03: the sweep loops over high-volume sports series and never reaches earnings-mention before timeout — RESEARCH-MARKETS §1.3); event_dateis a calendar date with NO time component — adatetimeis rejected withTypeError(thecoerceContractDate-style guard copied fromkalshi_nhighverbatim) because the time component would break the date-equality settlement match.
Functions
Section titled “Functions”resolve(contract_id, event_date, *, target_word) | Resolve a Kalshi earnings-mention contract to its frozen tuple. |
|---|
Classes
Section titled “Classes”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:
event_date : date
Section titled “event_date : date”resolution_rule : str
Section titled “resolution_rule : str”resolution_status : str = ‘qualifying_event’
Section titled “resolution_status : str = ‘qualifying_event’”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.
target_word : str
Section titled “target_word : str”ticker : str
Section titled “ticker : str”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 adatetime.datewith NO time component. - target_word (
str) – The word/phrase the market resolves on. Required, non-empty.
- contract_id (
- Return type:
EarningsResolution - Returns:
A frozen
EarningsResolution. - Raises:
- TypeError –
contract_idis not a string,event_dateis adatetime(or any non-date), ortarget_wordis not a string. - ValueError –
contract_idmatches no known root, the ticker suffix is empty, the ticker is not inEARNINGS_SERIES_ROSTER, ortarget_wordis empty.
- TypeError –