OracleRiskMonitor
OracleRiskMonitor watches the UMA Optimistic Oracle queue for proposals and active disputes on markets where open positions exist.
What it does
OracleRiskMonitor watches the UMA Optimistic Oracle queue for proposals and active disputes on markets where open positions exist. When a market enters a resolution proposal or a dispute window, the bot can block new orders on that market, require reduced size, or flag a position for review. It protects against the scenario where a trade is submitted into a market moments before a contested resolution flips the outcome. It never overrides the strategy intent or changes the direction of an order — it only controls whether and how much the order is permitted to proceed.
Pipeline placement
Applies to: Every OrderIntent on markets that use the UMA Optimistic Oracle for resolution
Why it matters
| If this fails | Consequence |
|---|---|
| Trading into an active oracle dispute | A position opened after a dispute was filed may be immediately underwater if the dispute resolves against the expected outcome; the resolution risk was not priced in. |
| Holding a full position through the proposal window | Markets entering their proposal phase have uncertain resolution timing. Holding full size through this window increases exposure to a binary outcome that cannot be hedged once the proposal is live. |
| Stale oracle status | If the oracle queue feed is unavailable, a strategy could open or increase a position without knowing a dispute is already active. The safe behaviour is to block, not to approve on missing data. |
| Neg-risk market definition shift during proposal | On neg-risk markets, the 'Other' outcome definition can shift if a proposal is disputed, potentially invalidating the expected payout structure. |
Inputs
Polymarket inputs
| Input | Source | Required | Use |
|---|---|---|---|
| Market resolution-source flag and dispute window metadata | Gamma API | required | Identify whether the market uses the UMA oracle and retrieve the resolution window start and end times. |
| UMA Optimistic Oracle on-chain proposal and dispute events | UMA Optimistic Oracle | required | Detect when a proposal has been submitted or a dispute has been filed for a market relevant to open positions or pending orders. |
| Open position list with market identifiers | Data API | required | Cross-reference oracle events against markets where the account currently holds a position, to determine which events require action. |
| Neg-risk flag per market | Gamma API | optional | Apply stricter reduce_at_proposal_pct on neg-risk markets, as definition shifts can affect multiple related markets simultaneously. |
Internal inputs
| Input | Source | Required | Use |
|---|---|---|---|
| Current position size per market | PortfolioGuard | required | Calculate the maximum allowed position size after applying reduce_at_proposal_pct during the proposal window. |
| KillSwitch active flag | KillSwitch | required | If KillSwitch is active, reject all orders without checking oracle status. |
Authority
What this bot is permitted to do
State
Readiness
General live
Status
live
Class
Guardrail
Default mode
general_live
Developer owner
Polytraders core — Risk pod
Capital impact
Direct
Reason codes emitted
| Code | Severity | Meaning | Action |
|---|---|---|---|
| KILL_SWITCH_ACTIVE | HARD_REJECT | Global kill switch is active. | Immediately return HARD_REJECT without oracle lookup. |
| STALE_MARKET_DATA | HARD_REJECT | Oracle feed or market metadata is older than the staleness threshold. | Return HARD_REJECT; retry on next fresh fetch. |
| ORACLE_DISPUTE_ACTIVE | HARD_REJECT | An active UMA dispute is filed for this market; outcome is contested on-chain. | Return HARD_REJECT if block_disputed=true. |
| ORACLE_RESOLUTION_PENDING | RESHAPE | Market is in the 2-hour UMA proposal window but no dispute has been filed yet. | Return RESHAPE_REQUIRED with cap = reduce_at_proposal_pct * per_market_limit. |
| ORACLE_PROPOSER_BOND_BELOW_MIN | HARD_REJECT | The UMA proposer bond for this market is below the required 750 pUSD minimum, indicating a misconfigured or suspicious market. | Return HARD_REJECT; log market_id and observed bond amount. |
| ORACLE_RESOLUTION_CONFIDENCE_DOWNGRADE | RESHAPE | Market is more than 50% through its proposal window; size cap is further reduced proportionally. | Apply downgrade formula: cap = cap * (1 - proposal_fraction * 0.5). |
| ORACLE_NEGRISK_PROPOSAL_REDUCTION | RESHAPE | NegRisk market in proposal window; extra 20% size reduction applied due to definition-shift risk. | Apply 0.8 multiplier to cap before emitting RESHAPE_REQUIRED. |
| ORACLE_DISPUTE_OVERDUE | WARN | Dispute age exceeds max_dispute_window_h; escalation required. | Emit WARN annotation and escalate to incident commander; continue blocking per block_disputed. |
Related bots in Risk Guardrail
Used by
Reverse index — strategies that currently reference risk.oracleriskmonitor. If you change this bot's authority or reason codes, these strategies must re-pass shadow.
| Strategy | State | Activity |
|---|---|---|
| US Elect — book-builder | demo-wired | last triggered 15m ago |
| NBA H2H — moneyline market-make | demo-wired | last triggered 22m ago |
| US Elections — sentiment fade | demo-wired | last triggered 29m ago |
Showing 3 of 3 · demo-wired ≠ production-live
Why this matters
Risk Guardrail bots does NOT propose intents or sign orders; only permits or blocks. Understanding the authority boundary prevents misuse and makes promotion-gate reviews faster and more reliable. View raw spec JSON →