AGENT SKILL

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

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:

  • analyze for calibration, returns, volume, category, and comparison studies.
  • index for Kalshi and Polymarket market/trade/block backfills.
  • setup / package for dataset download, archive management, and local data packaging.

Environment

  • Preferred setup: uv sync --frozen --group dev from 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.md for command names and command-line behavior.
  • Read references/data-layout.md for directory layout, parquet inputs, and env vars.
  • Read references/api-reference.md for the public Python classes and helper functions.
  • Read references/troubleshooting.md when 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, or Analysis.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, or Indexer.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, or wget.
  • Understanding the repo's make setup and make package workflows.

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 at src/.
  • Analysis.load() and Indexer.load() default to src/analysis and src/indexers relative to the current working directory.
  • The repo uses Parquet data under data/kalshi/ and data/polymarket/, plus CSV/JSON/PNG/PDF/GIF outputs under output/.
  • main.py dispatches analyze, index, and package.
  • make setup is a convenience wrapper for host-tool installation plus dataset download.
  • main.py package / make package create data.tar.zst; the code does not delete the source data/ directory.

Bundled helpers

  • scripts/catalog.py lists available analyses and indexers from the repo checkout when run through the repo environment.
  • scripts/run_analysis.sh runs the analysis CLI from the repo root.
  • scripts/run_index.sh runs the indexing CLI from the repo root.
  • scripts/package_data.sh runs dataset packaging from the repo root.

Shared references

  • references/analysis-catalog.md for the full analysis catalog.
  • references/indexing-catalog.md for the full indexer catalog and cursor files.
  • references/data-ops.md for download, extraction, and packaging details.
  • references/troubleshooting.md for 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

VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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).

★ 351