agentleFS
bocodes1bocodes1/claude-skills/polymarket-multi-agent/SKILL.md

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

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
  1. Distinctive:

    Keep each agent narrow, with strict I/O.

    line 12
  2. Distinctive:

    Avoid pure speed race as core edge.

    line 49
  3. Distinctive:

    Prefer maker quotes around fair value.

    line 56
  4. Distinctive:

    All agents must output:

    line 79
  5. Distinctive:

    No single market family dominates PnL

    line 106
  6. Distinctive:

    Never claim guaranteed profits

    line 120
  7. Distinctive:

    Treat all strategy output as probabilistic

    line 121
  8. Distinctive:

    Prefer explainable edges over opaque model confidence

    line 122

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.

  1. Scout (Data + News Ingest)
    • Input: market feeds, event/news feeds, market metadata
    • Output: normalized features + event triggers
  2. Pricer (Fair-Value Engine)
    • Input: Scout features
    • Output: fair probability (p_fair), confidence, time-decay horizon
  3. Microstructure (Orderbook Edge)
    • Input: live L2 book + trade tape
    • Output: spread state, imbalance, queue quality, fill odds
  4. Arb/Consistency Agent
    • Input: related markets graph
    • Output: violations (sum probs > 1, mutual-exclusion mismatches, conditional inconsistencies)
  5. 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
  6. Executor
    • Input: approved intents
    • Output: idempotent order placement/cancel/replace, retry logic, fill reconciliation
  7. Ledger
    • Output: source-of-truth positions, realized/unrealized PnL, fees, attribution
  8. Atlas (Orchestrator/Judge)
    • Aggregates all outputs, scores disagreement, routes final action: buy/sell/make/hold

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

  1. Detect clusters of linked markets (same event family)
  2. Continuously compute: no-arb bounds, net edge after fees + slippage
  3. Enter only when: edge > min_edge_bps, confidence > threshold, position within caps
  4. Prefer maker quotes around fair value; cross spread only when dislocation half-life is short
  5. 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:

  1. Net positive after realistic fees/slippage
  2. Positive in walk-forward (not just in-sample)
  3. Robust across volatility/event regimes
  4. Max drawdown within target
  5. No single market family dominates PnL

8) Build Sequence

  1. Data plane + book reconstruction
  2. Ledger + fee-accurate PnL
  3. Risk Sentinel + kill-switch
  4. Constraint-Arb lane
  5. Maker lane with inventory controls
  6. Atlas orchestration + monitoring dashboard
  7. 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

FailureDetectionRecovery
WebSocket disconnectHeartbeat watchdog >10sAuto-reconnect with exp backoff, replay subs, reconcile via REST
Stale orderbookREST checksum mismatchPause trading, full snapshot, resume after 3 matching checksums
Executor double-fillDuplicate client_order_idIdempotent ignore, log warning, verify position
Risk Sentinel kill-switchDrawdown > hard limitFlatten all, cancel opens, NO-TRADE mode, alert operator
API rate limit (429)HTTP response codeBack off per Retry-After, queue requests, shed lowest priority
Arb leg partial fillOne side fills, other doesn'tPre-compute max imbalance; if exceeded, hedge remaining at market
Signer/nonce desyncTransaction revertFetch 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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.