@quill-io/sensor-polymarket
v0.1.1
Published
W2A sensor — poll Polymarket prediction-market odds and emit threshold-crossed signals
Maintainers
Readme
@quill-io/sensor-polymarket
A World2Agent sensor that watches a Polymarket prediction-market event and emits a market.threshold.crossed signal whenever any outcome's Yes price moves beyond a configured percentage-point threshold over a rolling baseline window.
Built for the workflow where you care about a specific market — leaderboards, race outcomes, model rankings — and want a low-noise heads-up only when consensus actually shifts.
What it does
- Polls Polymarket's Gamma API every
interval_seconds(default 600). - Persists rolling snapshots of every sub-market's Yes price.
- For each outcome, compares current price vs. the snapshot from
compare_window_hoursago (default 24). - If
|delta_pp| >= threshold_pp(default 3.0), emits one signal — then sleeps that outcome foralert_cooldown_hours(default 6) so you don't get spammed by oscillation. - Outcomes priced below
min_outcome_price(default 1%) are filtered to avoid noise on dead names.
Signal: market.threshold.crossed
| Field | What's in it |
|---|---|
| event.summary | One human-readable line: arrow + outcome + delta + baseline→current + lead context + days-to-resolution |
| source_event.data | outcome, previous_price, current_price, delta_pp, still_leader, leader_outcome, lead_margin_pp, days_to_resolution, volume_24h_usd, total_volume_usd, market_id |
| attachments[0] | Top-5 outcomes baseline→current diff (inline text) |
| attachments[1] | Reference URI to the live Polymarket event page |
Example summary:
▼ Anthropic 24h -4.5pp (46.1% → 41.6%) — Which company has best AI model end of June?;
仍居第一,领先优势 9.1pp(vs Google 32.5%);24h成交 $78,342; 距结算 64 天Configuration
| Parameter | Type | Default | What it does |
|---|---|---|---|
| event_slug | string | which-company-has-best-ai-model-end-of-june | The slug after /event/ in a Polymarket URL |
| threshold_pp | number | 3.0 | Absolute pp delta that triggers a signal |
| compare_window_hours | number | 24 | Rolling baseline window |
| alert_cooldown_hours | number | 6 | Per-outcome cooldown after firing |
| interval_seconds | number | 600 | Poll interval |
| min_outcome_price | number | 0.01 | Skip outcomes below this Yes price |
Install
In a Claude Code session with the @world2agent/claude-code-channel plugin installed:
/world2agent:sensor-add @quill-io/sensor-polymarketThe install flow reads SETUP.md, runs a 3-question Q&A (which event, threshold, cooldown), writes the sensor entry to ~/.world2agent/config.json, and writes a per-user handler skill into your agent runtime's skills directory.
Resolution semantics
The default event resolves on the LMArena Chatbot Arena leaderboard on June 30, 2026, 12:00 PM ET — see Polymarket's resolution criteria on the event page. The sensor itself is generic; point it at any Polymarket event.
License
MIT
