Skip to content

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. A WEBCAST_HOST_ALLOWLIST netloc check runs before any classification, the same security check RESOLUTION_SOURCE_ALLOWLIST performs: a host not on the allowlist is refused (returns None) and 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, 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 to resolution_status="no_qualifying_event".
AttributeDescription
WEBCAST_HOST_ALLOWLISTNetloc allowlist for webcast / resolution-source hosts.
FunctionDescription
derive(event)Derive a frozen EarningsResolution from a Polymarket event payload.
detect_provider(webcast_url)Name the webcast provider for webcast_url, or None.

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 ticker is missing or not in EARNINGS_SERIES_ROSTER;
  • a webcast_url is present but its host is not on WEBCAST_HOST_ALLOWLIST (refused before anything is derived);
  • target_word or event_date is missing or unparseable.

A postponed or cancelled call yields a resolution with resolution_status="no_qualifying_event".

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.

  • 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)