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 fails | Consequence |
|---|---|
| Cross-market correlation invisible to Risk | Without 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 positions | Cross-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 grows | With 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 correctness | When 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
| Input | Source | Required | Use |
|---|---|---|---|
| Full active market list with tags and categories from Gamma API | gamma | required | Primary data source for building the market category ontology. |
| Tag taxonomy from Data API | data | optional | Supplement Gamma tag data with canonical tag hierarchy. |
Internal inputs
| Input | Source | Required | Use |
|---|---|---|---|
| KillSwitch active flag | KillSwitch | required | Suppress 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
| Code | Severity | Meaning | Action |
|---|---|---|---|
| MARKETONTOLOGYBUILDER_ONTOLOGY_CHANGED | INFO | Ontology hash changed since last build cycle; new markets or category changes detected. | Emit ObservationReport with updated ontology hash; downstream consumers reload ontology. |
| STALE_DATA | WARN | Gamma API returned empty or zero markets during build cycle. | Skip build; retain last ontology; retry on next poll. |
| KILL_SWITCH_ACTIVE | HARD_REJECT | KillSwitch active; all ontology build emissions suppressed. | Continue internal builds but suppress ObservationReport emissions. |
| MARKETONTOLOGYBUILDER_TAG_COUNT_DROP | WARN | Tag 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. |
Related bots in Intelligence
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.
| Strategy | State | Activity |
|---|---|---|
| Crypto Q2 — basket rebalance | frozen | last triggered 23m ago |
| US Elect — book-builder | demo-wired | last 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 →