Skip to content

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. A WEBCAST_HOST_ALLOWLIST netloc guard runs BEFORE any classification (the security boundary mirroring RESOLUTION_SOURCE_ALLOWLIST): a host not on the allowlist is refused (returns None), never fingerprinted from a raw substring.
  • derive() — turn an untrusted Polymarket event payload into a frozen EarningsResolution, or None when 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 to resolution_status="no_qualifying_event".
WEBCAST_HOST_ALLOWLISTNetloc allowlist for webcast / resolution-source hosts.
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 ticker is missing or not in EARNINGS_SERIES_ROSTER;
  • a webcast_url is present but its host is NOT on WEBCAST_HOST_ALLOWLIST (T-27-15 security boundary — refuse before derive);
  • target_word or event_date is missing / unparseable.

A postponed / cancelled call yields a resolution with resolution_status="no_qualifying_event" (RESEARCH-MARKETS §2.1(6)).

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.

  • Return type: str | None
  • Returns: The canonical provider id ("q4" etc.), or None when the host is non-allowlisted or matches no fingerprint.
  • Parameters: webcast_url (str)