Set up
Skills are installed by placing their folder where your agent loads skills.
The download comes from github.com/dmoskov/manifold-analyzer itself, not from our server, so what you get is exactly what its author published.
Install instructions come from the README
README
synced Oct 22, 2026Manifold Markets Analyzer
Analyze and visualize prediction market data from Manifold Markets. Fetches trade history via API, aggregates by trader and time period, and generates interactive HTML visualizations.
Features
- API Data Fetching: Paginated fetching of all bets for any market
- Trader Analytics: Volume, trade count, YES/NO breakdown, bull/bear stance
- Time Series: Monthly cumulative volume charts
- Interactive Visualizations: Standalone HTML files with Chart.js
- P&L Estimation: Estimate trader profits based on entry prices vs current probability
- Market Impact: Track how much each trader moved the price
- Trader Classification: Auto-tag traders as WHALE, BULL, BEAR, ACTIVE, WINNER, LOSER
Quick Start
1. Find a Market ID
Search for a market:
curl "https://api.manifold.markets/v0/search-markets?term=your+search+term"
Or grab from the URL - the market ID is in the API response.
2. Fetch Market Data
python3 scripts/fetch_market_data.py --market-id MARKET_ID --output all > market_data.json
Options:
--output all- Summary, traders, monthly, last 100 trades--output json- Full data including all trades--output traders- Just trader leaderboard--output monthly- Just monthly aggregates
3. Resolve Usernames (Optional)
The API returns user IDs, not names. To resolve top traders:
import json
from urllib.request import urlopen
def get_username(user_id):
url = f"https://api.manifold.markets/v0/user/by-id/{user_id}"
return json.loads(urlopen(url).read())['username']
Note: Be conservative with API calls - add 1 second delays between requests.
4. Create Visualization
Use one of the example HTML files as a template:
iran_market_viz_chartjs.html- Binary YES/NO marketai_imo_gold_viz.html- Long-running market with many monthsagi_2030_viz.html- Medium-sized market
Example Markets Analyzed
| Market | Probability | Volume | File |
|---|---|---|---|
| Iran Regime Fall 2026 | 39% | Ṁ1.71M | iran_market_viz_chartjs.html |
| AI IMO Gold 2025 | 97% | Ṁ7.85M | ai_imo_gold_viz.html |
| AGI Before 2030 | 31% | Ṁ133k | agi_2030_viz.html |
Project Structure
manifold-analysis/
├── scripts/
│ ├── fetch_market_data.py # API fetcher with pagination
│ ├── analyze_traders.py # Deep trader analysis (P&L, impact, timing)
│ ├── generate_viz.py # Generate enhanced HTML visualizations
│ └── parse_trades.py # Parse text/CSV trade data
├── examples/
│ ├── asl3_danger_data.json # Example: ASL-3 market data
│ ├── asl3_danger_usernames.json
│ └── asl3_danger_viz.html # Example visualization
├── references/
│ └── visualization_template.md # React/Recharts template
├── SKILL.md # Claude Code skill definition
├── *_viz.html # Generated visualizations
└── *_data.json # Cached market data (gitignored)
Example: ASL-3 Danger Market
The examples/ folder contains a complete worked example:
# The data is already fetched - just open the visualization
open examples/asl3_danger_viz.html
Market: "Will any LLM released by EOY 2025 be dangerously ASL-3?"
- 145 trades, 60 traders, Ṁ18k volume
- Shows how data flows from API → JSON → HTML viz
Trader Analysis
Run deep analysis on any market:
python3 scripts/analyze_traders.py market_data.json --current-prob 0.95
Outputs:
- P&L Leaderboard: Estimated profits based on entry price vs current
- Biggest Losers: Who's underwater on their positions
- Market Movers: Traders with most price impact
- Position Flippers: Who changed direction
- Classifications: WHALE, BULL, BEAR, ACTIVE, WINNER, LOSER tags
Generating Enhanced Visualizations
python3 scripts/generate_viz.py data.json usernames.json -o output.html --url "username/market-slug"
The enhanced viz includes P&L estimates, ROI%, market impact, and trader type badges.
API Reference
Endpoints Used
| Endpoint | Purpose |
|---|---|
GET /v0/search-markets?term=X | Find markets by keyword |
GET /v0/market/{id} | Get market details |
GET /v0/bets?contractId=X&limit=1000 | Get bets (paginated) |
GET /v0/user/by-id/{id} | Resolve user ID to username |
Rate Limiting
Be nice to the API:
- 1 second between paginated bet requests
- 0.5-1 second between user lookups
- Consider skipping bulk user resolution for large markets
Visualization Features
The generated HTML files include:
- Stats Cards: Probability, volume, trades, unique traders
- Stacked Area Chart: Cumulative YES/NO volume over time
- Trader Leaderboard: Top 20 by volume with stance indicators
- Responsive Design: Works on mobile
- Dark Theme: Easy on the eyes
Polymarket Support
In addition to Manifold, the repo analyzes real-money Polymarket markets via their public APIs (no key required):
# Single market: fetch + deep-dive viz (price curve, volume, order flow, holders)
python3 scripts/fetch_polymarket.py --slug <slug> -o examples/<name>/data.json
python3 scripts/generate_poly_viz.py examples/<name>/data.json -o examples/<name>/viz.html
# Multi-market topic report — overlaid probability curves, comparison table,
# AND an auto-detected term structure (today's odds across resolution dates)
python3 scripts/generate_poly_report.py --slug <slug1> --slug <slug2> --title "Topic" -o report.html
# Price-range ladder for multi-outcome threshold events (e.g. oil price)
python3 scripts/generate_poly_ladder.py --slug what-price-will-wti-hit-in-june-2026 -o ladder.html
# Multi-outcome dashboard (scenarios, party races, seat distribution) — e.g. 2026 midterms
python3 scripts/generate_poly_midterms.py -o examples/midterms/midterms_dashboard.html
# Refresh it, print what moved, archive history/<date>.json (add --commit to commit)
python3 scripts/refresh_midterms.py
Note: Polymarket exposes no full trade-by-trade history for busy markets, so analysis uses current holders (positions) plus aggregate volume windows. See examples/hormuz/ for a worked multi-market example (Iran / Strait of Hormuz crisis) including time-series overlay, a term-structure cross-section, and an oil price-range ladder.
Claude Code Skill
This repo includes a skill definition (SKILL.md) that enables Claude Code to:
- Fetch market data from any Manifold or Polymarket URL
- Process and aggregate trade history / current positions
- Generate interactive visualizations and multi-market topic reports
- Identify key traders and market dynamics
Trigger phrases:
- "Analyze this Manifold market: [URL]"
- "Analyze this Polymarket: [URL]"
- "Show me the traders on [market name]"
- "Create a visualization for [market]"
- "Produce a topic report across these markets"
Tech Stack
- Python 3: Data fetching and processing
- Chart.js 4.x: Interactive charts (CDN loaded)
- Vanilla HTML/CSS/JS: No build step required
License
MIT