mostlyright.markets.earnings.polymarket_derive
mostlyright.markets.earnings.polymarket_derive
Section titled “mostlyright.markets.earnings.polymarket_derive”Polymarket earnings-mention derive + webcast provider fingerprint (27-05).
Two jobs, both mirroring mostlyright.markets.polymarket’s Tier-1.5 URL
classification:
detect_provider()— name the webcast provider (q4/notified/globalmeet/choruscall/self_hosted) from a webcast URL. AWEBCAST_HOST_ALLOWLISTnetloc guard runs BEFORE any classification (the security boundary mirroringRESOLUTION_SOURCE_ALLOWLIST): a host not on the allowlist is refused (returnsNone), 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 / the webcast host is non-allowlisted. Ambiguous → refuse, never silently default (the polymarket refuse-to-settle discipline). A postponed / cancelled call maps toresolution_status="no_qualifying_event".
Module Attributes
Section titled “Module Attributes”WEBCAST_HOST_ALLOWLIST | Netloc allowlist for webcast / resolution-source hosts. |
|---|
Functions
Section titled “Functions”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.markets.earnings.polymarket_derive.WEBCAST_HOST_ALLOWLIST : frozenset[str] = frozenset({‘cdn.q4cdn.com’, ‘edge.media-server.com’, ‘event.choruscall.com’, ‘event.webcasts.com’, ‘events.q4inc.com’, ‘veracast.com’, ‘www.veracast.com’, ‘www.youtube.com’, ‘youtube.com’})
Section titled “mostlyright.markets.earnings.polymarket_derive.WEBCAST_HOST_ALLOWLIST : frozenset[str] = frozenset({‘cdn.q4cdn.com’, ‘edge.media-server.com’, ‘event.choruscall.com’, ‘event.webcasts.com’, ‘events.q4inc.com’, ‘veracast.com’, ‘www.veracast.com’, ‘www.youtube.com’, ‘youtube.com’})”Netloc allowlist for webcast / resolution-source hosts. A host NOT on this
list is refused before any provider classification or derive (T-27-15) —
mirrors mostlyright.markets.polymarket.RESOLUTION_SOURCE_ALLOWLIST.
These are the exact public webcast hosts behind the CONTEXT §5 fingerprints
(a substring fingerprint alone is NOT a trust decision — the allowlist is).
mostlyright.markets.earnings.polymarket_derive.derive(event)
Section titled “mostlyright.markets.earnings.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(T-27-15 security boundary — refuse before derive); target_wordorevent_dateis missing / unparseable.
A postponed / cancelled call yields a resolution with
resolution_status="no_qualifying_event" (RESEARCH-MARKETS §2.1(6)).
- Return type:
EarningsResolution|None - Parameters: event (dict [str , Any ])
mostlyright.markets.earnings.polymarket_derive.detect_provider(webcast_url)
Section titled “mostlyright.markets.earnings.polymarket_derive.detect_provider(webcast_url)”Name the webcast provider for webcast_url, or None.
The host is first checked against WEBCAST_HOST_ALLOWLIST (the
security boundary): a non-allowlisted host returns None — it 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.