Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Jon-Becker/prediction-market-analysis
/ functions
Functions
266 in github.com/Jon-Becker/prediction-market-analysis
⨍
Functions
266
◇
Types & classes
55
↓ 64 callers
Method
get
(self, url: str, *, params: Optional[dict] = None)
src/common/client.py:80
↓ 15 callers
Method
save
Run the analysis and save outputs to the specified directory. Args: output_dir: Directory to save outputs. formats: L
src/common/analysis.py:97
↓ 9 callers
Method
load
Scan directory for Indexer subclass implementations. Args: indexer_dir: Directory to scan for indexer modules. Returns:
src/common/indexer.py:40
↓ 7 callers
Function
_make_figure
()
tests/test_analysis_save.py:27
↓ 7 callers
Method
progress
Show a progress spinner while executing a block of code. Usage: with self.progress("Loading data"): df = con.exec
src/common/analysis.py:68
↓ 6 callers
Method
from_dict
(cls, data: dict)
src/indexers/kalshi/models.py:23
↓ 5 callers
Method
_format_number
Format a number with commas.
src/analysis/kalshi/meta_stats.py:106
↓ 5 callers
Function
_make_dataframe
()
tests/test_analysis_save.py:33
↓ 4 callers
Method
close
(self)
src/indexers/polymarket/client.py:21
↓ 4 callers
Method
get_block_number
Get current block number.
src/indexers/polymarket/blockchain.py:117
↓ 3 callers
Method
close
(self)
src/indexers/kalshi/client.py:21
↓ 3 callers
Method
close
(self)
src/common/client.py:66
↓ 3 callers
Method
to_dict
(self)
src/common/interfaces/chart.py:63
↓ 2 callers
Function
_build_kwargs
Map constructor params to fixture paths based on platform module.
tests/test_analysis_run.py:22
↓ 2 callers
Method
_chunk_path
(self, start: int, end: int)
src/common/storage.py:24
↓ 2 callers
Method
_cohens_d
Compute Cohen's d effect size.
src/analysis/kalshi/statistical_tests.py:479
↓ 2 callers
Method
_compute_cumulative
Pre-compute cumulative totals/wins by price for each week.
src/analysis/comparison/win_rate_by_price_animated.py:198
↓ 2 callers
Method
_fetch_logs_with_retry
Fetch logs for a topic, splitting range if too large.
src/indexers/polymarket/fpmm_trades.py:136
↓ 2 callers
Method
_get_market_chunks
Get all market chunk files sorted by start index.
src/common/storage.py:18
↓ 2 callers
Function
_make_animation
()
tests/test_analysis_save.py:47
↓ 2 callers
Function
_make_chart
()
tests/test_analysis_save.py:37
↓ 2 callers
Function
_make_polymarket_ctf_trades
Build minimal Polymarket CTF trades DataFrame (~10 rows). 5 price levels x 2 sides (buying token_yes_a and token_yes_b). maker_asset_id='0' m
tests/conftest.py:78
↓ 2 callers
Function
_make_polymarket_legacy_trades
Build minimal Polymarket legacy FPMM trades DataFrame (~10 rows). 5 price levels x 2 outcome indices, all for the same FPMM address.
tests/conftest.py:111
↓ 2 callers
Method
_request
(self, method: str, url: str, **kwargs)
src/common/client.py:86
↓ 2 callers
Method
from_dict
(cls, data: dict)
src/indexers/polymarket/models.py:24
↓ 2 callers
Method
get_trades
Fetch OrderFilled events from a block range.
src/indexers/polymarket/blockchain.py:145
↓ 2 callers
Function
parse_datetime
(val: str)
src/indexers/kalshi/models.py:8
↓ 2 callers
Method
run
Backfill all Polymarket trades from the Polygon blockchain. This fetches OrderFilled events from both CTF Exchange contracts (regular
src/indexers/polymarket/trades.py:40
↓ 2 callers
Method
run
Execute the indexer to fetch and store data.
src/common/indexer.py:35
↓ 2 callers
Method
run
(self)
tests/test_analysis_save.py:23
↓ 2 callers
Function
snake_to_title
Convert snake_case string to Title Case.
src/common/util/strings.py:1
↓ 2 callers
Method
to_json
Convert to JSON string.
src/common/interfaces/chart.py:163
↓ 1 callers
Method
_build_hierarchy_json
Build hierarchical JSON structure for treemap. Args: df_raw: DataFrame with category and total_volume columns min_pct
src/analysis/kalshi/market_types.py:78
↓ 1 callers
Method
_compute_calibration_metrics
Compute Brier score and ECE from aggregated price data. Brier score = mean((p - y)²) where p is predicted prob, y is outcome (0 or 1)
src/analysis/polymarket/polymarket_win_rate_by_price.py:187
↓ 1 callers
Method
_compute_metrics
Compute calibration summary metrics across buckets. ECE (Expected Calibration Error): trade-weighted mean of |actual_rate - mean_pred
src/analysis/polymarket/polymarket_calibration_by_bucket.py:189
↓ 1 callers
Method
_create_chart
Create the chart configuration for web display.
src/analysis/polymarket/polymarket_volume_over_time.py:140
↓ 1 callers
Method
_create_chart
Create the chart configuration for web display.
src/analysis/polymarket/polymarket_trades_over_time.py:104
↓ 1 callers
Method
_create_chart
Create the chart configuration for web display.
src/analysis/polymarket/polymarket_calibration_by_bucket.py:311
↓ 1 callers
Method
_create_chart
Create the chart configuration for web display.
src/analysis/polymarket/polymarket_win_rate_by_price.py:301
↓ 1 callers
Method
_create_chart
Create the chart configuration for web display.
src/analysis/kalshi/win_rate_by_price.py:109
↓ 1 callers
Method
_create_chart
Create the chart configuration for web display.
src/analysis/kalshi/yes_vs_no_by_price.py:136
↓ 1 callers
Method
_create_chart
Create the chart configuration for web display.
src/analysis/kalshi/ev_yes_vs_no.py:172
↓ 1 callers
Method
_create_chart
Create the chart configuration for web display.
src/analysis/kalshi/maker_returns_by_direction.py:159
↓ 1 callers
Method
_create_chart
Create the chart configuration for web display.
src/analysis/kalshi/vwap_by_hour.py:132
↓ 1 callers
Method
_create_chart
Create the chart configuration for web display.
src/analysis/kalshi/maker_win_rate_by_direction.py:157
↓ 1 callers
Method
_create_chart
Create the chart configuration for web display.
src/analysis/kalshi/volume_over_time.py:74
↓ 1 callers
Method
_create_chart
Create the chart configuration for web display.
src/analysis/kalshi/maker_taker_gap_over_time.py:177
↓ 1 callers
Method
_create_chart
Create the chart configuration for web display.
src/analysis/kalshi/kalshi_calibration_deviation_over_time.py:159
↓ 1 callers
Method
_create_chart
Create the chart configuration for web display.
src/analysis/kalshi/maker_vs_taker_returns.py:168
↓ 1 callers
Method
_create_chart
Create the chart configuration for web display.
src/analysis/kalshi/win_rate_by_trade_size.py:126
↓ 1 callers
Method
_create_chart
Create the chart configuration for web display.
src/analysis/kalshi/market_types.py:267
↓ 1 callers
Method
_create_chart
Create the chart configuration for web display.
src/analysis/kalshi/mispricing_by_price.py:176
↓ 1 callers
Method
_create_chart
Create the chart configuration for web display.
src/analysis/kalshi/returns_by_hour.py:105
↓ 1 callers
Method
_create_chart
Create the chart configuration for web display.
src/analysis/kalshi/maker_taker_returns_by_category.py:199
↓ 1 callers
Method
_create_chart
Create the chart configuration for web display.
src/analysis/kalshi/trade_size_by_role.py:147
↓ 1 callers
Method
_create_chart
Create the chart configuration for web display.
src/analysis/kalshi/longshot_volume_share_over_time.py:166
↓ 1 callers
Method
_create_figure
Create the matplotlib figure.
src/analysis/polymarket/polymarket_volume_over_time.py:115
↓ 1 callers
Method
_create_figure
Create the matplotlib figure.
src/analysis/polymarket/polymarket_trades_over_time.py:82
↓ 1 callers
Method
_create_figure
Create a grouped bar chart comparing predicted vs actual per bucket.
src/analysis/polymarket/polymarket_calibration_by_bucket.py:225
↓ 1 callers
Method
_create_figure
Create the matplotlib figure.
src/analysis/polymarket/polymarket_win_rate_by_price.py:248
↓ 1 callers
Method
_create_figure
Create the matplotlib figure.
src/analysis/kalshi/win_rate_by_price.py:76
↓ 1 callers
Method
_create_figure
Create the matplotlib figure.
src/analysis/kalshi/yes_vs_no_by_price.py:95
↓ 1 callers
Method
_create_figure
Create the matplotlib figure.
src/analysis/kalshi/ev_yes_vs_no.py:126
↓ 1 callers
Method
_create_figure
Create the matplotlib figure.
src/analysis/kalshi/maker_returns_by_direction.py:127
↓ 1 callers
Method
_create_figure
Create the matplotlib figure.
src/analysis/kalshi/vwap_by_hour.py:85
↓ 1 callers
Method
_create_figure
Create the matplotlib figure.
src/analysis/kalshi/maker_win_rate_by_direction.py:120
↓ 1 callers
Method
_create_figure
Create the matplotlib figure.
src/analysis/kalshi/volume_over_time.py:49
↓ 1 callers
Method
_create_figure
Create the matplotlib figure.
src/analysis/kalshi/maker_taker_gap_over_time.py:109
↓ 1 callers
Method
_create_figure
Create the matplotlib figure.
src/analysis/kalshi/kalshi_calibration_deviation_over_time.py:132
↓ 1 callers
Method
_create_figure
Create the matplotlib figure.
src/analysis/kalshi/maker_vs_taker_returns.py:132
↓ 1 callers
Method
_create_figure
Create the matplotlib figure.
src/analysis/kalshi/win_rate_by_trade_size.py:91
↓ 1 callers
Method
_create_figure
Create the matplotlib treemap figure.
src/analysis/kalshi/market_types.py:155
↓ 1 callers
Method
_create_figure
Create the matplotlib figure.
src/analysis/kalshi/mispricing_by_price.py:132
↓ 1 callers
Method
_create_figure
Create the matplotlib figure.
src/analysis/kalshi/returns_by_hour.py:84
↓ 1 callers
Method
_create_figure
Create the matplotlib figure.
src/analysis/kalshi/maker_taker_returns_by_category.py:162
↓ 1 callers
Method
_create_figure
Create the matplotlib figure.
src/analysis/kalshi/trade_size_by_role.py:102
↓ 1 callers
Method
_create_figure
Create the matplotlib figure.
src/analysis/kalshi/longshot_volume_share_over_time.py:120
↓ 1 callers
Method
_decode_fpmm_buy
Decode an FPMMBuy event log.
src/indexers/polymarket/fpmm_trades.py:84
↓ 1 callers
Method
_decode_fpmm_sell
Decode an FPMMSell event log.
src/indexers/polymarket/fpmm_trades.py:110
↓ 1 callers
Method
_decode_order_filled
Decode an OrderFilled event log.
src/indexers/polymarket/blockchain.py:126
↓ 1 callers
Function
_discover_modules
Collect dotted module names for every .py file under src/.
tests/test_compile.py:17
↓ 1 callers
Method
_format_billions
Format a number as billions with 2 decimal places.
src/analysis/kalshi/meta_stats.py:111
↓ 1 callers
Method
_format_millions
Format a number as millions with 1 decimal place.
src/analysis/kalshi/meta_stats.py:116
↓ 1 callers
Method
_get_last_indexed_block
Get the highest block number from existing files based on filename.
src/indexers/polymarket/blocks.py:68
↓ 1 callers
Method
_get_latest_block
Get the latest block number from the chain.
src/indexers/polymarket/blocks.py:87
↓ 1 callers
Method
_interpolate_timestamps
Interpolate timestamps for all blocks between sampled points.
src/indexers/polymarket/blocks.py:42
↓ 1 callers
Method
_load_existing_tickers
Load all existing tickers for deduplication.
src/common/storage.py:27
↓ 1 callers
Method
_load_kalshi_aggregates
Load Kalshi trades pre-aggregated by week and price.
src/analysis/comparison/win_rate_by_price_animated.py:230
↓ 1 callers
Method
_load_polymarket_aggregates
Load Polymarket trades pre-aggregated by week and price, including legacy trades.
src/analysis/comparison/win_rate_by_price_animated.py:271
↓ 1 callers
Function
_make_kalshi_markets
Build minimal Kalshi markets DataFrame (2 rows).
tests/conftest.py:56
↓ 1 callers
Function
_make_kalshi_trades
Build Kalshi trades DataFrame (2100 rows). 7 price levels x 3 variants x 100 copies. The 100-copy multiplier ensures analyses with minimum-s
tests/conftest.py:19
↓ 1 callers
Function
_make_polymarket_blocks
Build blocks DataFrame with an entry for every exact block_number in trades. Needed by PolymarketTradesOverTimeAnalysis (direct join) and volume/
tests/conftest.py:168
↓ 1 callers
Function
_make_polymarket_markets
Build minimal Polymarket markets DataFrame (2 rows). Market A resolved YES (outcome_prices=[1.0, 0.0]), has FPMM address. Market B resolved N
tests/conftest.py:142
↓ 1 callers
Method
_save_bucket
Save a bucket of records to a parquet file.
src/indexers/polymarket/blocks.py:150
↓ 1 callers
Method
_test_category_gaps
Test 3: Category gap differences.
src/analysis/kalshi/statistical_tests.py:260
↓ 1 callers
Method
_test_maker_direction
Test 5: Maker direction performance.
src/analysis/kalshi/statistical_tests.py:380
↓ 1 callers
Method
_test_trade_size_by_role
Test 1: Trade size by role across price levels.
src/analysis/kalshi/statistical_tests.py:103
↓ 1 callers
Method
_test_trade_size_performance
Test 4: Trade size -> performance relationship.
src/analysis/kalshi/statistical_tests.py:320
↓ 1 callers
Method
_test_yes_no_asymmetry
Test 2: YES/NO asymmetry by price level.
src/analysis/kalshi/statistical_tests.py:157
↓ 1 callers
Method
_throttle
(self)
src/common/client.py:69
next →
1–100 of 266, ranked by callers