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
↓ 1 callers
Function
analyze
Run analysis by name or show interactive menu.
main.py:14
↓ 1 callers
Method
append_markets
(self, markets: list)
src/common/storage.py:38
↓ 1 callers
Method
get_block_timestamp
Get timestamp for a block.
src/indexers/polymarket/blockchain.py:121
↓ 1 callers
Function
get_hierarchy
Map a category to its (group, category, subcategory) tuple.
src/analysis/kalshi/util/categories.py:571
↓ 1 callers
Method
get_market_trades
( self, ticker: str, limit: int = 1000, verbose: bool = True, min_ts:
src/indexers/kalshi/client.py:28
↓ 1 callers
Method
get_markets
(self, limit: int = 500, offset: int = 0, **kwargs)
src/indexers/polymarket/client.py:24
↓ 1 callers
Function
index
Interactive indexer selection menu.
main.py:95
↓ 1 callers
Method
iter_markets
(self, limit: int = 500, offset: int = 0)
src/indexers/polymarket/client.py:31
↓ 1 callers
Method
iter_markets
( self, limit: int = 200, cursor: Optional[str] = None, min_close_ts: Optional
src/indexers/kalshi/client.py:89
↓ 1 callers
Function
main
()
main.py:135
↓ 1 callers
Function
package
Package the data directory into a zstd-compressed tar archive.
main.py:129
↓ 1 callers
Function
package_data
Package the data directory into a zstd-compressed tar archive. Args: data_dir: Path to the data directory to compress. output_pat
src/common/util/package.py:5
↓ 1 callers
Method
run
Execute the analysis and return outputs.
src/analysis/kalshi/meta_stats.py:29
↓ 1 callers
Method
run
Execute the analysis and return outputs. Returns: AnalysisOutput containing figure, data, and optional chart config.
src/common/analysis.py:89
↓ 1 callers
Method
to_dict
Convert to dict for JSON serialization, omitting None values.
src/common/interfaces/chart.py:118
Method
__enter__
(self)
src/indexers/polymarket/client.py:15
Method
__enter__
(self)
src/indexers/kalshi/client.py:15
Method
__enter__
(self)
src/common/client.py:60
Method
__exit__
(self, *args)
src/indexers/polymarket/client.py:18
Method
__exit__
(self, *args)
src/indexers/kalshi/client.py:18
Method
__exit__
(self, *args)
src/common/client.py:63
Method
__init__
(self, gamma_url: str = GAMMA_API_URL)
src/indexers/polymarket/client.py:11
Method
__init__
(self)
src/indexers/polymarket/blocks.py:27
Method
__init__
(self)
src/indexers/polymarket/markets.py:20
Method
__init__
(self, rpc_url: Optional[str] = None)
src/indexers/polymarket/blockchain.py:105
Method
__init__
( self, from_block: Optional[int] = None, to_block: Optional[int] = None, chun
src/indexers/polymarket/fpmm_trades.py:68
Method
__init__
( self, from_block: Optional[int] = None, to_block: Optional[int] = None, chun
src/indexers/polymarket/trades.py:26
Method
__init__
(self, host: str = KALSHI_API_HOST)
src/indexers/kalshi/client.py:11
Method
__init__
( self, min_close_ts: Optional[int] = None, max_close_ts: Optional[int] = None, )
src/indexers/kalshi/markets.py:17
Method
__init__
( self, min_ts: Optional[int] = None, max_ts: Optional[int] = None, max_worker
src/indexers/kalshi/trades.py:24
Method
__init__
( self, kalshi_trades_dir: Path | str | None = None, kalshi_markets_dir: Path | str |
src/analysis/comparison/win_rate_by_price_animated.py:33
Method
__init__
( self, trades_dir: Path | str | None = None, legacy_trades_dir: Path | str | None = N
src/analysis/polymarket/polymarket_volume_over_time.py:22
Method
__init__
( self, trades_dir: Path | str | None = None, legacy_trades_dir: Path | str | None = N
src/analysis/polymarket/polymarket_trades_over_time.py:18
Method
__init__
( self, trades_dir: Path | str | None = None, legacy_trades_dir: Path | str | None = N
src/analysis/polymarket/polymarket_calibration_by_bucket.py:29
Method
__init__
( self, trades_dir: Path | str | None = None, legacy_trades_dir: Path | str | None = N
src/analysis/polymarket/polymarket_win_rate_by_price.py:20
Method
__init__
( self, trades_dir: Path | str | None = None, markets_dir: Path | str | None = None,
src/analysis/kalshi/win_rate_by_price.py:18
Method
__init__
( self, trades_dir: Path | str | None = None, )
src/analysis/kalshi/yes_vs_no_by_price.py:18
Method
__init__
( self, trades_dir: Path | str | None = None, markets_dir: Path | str | None = None,
src/analysis/kalshi/ev_yes_vs_no.py:30
Method
__init__
( self, trades_dir: Path | str | None = None, markets_dir: Path | str | None = None,
src/analysis/kalshi/maker_returns_by_direction.py:24
Method
__init__
( self, trades_dir: Path | str | None = None, markets_dir: Path | str | None = None,
src/analysis/kalshi/vwap_by_hour.py:25
Method
__init__
( self, trades_dir: Path | str | None = None, markets_dir: Path | str | None = None,
src/analysis/kalshi/maker_win_rate_by_direction.py:23
Method
__init__
( self, trades_dir: Path | str | None = None, )
src/analysis/kalshi/volume_over_time.py:18
Method
__init__
( self, trades_dir: Path | str | None = None, markets_dir: Path | str | None = None,
src/analysis/kalshi/maker_taker_gap_over_time.py:23
Method
__init__
( self, trades_dir: Path | str | None = None, markets_dir: Path | str | None = None,
src/analysis/kalshi/meta_stats.py:16
Method
__init__
( self, trades_dir: Path | str | None = None, markets_dir: Path | str | None = None,
src/analysis/kalshi/kalshi_calibration_deviation_over_time.py:19
Method
__init__
( self, trades_dir: Path | str | None = None, markets_dir: Path | str | None = None,
src/analysis/kalshi/statistical_tests.py:29
Method
__init__
( self, trades_dir: Path | str | None = None, markets_dir: Path | str | None = None,
src/analysis/kalshi/maker_vs_taker_returns.py:25
Method
__init__
( self, trades_dir: Path | str | None = None, markets_dir: Path | str | None = None,
src/analysis/kalshi/win_rate_by_trade_size.py:24
Method
__init__
( self, markets_dir: Path | str | None = None, )
src/analysis/kalshi/market_types.py:23
Method
__init__
( self, trades_dir: Path | str | None = None, markets_dir: Path | str | None = None,
src/analysis/kalshi/mispricing_by_price.py:18
Method
__init__
( self, trades_dir: Path | str | None = None, markets_dir: Path | str | None = None,
src/analysis/kalshi/returns_by_hour.py:23
Method
__init__
( self, trades_dir: Path | str | None = None, markets_dir: Path | str | None = None,
src/analysis/kalshi/maker_taker_returns_by_category.py:25
Method
__init__
( self, trades_dir: Path | str | None = None, markets_dir: Path | str | None = None,
src/analysis/kalshi/trade_size_by_role.py:23
Method
__init__
( self, trades_dir: Path | str | None = None, markets_dir: Path | str | None = None,
src/analysis/kalshi/longshot_volume_share_over_time.py:23
Method
__init__
( self, *, rate_limit: float = 10, max_retries: int = 5, timeout: floa
src/common/client.py:37
Method
__init__
(self, name: str, description: str)
src/common/analysis.py:63
Method
__init__
(self, data_dir: Union[Path, str] = "data")
src/common/storage.py:13
Method
__init__
(self, name: str, description: str)
src/common/indexer.py:30
Method
__init__
(self, *, interrupt_at_block: int | None = None)
tests/test_backfill_cursor.py:29
Method
__init__
(self, output: AnalysisOutput)
tests/test_analysis_save.py:19
Method
_do
()
src/common/client.py:94
Method
_fetch_chunk
Fetch a single chunk of trades. Used by thread pool.
src/indexers/polymarket/blockchain.py:173
Method
_fetch_chunk
Fetch a single chunk of trades. Used by thread pool.
src/indexers/polymarket/fpmm_trades.py:156
Method
_fetch_timestamp
Fetch timestamp for a single block. Returns (block_number, unix_timestamp).
src/indexers/polymarket/blocks.py:33
Function
_is_retryable
(exc: BaseException)
src/common/client.py:18
Function
all_fixture_dirs
Bundle all fixture directories for easy access.
tests/conftest.py:250
Function
animate
(frame)
tests/test_analysis_save.py:51
Method
animate
(frame_idx: int)
src/analysis/comparison/win_rate_by_price_animated.py:136
Function
area_chart
Create an area chart configuration.
src/common/interfaces/chart.py:192
Function
bar_chart
Create a bar chart configuration.
src/common/interfaces/chart.py:179
Function
collateral_lookup_path
(tmp_path_factory: pytest.TempPathFactory)
tests/conftest.py:236
Method
condition_id
Get condition ID from asset ID (first 32 bytes of position ID).
src/indexers/polymarket/blockchain.py:91
Method
fetch_ticker_trades
Fetch trades for a single ticker.
src/indexers/kalshi/trades.py:104
Method
from_dict
(cls, data: dict)
src/indexers/kalshi/models.py:71
Method
generate_latex_macros
Generate LaTeX macros for the statistics. Returns: String containing LaTeX macro definitions.
src/analysis/kalshi/meta_stats.py:120
Method
get_block_number
(self)
tests/test_backfill_cursor.py:33
Function
get_deployment_block
Get approximate block when Polymarket CTF Exchange was deployed.
src/indexers/polymarket/blockchain.py:243
Function
get_group
Map a category to its high-level group (for backwards compatibility).
src/analysis/kalshi/util/categories.py:580
Method
get_latest_data
Get cumulative data for the most recent week <= target_week.
src/analysis/comparison/win_rate_by_price_animated.py:125
Method
get_market
(self, ticker: str)
src/indexers/kalshi/client.py:24
Method
get_next_chunk_idx
()
src/indexers/polymarket/fpmm_trades.py:216
Method
get_next_chunk_idx
()
src/indexers/polymarket/trades.py:79
Method
get_recent_trades
(self, limit: int = 100)
src/indexers/kalshi/client.py:115
Method
get_shade
Lighten color based on index.
src/analysis/kalshi/market_types.py:199
Method
get_trades
(self, from_block: int, to_block: int, contract_address: str)
tests/test_backfill_cursor.py:36
Function
heatmap
Create a heatmap configuration.
src/common/interfaces/chart.py:234
Method
is_buy
True if maker is providing USDC (buying outcome tokens).
src/indexers/polymarket/blockchain.py:61
Function
isolated_dirs
Point DATA_DIR and CURSOR_FILE at temp directories.
tests/test_backfill_cursor.py:44
Method
iter_trades
Iterate through trades in chunks of blocks using parallel fetching. Args: from_block: Starting block number to_block:
src/indexers/polymarket/blockchain.py:189
Function
kalshi_markets_dir
(tmp_path_factory: pytest.TempPathFactory)
tests/conftest.py:199
Function
kalshi_trades_dir
(tmp_path_factory: pytest.TempPathFactory)
tests/conftest.py:192
Function
line_chart
Create a line chart configuration.
src/common/interfaces/chart.py:168
Method
list_all_markets
(self, limit: int = 200)
src/indexers/kalshi/client.py:67
Method
list_markets
(self, limit: int = 20, **kwargs)
src/indexers/kalshi/client.py:62
Method
load
Scan directory for Analysis subclass implementations. Args: analysis_dir: Directory to scan for analysis modules. Return
src/common/analysis.py:155
Method
parse_dollars_to_cents
Converts string dollar values like '0.5600' to integer cents (56).
src/indexers/kalshi/models.py:24
Method
parse_dollars_to_cents
Converts string dollar values like '0.5600' to integer cents (56).
src/indexers/kalshi/models.py:77
Method
parse_float_string_to_int
Converts string float values like '10.00' to integers (10).
src/indexers/kalshi/models.py:30
Method
parse_float_string_to_int
Converts string float values like '10.00' to integers (10).
src/indexers/kalshi/models.py:83
Method
parse_time
(val: Optional[str])
src/indexers/polymarket/models.py:25
← previous
next →
101–200 of 266, ranked by callers