Prediction Market Hedging Agent
Volume acceleration monitoring on Polymarket and Kalshi for equity hedging.
Overview
This agent monitors contract-level volume on Polymarket and Kalshi to detect informed capital flow ahead of public news. It uses volume acceleration — the rate of change of volume, not absolute level — to generate hedging signals for the equity portfolio.
Thesis
A contract trading $1M/day steadily is noise. The same contract jumping from $1M to $5M in four hours is a signal. The acceleration captures information arrival before it hits equity markets.
Theoretical Basis
| Theory | Insight |
|---|---|
| MDH (Clark, 1973) | Volume and price changes are jointly driven by information arrival |
| VCV (2023) | Higher volume variability = more informed traders present |
| VPIN (Easley & López de Prado) | Information speed correlates with volume speed |
Why Prediction Markets
- Each contract maps to one discrete event — clear signal attribution.
- Price = probability — volume + price move = real money shifting odds.
- Lower efficiency than equities — more lead time for acceleration signals.
- Cross-platform gaps reveal where information arrives first.
Server Details
Runs alongside the Autonomous Execution Agent.
| Property | Value |
|---|---|
| IP Address | 64.23.179.43 |
| Dashboard | http://64.23.179.43:8090 |
| SSH Port | 22 |
| Auth | SSH key only |
Access
ssh your-username@64.23.179.43Dashboard at http://64.23.179.43:8090 — shows live volume heatmap, alerts, "volume before news" history, and hedge P&L.
Architecture
Volume Acceleration Detector
Polymarket API + Kalshi API → Volume tracking → Acceleration → Anomaly detection
│
▼
Macro Event Correlator
News feeds + Econ calendar → Is the volume explained? → "Volume before news" flag
│
▼
Hedging Signal Generator
Portfolio exposure → Hedge sizing → Alpaca API (or human review)Metrics
| Metric | Definition | Frequency |
|---|---|---|
| VROC | (V_current - V_baseline) / V_baseline at 1h/4h/24h | 5 min |
| Acceleration | First derivative of VROC | 5 min |
| RVOL | Current volume / expected volume at same time-of-day | 5 min |
| Cross-platform Delta | VROC gap between Polymarket and Kalshi | 15 min |
Alert Levels
| Level | Trigger | Action |
|---|---|---|
| Watch | VROC > 2σ | Log |
| Elevated | VROC > 3σ + positive acceleration | Slack notification |
| Critical | VROC > 4σ + positive acceleration + correlated contracts moving | Hedge signal |
Baselines: 14-day rolling window, excluding known high-volume events. Time-of-day normalized.
Hedging Logic
On critical alert: map event to equity exposure → size hedge by signal strength → execute via SPY puts, sector ETFs, or VIX calls → log to trading-tracker.
Tracked Categories
| Category | Example | Equity Mapping |
|---|---|---|
| Monetary policy | "Fed cuts June 2026" | TLT, XLF, SPY |
| Geopolitics | "US-China tariff escalation" | Semiconductors, supply chain |
| Regulation | "Crypto bill passes" | Crypto-correlated equities |
| Economic data | "GDP > 3% Q2" | SPY, QQQ |
Adding Contracts
# /opt/hedging-agent/config/contracts.yaml
contracts:
- platform: polymarket
slug: "fed-rate-decision-june-2026"
category: monetary_policy
equity_mapping: ["TLT", "XLF", "SPY"]sudo systemctl restart hedging-agentOperations
# Status
systemctl status hedging-agent
# Logs
journalctl -u hedging-agent -f
# Recent alerts
cat /opt/hedging-agent/logs/alerts.jsonl | tail -20 | jq '.'
# Critical only
cat /opt/hedging-agent/logs/alerts.jsonl | jq 'select(.level == "critical")' | tail -10
# Hedge history
cat /opt/hedging-agent/logs/hedges.jsonl | tail -10 | jq '.'
# Monitor-only mode (no hedge execution)
echo '{"mode": "monitor_only"}' > /opt/hedging-agent/config/mode.json
sudo systemctl restart hedging-agentTroubleshooting
429 rate limits — Increase poll_interval_seconds in /opt/hedging-agent/config/polling.yaml.
Too many false alerts — Reset baselines: curl -X POST http://localhost:8090/api/reset-baselines.
Dashboard down — ss -tlnp | grep 8090 && sudo systemctl restart hedging-agent-dashboard.