mostlyright.finance.transcripts.polymarket_derive
Polymarket earnings-mention derive + webcast provider fingerprint.
Two jobs, both following mostlyright.markets.polymarket’s URL
classification:
detect_provider()— name the webcast provider (q4/notified/globalmeet/choruscall/self_hosted) from a webcast URL. AWEBCAST_HOST_ALLOWLISTnetloc check runs before any classification, the same security checkRESOLUTION_SOURCE_ALLOWLISTperforms: a host not on the allowlist is refused (returnsNone) and never fingerprinted from a raw substring.derive()— turn an untrusted Polymarket event payload into a frozenEarningsResolution, orNonewhen the event is not an earnings-mention market, the ticker is unknown, or the webcast host is not allowlisted. An ambiguous payload is refused rather than defaulted, as elsewhere in the Polymarket path. A postponed or cancelled call maps toresolution_status="no_qualifying_event".
Module Attributes
Section titled “Module Attributes”| Attribute | Description |
|---|---|
WEBCAST_HOST_ALLOWLIST | Netloc allowlist for webcast / resolution-source hosts. |
Functions
Section titled “Functions”| Function | Description |
|---|---|
derive(event) | Derive a frozen EarningsResolution from a Polymarket event payload. |
detect_provider(webcast_url) | Name the webcast provider for webcast_url, or None. |
mostlyright.finance.transcripts.polymarket_derive.WEBCAST_HOST_ALLOWLIST : frozenset[str]
Section titled “mostlyright.finance.transcripts.polymarket_derive.WEBCAST_HOST_ALLOWLIST : frozenset[str]”Netloc allowlist for webcast / resolution-source hosts. A host not on this
list is refused before any provider classification or derive, the same way
mostlyright.markets.polymarket.RESOLUTION_SOURCE_ALLOWLIST works.
These are the exact public webcast hosts the fingerprints represent; a
substring fingerprint alone is not a trust decision, the allowlist is.
mostlyright.finance.transcripts.polymarket_derive.derive(event)
Section titled “mostlyright.finance.transcripts.polymarket_derive.derive(event)”Derive a frozen EarningsResolution from a Polymarket event payload.
The payload is untrusted. The derive refuses (returns None) when:
- the slug/title does not look like an earnings-mention market;
- the
tickeris missing or not inEARNINGS_SERIES_ROSTER; - a
webcast_urlis present but its host is not onWEBCAST_HOST_ALLOWLIST(refused before anything is derived); target_wordorevent_dateis missing or unparseable.
A postponed or cancelled call yields a resolution with
resolution_status="no_qualifying_event".
- Return type:
EarningsResolution|None - Parameters: event (dict [str , Any ])
mostlyright.finance.transcripts.polymarket_derive.detect_provider(webcast_url)
Section titled “mostlyright.finance.transcripts.polymarket_derive.detect_provider(webcast_url)”Name the webcast provider for webcast_url, or None.
The host is first checked against WEBCAST_HOST_ALLOWLIST: a
non-allowlisted host returns None and is never fingerprinted from a raw
substring, so a hostile evil.example/q4inc cannot spoof a provider. An
allowlisted host is then matched against
WEBCAST_PROVIDER_FINGERPRINTS
by host substring.