mostlyright.finance.transcripts.resolver
Kalshi earnings-mention resolver.
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 used by downstream code.
It follows the same structure as mostlyright.markets.catalog.kalshi_nhigh:
- prefix dispatch over the three root variants, with the suffix as the ticker;
- the suffix ticker is validated against the codegen’d
EARNINGS_SERIES_ROSTER, a per-company enumeration rather than a globalstatus=opensweep, which loops over high-volume sports series and never reaches earnings-mention before timing out; event_dateis a calendar date with no time component. Adatetimeis rejected withTypeError, the same guardkalshi_nhighapplies and the TypeScript twin’scoerceContractDatemirrors, because the time component would break the date-equality settlement match.
Functions
Section titled “Functions”| Function | Description |
|---|---|
resolve(contract_id, event_date, *, target_word) | Resolve a Kalshi earnings-mention contract to its frozen tuple. |
Classes
Section titled “Classes”| Class | Description |
|---|---|
EarningsResolution(ticker, target_word, …) | The frozen tuple a Kalshi earnings-mention contract resolves to. |
class mostlyright.finance.transcripts.resolver.EarningsResolution(ticker, target_word, event_date, resolution_rule, resolution_status=‘qualifying_event’)
Section titled “class mostlyright.finance.transcripts.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.
Shaped like NHighResolution:
an immutable (ticker, target_word, event_date, resolution_rule) carrier,
so a resolution cannot be mutated downstream. The TypeScript twin freezes the
equivalent object with Object.freeze.
- Parameters:
event_date: date
Section titled “event_date: date”resolution_rule: str
Section titled “resolution_rule: str”resolution_status: str
Section titled “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 or cancelled call. It carries a default so the Kalshi
resolve path never has to set it.
target_word: str
Section titled “target_word: str”ticker: str
Section titled “ticker: str”mostlyright.finance.transcripts.resolver.resolve(contract_id, event_date, , target_word)
Section titled “mostlyright.finance.transcripts.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 –