polymarket-monitor
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePolymarket Monitor
Polymarket Monitor
Monitor live Polymarket prediction markets for price changes, volume spikes, and spread movements. Outputs structured JSON alerts when thresholds are crossed. All endpoints are read-only and require no API keys.
Prerequisite: This skill uses token IDs from the skill. Run first to discover markets and obtain token IDs.
polymarket-scannerscan_markets.py监控实时Polymarket预测市场的价格变动、交易量激增和价差波动,当阈值被触发时会输出结构化JSON警报。所有接口均为只读,无需API密钥。
前置依赖: 本skill使用来自 skill的代币ID,请先运行查找市场并获取代币ID。
polymarket-scannerscan_markets.pyQuick Start
快速开始
All scripts require the Python venv at .
/home/verticalclaw/.venv所有脚本需要使用路径为的Python虚拟环境。
/home/verticalclaw/.venvMonitor Multiple Markets for Price Alerts
监控多个市场的价格警报
bash
source /home/verticalclaw/.venv/bin/activate && python polymarket-monitor/scripts/monitor_prices.py \
--token-id "<TOKEN_ID_1>" \
--token-id "<TOKEN_ID_2>" \
--interval 30 \
--threshold 5.0This polls every 30 seconds and prints a JSON alert whenever a token's midpoint moves more than 5% from its baseline.
bash
source /home/verticalclaw/.venv/bin/activate && python polymarket-monitor/scripts/monitor_prices.py \
--token-id "<TOKEN_ID_1>" \
--token-id "<TOKEN_ID_2>" \
--interval 30 \
--threshold 5.0该命令每30秒轮询一次,当代币的中间价较基准值波动超过5%时会打印JSON警报。
Watch a Single Market Live
实时观察单个市场
bash
source /home/verticalclaw/.venv/bin/activate && python polymarket-monitor/scripts/watch_market.py \
--token-id "<TOKEN_ID>" \
--interval 15Prints a JSON snapshot every 15 seconds with price, spread, and order book depth.
bash
source /home/verticalclaw/.venv/bin/activate && python polymarket-monitor/scripts/watch_market.py \
--token-id "<TOKEN_ID>" \
--interval 15每15秒打印一次包含价格、价差和订单簿深度的JSON快照。
Scripts
脚本说明
monitor_prices.py
monitor_prices.py
Polls multiple tokens at a set interval and emits JSON alerts when price changes exceed a threshold.
Arguments:
- — CLOB token ID to monitor (repeatable, at least one required)
--token-id ID - — Polling interval in seconds (default: 30, minimum: 5)
--interval N - — Percentage change to trigger an alert (default: 5.0)
--threshold N - — Stop after N polls (default: unlimited, use for non-interactive runs)
--max-polls N - — Number of recent prices to average for baseline (default: 1, meaning compare to last poll)
--baseline-window N
Output: One JSON object per line for each alert:
json
{
"type": "price_alert",
"token_id": "...",
"timestamp": "2026-02-26T12:00:00Z",
"current_price": 0.65,
"baseline_price": 0.60,
"change_pct": 8.33,
"direction": "up",
"spread": 0.02,
"poll_number": 5
}Non-alert polls print a status line to stderr so the agent knows monitoring is active.
按照设定间隔轮询多个代币,当价格变动超过阈值时输出JSON警报。
参数:
- — 要监控的CLOB代币ID(可重复传入,至少需要一个)
--token-id ID - — 轮询间隔,单位为秒(默认:30,最小值:5)
--interval N - — 触发警报的价格变动百分比阈值(默认:5.0)
--threshold N - — 轮询N次后停止(默认:无限制,适用于非交互式运行)
--max-polls N - — 计算基准值所用的最近价格平均数量(默认:1,即与上一次轮询结果对比)
--baseline-window N
输出: 每次警报输出一行JSON对象:
json
{
"type": "price_alert",
"token_id": "...",
"timestamp": "2026-02-26T12:00:00Z",
"current_price": 0.65,
"baseline_price": 0.60,
"change_pct": 8.33,
"direction": "up",
"spread": 0.02,
"poll_number": 5
}未触发警报的轮询会向stderr打印状态行,便于agent确认监控正在运行。
watch_market.py
watch_market.py
Continuously monitors a single market, printing a JSON snapshot each interval with price, spread, volume, and order book summary.
Arguments:
- — CLOB token ID to watch (required)
--token-id ID - — Snapshot interval in seconds (default: 15, minimum: 5)
--interval N - — Stop after N snapshots (default: unlimited)
--max-polls N
Output: One JSON object per line per snapshot:
json
{
"type": "market_snapshot",
"token_id": "...",
"timestamp": "2026-02-26T12:00:00Z",
"midpoint": 0.55,
"best_bid": 0.54,
"best_ask": 0.56,
"spread": 0.02,
"bid_depth": 15000.0,
"ask_depth": 12000.0,
"last_trade_price": 0.55,
"last_trade_side": "BUY",
"poll_number": 1
}持续监控单个市场,每个间隔打印一次包含价格、价差、交易量和订单簿摘要的JSON快照。
参数:
- — 要观察的CLOB代币ID(必填)
--token-id ID - — 快照生成间隔,单位为秒(默认:15,最小值:5)
--interval N - — 生成N次快照后停止(默认:无限制)
--max-polls N
输出: 每次快照输出一行JSON对象:
json
{
"type": "market_snapshot",
"token_id": "...",
"timestamp": "2026-02-26T12:00:00Z",
"midpoint": 0.55,
"best_bid": 0.54,
"best_ask": 0.56,
"spread": 0.02,
"bid_depth": 15000.0,
"ask_depth": 12000.0,
"last_trade_price": 0.55,
"last_trade_side": "BUY",
"poll_number": 1
}Data Flow
数据流程
- Run to find markets and get token IDs
polymarket-scanner/scripts/scan_markets.py - Pass token IDs to for multi-market alerting
monitor_prices.py - Or pass a single token ID to for detailed single-market tracking
watch_market.py
- 运行查找市场并获取代币ID
polymarket-scanner/scripts/scan_markets.py - 将代币ID传入实现多市场警报
monitor_prices.py - 或将单个代币ID传入实现详细的单市场跟踪
watch_market.py
Monitoring Guide
监控指南
For recommended thresholds by market type and advanced monitoring strategies, see .
references/monitoring-guide.md如需了解按市场类型推荐的阈值以及高级监控策略,请查看。
references/monitoring-guide.md