AGENT SKILL

analysis

Guide Kalshi, Polymarket, and cross-venue analysis workflows for prediction-market-analysis.

License 许可
MIT
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
analysis
license
MIT
metadata
{ "disco-role": "operating" }
description
Guide Kalshi, Polymarket, and cross-venue analysis workflows for prediction-market-analysis.
disable-model-invocation
true

02 资源文件 2

03 SKILL.md 正文

analysis

Use this sub-skill for anything that runs, interprets, or extends the repo's analysis classes. It covers both the menu-driven CLI and the Python Analysis framework.

Use this route when

  • The user wants to run a named analysis or all analyses.
  • The user wants calibration, return, volume, category, or statistical-study guidance.
  • The user wants a new analysis class or a fix to an existing one.
  • The user wants help understanding Analysis, AnalysisOutput, or ChartConfig.

Scope

Included

  • Kalshi calibration and pricing analyses.
  • Kalshi maker/taker, category, hour-of-day, and volume analyses.
  • Kalshi meta statistics and paper-style statistical tests.
  • Polymarket calibration, volume, and trade-time analyses.
  • The cross-venue animated calibration comparison.
  • Analysis.save() output formats and ChartConfig JSON export.

Excluded

  • Market/trade/block backfills and cursor recovery, which belong to sub-skills/indexing/.
  • Dataset download, archive creation, and host-tool installation, which belong to sub-skills/data-ops/.

Read first

  • ../../references/analysis-catalog.md for the full analysis list.
  • ../../references/api-reference.md for the Analysis and ChartConfig APIs.
  • ../../references/data-layout.md for the required Parquet inputs.
  • ../../references/troubleshooting.md for cross-cutting failures.

Core workflow

  1. Identify the analysis name from the catalog or from scripts/catalog.py.
  2. Confirm the required input directories exist.
  3. Run the analysis with uv run main.py analyze <name> or the equivalent wrapper.
  4. Read the saved outputs under output/<analysis-name>.*.
  5. If the analysis is missing, thin, or failing, inspect the relevant source module and the family-specific troubleshooting notes.

Analysis families

Kalshi calibration and pricing

Use these when the task is about price calibration, mispricing, or expected value:

  • win_rate_by_price
  • mispricing_by_price
  • win_rate_by_trade_size
  • ev_yes_vs_no

Typical inputs: data/kalshi/trades/, data/kalshi/markets/.

Kalshi time and volume

Use these when the task is about temporal trends or notional volume:

  • returns_by_hour
  • vwap_by_hour
  • volume_over_time
  • longshot_volume_share_over_time
  • kalshi_calibration_deviation_over_time
  • maker_taker_gap_over_time

Typical inputs: data/kalshi/trades/, sometimes data/kalshi/markets/.

Kalshi maker/taker and category studies

Use these when the task compares makers and takers, direction, or category grouping:

  • trade_size_by_role
  • maker_returns_by_direction
  • maker_win_rate_by_direction
  • maker_vs_taker_returns
  • maker_taker_returns_by_category
  • market_types
  • yes_vs_no_by_price
  • meta_stats
  • statistical_tests

Typical inputs: data/kalshi/trades/, data/kalshi/markets/, and src.analysis.kalshi.util.categories.

Polymarket analyses

Use these when the task is about Polymarket calibration, volume, or block-level trade history:

  • polymarket_win_rate_by_price
  • polymarket_calibration_by_bucket
  • polymarket_volume_over_time
  • polymarket_trades_over_time

Typical inputs: data/polymarket/trades/, data/polymarket/legacy_trades/, data/polymarket/markets/, data/polymarket/blocks/, and data/polymarket/fpmm_collateral_lookup.json.

Cross-venue comparison

Use win_rate_by_price_animated when the user wants a single workflow that compares Kalshi and Polymarket in one animated calibration plot.

Typical inputs: Both platforms' data directories plus data/polymarket/blocks/ and the collateral lookup file.

Adding or fixing an analysis

  • Subclass Analysis.
  • Set a stable name and a human-readable description in __init__.
  • Keep data selection, transformations, figure creation, and chart serialization inside run() or helper methods.
  • Return AnalysisOutput.
  • Use self.progress() for longer SQL or dataframe steps.
  • Prefer ChartConfig helpers when the analysis should also emit JSON chart output.
  • Use the category helpers from src.analysis.kalshi.util.categories when grouping Kalshi markets.

Common failure patterns

  • Missing or empty data/ subtrees.
  • No finalized or resolved markets, leading to empty dataframes.
  • Missing Polymarket helper files, especially the collateral lookup or block timestamps.
  • Analysis.load() returning no classes because the command was run from the wrong directory.
  • Matplotlib backend issues on headless hosts.

Helpful helper

  • ../../scripts/catalog.py lists the analysis names without opening the interactive menu when run through the repo environment.

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