analysis
Guide Kalshi, Polymarket, and cross-venue analysis workflows for prediction-market-analysis.
- License 许可
- MIT
- 最近更新
- 2026-10-08
- Stars
- ★ 11
- Forks
- 3
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
- 参考文档references/troubleshooting.md1.6 KB
- 参考文档references/workflows.md1.6 KB
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, orChartConfig.
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 andChartConfigJSON 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.mdfor the full analysis list.../../references/api-reference.mdfor theAnalysisandChartConfigAPIs.../../references/data-layout.mdfor the required Parquet inputs.../../references/troubleshooting.mdfor cross-cutting failures.
Core workflow
- Identify the analysis name from the catalog or from
scripts/catalog.py. - Confirm the required input directories exist.
- Run the analysis with
uv run main.py analyze <name>or the equivalent wrapper. - Read the saved outputs under
output/<analysis-name>.*. - 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_pricemispricing_by_pricewin_rate_by_trade_sizeev_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_hourvwap_by_hourvolume_over_timelongshot_volume_share_over_timekalshi_calibration_deviation_over_timemaker_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_rolemaker_returns_by_directionmaker_win_rate_by_directionmaker_vs_taker_returnsmaker_taker_returns_by_categorymarket_typesyes_vs_no_by_pricemeta_statsstatistical_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_pricepolymarket_calibration_by_bucketpolymarket_volume_over_timepolymarket_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
nameand a human-readabledescriptionin__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
ChartConfighelpers when the analysis should also emit JSON chart output. - Use the category helpers from
src.analysis.kalshi.util.categorieswhen 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.pylists the analysis names without opening the interactive menu when run through the repo environment.
04 同仓库更多 Skills
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
python-api
Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP/mAP semantics, and source-style import diagnostics.
file-evaluation
Folder-based PASCAL VOC AP/mAP evaluation from ground-truth and detection text files.
object-detection-metrics
Guides legacy Object-Detection-Metrics PASCAL VOC AP/mAP evaluation from detection text folders and direct Python API classes.
nx-workspace-patterns
Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.