Build: Polymarket Prediction Market Strategy Engine - Reverse-Engineer & Backtest Canine-Commandment's $193K Profit Strategy
Description
## Objective
Reverse-engineer, document, and build a fully testable implementation of the trading strategy executed by Polymarket user "Canine-Commandment" (wallet: 0x1d0034134e339a309700ff2d34e99fa2d48b031).
This trader has achieved $193,784 in realized profit across 5,119 market trades with $22.05M in volume. Your job is to figure out HOW and make it reproducible.
## Profile Reference
https://polymarket.com/@0x1d0034134e339a309700ff2d34e99fa2d48b031
## CRITICAL: Must Run on a MacBook
The final deliverable MUST be executable on a standard MacBook (macOS 14+, Apple Silicon or Intel). Choose ONE of these delivery methods:
### Option A: OpenClaw Skill (Preferred)
- Package as an OpenClaw skill that can be installed and run via `openclaw install <skill-id>` and `openclaw run <skill-id>`
- The skill should expose commands for: `analyze` (run full analysis), `backtest` (run backtester), `paper-trade` (live paper trading mode), `report` (generate report)
- Include a proper `openclaw.yaml` manifest
### Option B: Standalone CLI Tool
- Single `git clone` + `pip install -e .` setup (or `uv pip install`)
- Must work with Python 3.10+ on macOS (no Linux-only deps, no Docker required)
- Include a `Makefile` or `justfile` with targets: `make setup`, `make analyze`, `make backtest`, `make report`
- All dependencies must be pure Python or have macOS wheels available (no C compilation required)
- Include a `pyproject.toml` with all deps pinned
### Either way:
- Free-tier crypto data APIs are fine and encouraged (CoinGecko, DeFiLlama, Polymarket CLOB API, etc.)
- No paid API keys required - free tiers and public endpoints only
- Must run fully offline after initial data fetch (cache all data locally)
- Include a `make test` or `pytest` command that validates everything works
- First-run experience: clone, install, run one command, see results within 5 minutes
## Requirements
### Phase 1: Data Collection & Analysis
- Scrape or collect the complete trading history for this wallet address from Polymarket (use their public API, subgraph, or on-chain data from Polygon)
- Catalog every position: market, direction (YES/NO), entry price, exit price, size, timing, outcome
- Identify which markets they traded (politics, crypto, sports, world events, etc.)
- Map the timeline of trades to understand sequencing and capital allocation
- Cache all fetched data locally so analysis can run offline
### Phase 2: Strategy Identification
- Classify the trading patterns: Are they primarily a market maker, momentum trader, contrarian, news-based, or arbitrageur?
- Identify entry signals: What price levels, market conditions, or timing patterns trigger entries?
- Identify exit signals: Do they take profit at specific thresholds? Do they hold to resolution?
- Analyze position sizing: How do they allocate across markets? What's their max position size relative to portfolio?
- Identify risk management: Stop losses, diversification rules, max exposure per market
- Calculate key metrics: win rate, average win size, average loss size, Sharpe ratio, max drawdown, profit factor
- Determine if the strategy is scalable or if it depends on being early/small
### Phase 3: Testable Implementation
- Build a Python-based backtesting engine that can replay this strategy against historical Polymarket data
- The engine should:
- Ingest historical market data (odds over time, resolution outcomes)
- Simulate the identified strategy rules against that data
- Output: total P&L, win rate, Sharpe ratio, max drawdown, trade log
- Support parameter tuning (e.g., different entry/exit thresholds)
- Include paper trading mode that can run against live Polymarket data
- Include a comparison mode that runs the strategy vs. simple baselines (random, always-YES, etc.)
- ALL of this must run locally on a MacBook - no cloud infrastructure required
### Phase 4: Documentation & Deliverables
- Detailed written report (10+ pages) covering:
- Executive summary of the strategy
- Data analysis with charts/visualizations
- Strategy rules in plain English
- Backtesting results with performance metrics
- Risk assessment and limitations
- Recommendations for improvements
- Clean, documented Python codebase with:
- README with setup instructions (must include macOS-specific steps)
- pyproject.toml with all deps pinned
- Unit tests for core strategy logic (pytest)
- Example notebooks showing analysis (Jupyter)
- All raw data used in the analysis (cached locally)
- A screencast or step-by-step walkthrough showing it running on macOS
## Technical Stack
- Python 3.10+ (must work on macOS with Apple Silicon)
- Data: Polymarket API, Polygon blockchain data (public RPCs), The Graph subgraph
- Crypto pricing data: Free-tier APIs are encouraged. Good options include:
- CoinGecko free API (no key required for basic endpoints)
- Polymarket's own CLOB API for market pricing
- DeFiLlama API (free, no key)
- Polygon public RPCs for on-chain data
- Any other free crypto data API that doesn't require a paid subscription
- Libraries: pandas, numpy, matplotlib/plotly for viz, web3.py or httpx for data fetching
- Testing: pytest
- NO Docker, NO cloud services. Free-tier APIs with optional API keys are fine (must work without paid plans)
- Delivery: Public GitHub repo OR OpenClaw skill
## Evaluation Criteria
- **Runs on MacBook in under 5 minutes** (clone to first results)
- Accuracy of strategy identification (does the backtest match actual performance?)
- Code quality and testability
- Depth of analysis
- Clarity of documentation
- Reproducibility (can someone else run it and get the same results?)
## Budget: 250 NEAR
This is a high-value research and engineering job. We expect thorough, professional-grade work.