prediction-market-analysis
Route analysis, indexing, and data-ops guidance for the prediction-market-analysis repo.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- prediction-market-analysis
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Route analysis, indexing, and data-ops guidance for the prediction-market-analysis repo.
- disable-model-invocation
- true
02 资源文件 13
- 参考文档references/analysis-catalog.md3.4 KB
- 参考文档references/api-reference.md5.2 KB
- 参考文档references/cli-reference.md3.0 KB
- 参考文档references/data-layout.md3.9 KB
- 参考文档references/data-ops.md1.9 KB
- 参考文档references/indexing-catalog.md2.9 KB
- 参考文档references/repo-provenance.md968 B
- 参考文档references/repo-routing-metadata.json515 B
- 参考文档references/troubleshooting.md4.3 KB
- 脚本scripts/catalog.py2.5 KB
- 脚本scripts/package_data.sh828 B
- 脚本scripts/run_analysis.sh780 B
- 脚本scripts/run_index.sh809 B
03 SKILL.md 正文
prediction-market-analysis
This skill covers the repo that analyzes and collects Kalshi and Polymarket market data. The repo is centered on three user-facing workflows:
analyzefor calibration, returns, volume, category, and comparison studies.indexfor Kalshi and Polymarket market/trade/block backfills.setup/packagefor dataset download, archive management, and local data packaging.
Environment
- Preferred setup:
uv sync --frozen --group devfrom the repo root. - Minimal import smoke:
uv run python -c "import src; print(src.__file__)". - The bundled helper scripts assume the repo runtime dependencies are available.
First stop
- Read
references/cli-reference.mdfor command names and command-line behavior. - Read
references/data-layout.mdfor directory layout, parquet inputs, and env vars. - Read
references/api-reference.mdfor the public Python classes and helper functions. - Read
references/troubleshooting.mdwhen a workflow fails, returns empty data, or cannot find files.
When to use each sub-skill
sub-skills/analysis/
Use when the task is about:
- Running or interpreting an existing analysis.
- Comparing Kalshi vs Polymarket calibration, returns, or volume.
- Understanding
Analysis,AnalysisOutput,ChartConfig, orAnalysis.load()behavior. - Adding a new analysis class under
src/analysis/.
Typical signals:
win_rate_by_price, mispricing, maker_taker, volume_over_time, meta_stats, polymarket, calibration, chart, output/.
sub-skills/indexing/
Use when the task is about:
- Backfilling Kalshi or Polymarket markets or trades.
- Resuming interrupted cursor-based collection jobs.
- Fetching Polygon block timestamps or legacy FPMM trades.
- Understanding
KalshiClient,PolymarketClient,PolygonClient, orIndexer.load()behavior. - Adding a new indexer class under
src/indexers/.
Typical signals:
kalshi_markets, kalshi_trades, polymarket_markets, polymarket_trades, polymarket_blocks, polymarket_fpmm_trades, cursor, backfill, POLYGON_RPC, resume.
sub-skills/data-ops/
Use when the task is about:
- Downloading the prebuilt dataset or restoring the
data/directory. - Packaging the dataset into
data.tar.zst. - Installing or diagnosing local host tools such as
zstd,aria2c,curl, orwget. - Understanding the repo's
make setupandmake packageworkflows.
Typical signals:
make setup, make package, data.tar.zst, download.sh, install-tools.sh, zstd, aria2c, curl, wget.
Shared facts
- The package distribution is
prediction-market-data; the source package tree is rooted atsrc/. Analysis.load()andIndexer.load()default tosrc/analysisandsrc/indexersrelative to the current working directory.- The repo uses Parquet data under
data/kalshi/anddata/polymarket/, plus CSV/JSON/PNG/PDF/GIF outputs underoutput/. main.pydispatchesanalyze,index, andpackage.make setupis a convenience wrapper for host-tool installation plus dataset download.main.py package/make packagecreatedata.tar.zst; the code does not delete the sourcedata/directory.
Bundled helpers
scripts/catalog.pylists available analyses and indexers from the repo checkout when run through the repo environment.scripts/run_analysis.shruns the analysis CLI from the repo root.scripts/run_index.shruns the indexing CLI from the repo root.scripts/package_data.shruns dataset packaging from the repo root.
Shared references
references/analysis-catalog.mdfor the full analysis catalog.references/indexing-catalog.mdfor the full indexer catalog and cursor files.references/data-ops.mdfor download, extraction, and packaging details.references/troubleshooting.mdfor cross-cutting failures.
If a request names missing data, a cursor problem, a Polygon RPC issue, a download failure, or a headless plotting problem, read the matching troubleshooting section before guessing.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).