polymarket-multi-agent
Skill0 starsChanged 7 months agoMITView on GitHub
Build and operate a multi-agent Polymarket trading system (research, signal generation, execution, risk). Use when designing a prediction-market bot, defining agent roles, integrating Polymarket APIs/WebSockets, testing expected-value strategies, or running disciplined live trading with strict risk controls
In this repository13 other files it gives its agents.
- deploy-pipelineSkill
- ecommerce-builderSkill
- hackathon-copilotSkill
- know-meSkill
- memory-managementSkill
- obsidian-memory-syncSkill
- polymarket-vps-opsSkill
- researcherSkill
- self-healingSkill
- self-improvementSkill
- strategy-preflightSkill
- trade-journalSkill
- visual-promptingSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 8 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Keep each agent narrow, with strict I/O.
- Distinctive: line 49
Avoid pure speed race as core edge.
- Distinctive: line 56
Prefer maker quotes around fair value.
- Distinctive: line 79
All agents must output:
- Distinctive: line 106
No single market family dominates PnL
- Distinctive: line 120
Never claim guaranteed profits
- Distinctive: line 121
Treat all strategy output as probabilistic
- Distinctive: line 122
Prefer explainable edges over opaque model confidence
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Polymarket Multi-Agent Trading
Design for one thing: positive expected value with survival (never blow up).
1) Baseline Agent Architecture
Keep each agent narrow, with strict I/O.
- Scout (Data + News Ingest)
- Input: market feeds, event/news feeds, market metadata
- Output: normalized features + event triggers
- Pricer (Fair-Value Engine)
- Input: Scout features
- Output: fair probability (
p_fair), confidence, time-decay horizon
- Microstructure (Orderbook Edge)
- Input: live L2 book + trade tape
- Output: spread state, imbalance, queue quality, fill odds
- Arb/Consistency Agent
- Input: related markets graph
- Output: violations (
sum probs > 1, mutual-exclusion mismatches, conditional inconsistencies)
- Risk Sentinel (Pre-trade + Post-trade)
- Pre: max position, max market exposure, spread/slippage gate, event blackout windows
- Post: drawdown brakes, kill-switch, inventory skew controls
- Executor
- Input: approved intents
- Output: idempotent order placement/cancel/replace, retry logic, fill reconciliation
- Ledger
- Output: source-of-truth positions, realized/unrealized PnL, fees, attribution
- Atlas (Orchestrator/Judge)
- Aggregates all outputs, scores disagreement, routes final action:
buy/sell/make/hold
- Aggregates all outputs, scores disagreement, routes final action:
2) Trading Styles
Three independent alpha lanes, combined by confidence:
- A. Cross-market consistency arb (best first lane)
- Trade when logically linked markets violate probability constraints
- Example: mutually exclusive outcomes where aggregate implied probability is too high/low net of fees
- B. Resolution-mechanics edge
- Trade based on rule interpretation clarity/ambiguity, not headline sentiment
- C. Maker micro-edge + rewards
- Quote both sides where spread + expected rewards - adverse selection > 0
Avoid pure speed race as core edge; use latency only as an accelerator.
3) First Strategy: Constraint-Arb + Maker Hybrid
- Detect clusters of linked markets (same event family)
- Continuously compute: no-arb bounds, net edge after fees + slippage
- Enter only when: edge >
min_edge_bps, confidence > threshold, position within caps - Prefer maker quotes around fair value; cross spread only when dislocation half-life is short
- Exit rules: mean reversion to fair band, rule/news invalidation, time stop, Risk Sentinel forced de-risk
4) API + Runtime Integration
- REST for snapshots/bootstrap/state reconciliation
- WebSocket for real-time book/trade/user events
- Local in-memory book per asset + periodic REST checksum
- Heartbeat watchdog; auto-reconnect with backoff and replay subscriptions
- Executor must be idempotent (
client_order_id) and safe on retries - Separate simulation, paper, and live configs
5) Hard Risk Limits (Non-Negotiable)
- Max risk per trade: 25-50 bps of equity (configurable)
- Max market exposure cap
- Max correlated-theme exposure cap
- Daily loss limit (hard stop)
- Intraday drawdown circuit breaker (soft then hard)
- No-trade mode on: stale data, websocket desync, uncertain resolution rule state, liquidity below minimum depth
6) Decision Schema
All agents must output:
{
"market_id": "string",
"asset_id": "string",
"timestamp": 0,
"action": "buy|sell|make|hold",
"side": "yes|no|null",
"size_usd": 0,
"fair_prob": 0.0,
"edge_bps": 0.0,
"confidence": 0.0,
"ttl_sec": 0,
"reason_codes": ["string"],
"risk_flags": ["string"]
}Atlas only forwards intents that pass all risk flags. Full audit log always.
7) Backtesting & Promotion Gates
Promote strategy only if ALL pass:
- Net positive after realistic fees/slippage
- Positive in walk-forward (not just in-sample)
- Robust across volatility/event regimes
- Max drawdown within target
- No single market family dominates PnL
8) Build Sequence
- Data plane + book reconstruction
- Ledger + fee-accurate PnL
- Risk Sentinel + kill-switch
- Constraint-Arb lane
- Maker lane with inventory controls
- Atlas orchestration + monitoring dashboard
- Paper-trade 2-4 weeks before live
9) Non-Negotiables
- Never claim guaranteed profits
- Treat all strategy output as probabilistic
- Prefer explainable edges over opaque model confidence
- Log everything needed for post-trade attribution
10) Failure Modes & Recovery
| Failure | Detection | Recovery |
| WebSocket disconnect | Heartbeat watchdog >10s | Auto-reconnect with exp backoff, replay subs, reconcile via REST |
| Stale orderbook | REST checksum mismatch | Pause trading, full snapshot, resume after 3 matching checksums |
| Executor double-fill | Duplicate client_order_id | Idempotent ignore, log warning, verify position |
| Risk Sentinel kill-switch | Drawdown > hard limit | Flatten all, cancel opens, NO-TRADE mode, alert operator |
| API rate limit (429) | HTTP response code | Back off per Retry-After, queue requests, shed lowest priority |
| Arb leg partial fill | One side fills, other doesn't | Pre-compute max imbalance; if exceeded, hedge remaining at market |
| Signer/nonce desync | Transaction revert | Fetch latest nonce, re-sign, single-thread executor |
11) Integration Points
- polymarket-vps-ops: Deploy and operate on VPS
- deploy-pipeline: Safe deployment workflow
- self-healing: Route tool/infra failures through retry protocol
- strategy-preflight: Stress-test before any new strategy
- trade-journal: Log all trades for pattern detection
- researcher: Resolution-mechanics edge analysis
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

