⚠ INTERNAL — Operator UX mock · Design preview of V2 development path · demo-wired ≠ production-live · back to dev guide
Polygon · pUSD 10
📓 Developer Guide 📋 Reason Codes 📈 Shadow Mode
JD John Doe · Admin

MarketOntologyBuilder

intel.marketontologybuilder
Intelligence planned Spec started frozen

Cluster markets into events, themes, and underlying entities for cross-market reasoning.

What it does

Cluster markets into events, themes, and underlying entities for cross-market reasoning.

Pipeline placement

runs after: — MarketOntologyBuilder runs before: —

Applies to:

Why it matters

If this failsConsequence
Cross-market correlation invisible to RiskWithout an ontology, PortfolioGuard sees fifty independent markets where the underlying ontology says they all resolve on the same NFL game. Aggregate exposure to a single real-world event is then dramatically under-counted.
Worked example
Setup: An NFL game has 47 listed markets: moneyline, spread, total points, first scorer, three-way, plus 42 props. Strategies enter independently on 9 of them, total notional 18,000 pUSD.
Without bot: PortfolioGuard sees nine separate small positions, each within its 5,000 pUSD per-market cap. None breaches the 10,000 pUSD per-event cap because there is no concept of 'event'.
With bot: MarketOntologyBuilder maps all 47 markets to event_id=`nfl-2026-w12-buf-mia`. PortfolioGuard sums the 9 positions to 18,000 pUSD against that event, breaches the cap, and rejects the next entry on any of the 47.
Strategies can't compose multi-market positionsCross-market arbitrage and hedging strategies need a structured map of which markets share an underlying. Hand-curated lists drift; a generated ontology stays in sync as new markets list each day.
Search and discovery degrade as the catalogue growsWith ten thousand listed markets and no ontology, MarketScanner becomes a substring search. Themed events and entity-level queries — 'all markets resolving on US election' — require structured clusters.
Reconciliation can't verify outcome correctnessWhen a real-world event fires, gov.reconciler needs to confirm every market that should have resolved did. Without an ontology mapping events to markets, that check is manual.

Inputs

Polymarket inputs

InputSourceRequiredUse
Full active market list with tags and categories from Gamma APIgammarequiredPrimary data source for building the market category ontology.
Tag taxonomy from Data APIdataoptionalSupplement Gamma tag data with canonical tag hierarchy.

Internal inputs

InputSourceRequiredUse
KillSwitch active flagKillSwitchrequiredSuppress all ontology build emissions when KillSwitch is active.

Authority

What this bot is permitted to do

Read-only

State

Readiness

Spec started

Status

planned

Class

Signal Service

Default mode

shadow_only

Developer owner

Polytraders core

Capital impact

Indirect

Reason codes emitted

CodeSeverityMeaningAction
MARKETONTOLOGYBUILDER_ONTOLOGY_CHANGEDINFOOntology hash changed since last build cycle; new markets or category changes detected.Emit ObservationReport with updated ontology hash; downstream consumers reload ontology.
STALE_DATAWARNGamma API returned empty or zero markets during build cycle.Skip build; retain last ontology; retry on next poll.
KILL_SWITCH_ACTIVEHARD_REJECTKillSwitch active; all ontology build emissions suppressed.Continue internal builds but suppress ObservationReport emissions.
MARKETONTOLOGYBUILDER_TAG_COUNT_DROPWARNTag count decreased by more than expected between cycles, possibly due to Gamma API truncation.Emit with tag_count_drop warning; do not replace last full ontology.

Used by

Reverse index — strategies that currently reference intel.marketontologybuilder. If you change this bot's authority or reason codes, these strategies must re-pass shadow.

StrategyStateActivity
Crypto Q2 — basket rebalancefrozenlast triggered 23m ago
US Elect — book-builderdemo-wiredlast triggered 30m ago

Showing 2 of 2 · demo-wired ≠ production-live

Why this matters

Intelligence bots does NOT propose, veto, sign, or execute any trade. Understanding the authority boundary prevents misuse and makes promotion-gate reviews faster and more reliable. View raw spec JSON →
Polytraders Operator UX Mock · INTERNAL · demo-wired ≠ production-live · the plan · reason codes · shadow-mode pipeline
⚙ Page Configuration
Current page settings
Loading configuration…