MCPcopy Create free account

hub / github.com/Jon-Becker/prediction-market-analysis / functions

Functions266 in github.com/Jon-Becker/prediction-market-analysis

↓ 1 callersFunctionanalyze
Run analysis by name or show interactive menu.
main.py:14
↓ 1 callersMethodappend_markets
(self, markets: list)
src/common/storage.py:38
↓ 1 callersMethodget_block_timestamp
Get timestamp for a block.
src/indexers/polymarket/blockchain.py:121
↓ 1 callersFunctionget_hierarchy
Map a category to its (group, category, subcategory) tuple.
src/analysis/kalshi/util/categories.py:571
↓ 1 callersMethodget_market_trades
( self, ticker: str, limit: int = 1000, verbose: bool = True, min_ts:
src/indexers/kalshi/client.py:28
↓ 1 callersMethodget_markets
(self, limit: int = 500, offset: int = 0, **kwargs)
src/indexers/polymarket/client.py:24
↓ 1 callersFunctionindex
Interactive indexer selection menu.
main.py:95
↓ 1 callersMethoditer_markets
(self, limit: int = 500, offset: int = 0)
src/indexers/polymarket/client.py:31
↓ 1 callersMethoditer_markets
( self, limit: int = 200, cursor: Optional[str] = None, min_close_ts: Optional
src/indexers/kalshi/client.py:89
↓ 1 callersFunctionmain
()
main.py:135
↓ 1 callersFunctionpackage
Package the data directory into a zstd-compressed tar archive.
main.py:129
↓ 1 callersFunctionpackage_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 callersMethodrun
Execute the analysis and return outputs.
src/analysis/kalshi/meta_stats.py:29
↓ 1 callersMethodrun
Execute the analysis and return outputs. Returns: AnalysisOutput containing figure, data, and optional chart config.
src/common/analysis.py:89
↓ 1 callersMethodto_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
Functionall_fixture_dirs
Bundle all fixture directories for easy access.
tests/conftest.py:250
Functionanimate
(frame)
tests/test_analysis_save.py:51
Methodanimate
(frame_idx: int)
src/analysis/comparison/win_rate_by_price_animated.py:136
Functionarea_chart
Create an area chart configuration.
src/common/interfaces/chart.py:192
Functionbar_chart
Create a bar chart configuration.
src/common/interfaces/chart.py:179
Functioncollateral_lookup_path
(tmp_path_factory: pytest.TempPathFactory)
tests/conftest.py:236
Methodcondition_id
Get condition ID from asset ID (first 32 bytes of position ID).
src/indexers/polymarket/blockchain.py:91
Methodfetch_ticker_trades
Fetch trades for a single ticker.
src/indexers/kalshi/trades.py:104
Methodfrom_dict
(cls, data: dict)
src/indexers/kalshi/models.py:71
Methodgenerate_latex_macros
Generate LaTeX macros for the statistics. Returns: String containing LaTeX macro definitions.
src/analysis/kalshi/meta_stats.py:120
Methodget_block_number
(self)
tests/test_backfill_cursor.py:33
Functionget_deployment_block
Get approximate block when Polymarket CTF Exchange was deployed.
src/indexers/polymarket/blockchain.py:243
Functionget_group
Map a category to its high-level group (for backwards compatibility).
src/analysis/kalshi/util/categories.py:580
Methodget_latest_data
Get cumulative data for the most recent week <= target_week.
src/analysis/comparison/win_rate_by_price_animated.py:125
Methodget_market
(self, ticker: str)
src/indexers/kalshi/client.py:24
Methodget_next_chunk_idx
()
src/indexers/polymarket/fpmm_trades.py:216
Methodget_next_chunk_idx
()
src/indexers/polymarket/trades.py:79
Methodget_recent_trades
(self, limit: int = 100)
src/indexers/kalshi/client.py:115
Methodget_shade
Lighten color based on index.
src/analysis/kalshi/market_types.py:199
Methodget_trades
(self, from_block: int, to_block: int, contract_address: str)
tests/test_backfill_cursor.py:36
Functionheatmap
Create a heatmap configuration.
src/common/interfaces/chart.py:234
Methodis_buy
True if maker is providing USDC (buying outcome tokens).
src/indexers/polymarket/blockchain.py:61
Functionisolated_dirs
Point DATA_DIR and CURSOR_FILE at temp directories.
tests/test_backfill_cursor.py:44
Methoditer_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
Functionkalshi_markets_dir
(tmp_path_factory: pytest.TempPathFactory)
tests/conftest.py:199
Functionkalshi_trades_dir
(tmp_path_factory: pytest.TempPathFactory)
tests/conftest.py:192
Functionline_chart
Create a line chart configuration.
src/common/interfaces/chart.py:168
Methodlist_all_markets
(self, limit: int = 200)
src/indexers/kalshi/client.py:67
Methodlist_markets
(self, limit: int = 20, **kwargs)
src/indexers/kalshi/client.py:62
Methodload
Scan directory for Analysis subclass implementations. Args: analysis_dir: Directory to scan for analysis modules. Return
src/common/analysis.py:155
Methodparse_dollars_to_cents
Converts string dollar values like '0.5600' to integer cents (56).
src/indexers/kalshi/models.py:24
Methodparse_dollars_to_cents
Converts string dollar values like '0.5600' to integer cents (56).
src/indexers/kalshi/models.py:77
Methodparse_float_string_to_int
Converts string float values like '10.00' to integers (10).
src/indexers/kalshi/models.py:30
Methodparse_float_string_to_int
Converts string float values like '10.00' to integers (10).
src/indexers/kalshi/models.py:83
Methodparse_time
(val: Optional[str])
src/indexers/polymarket/models.py:25
← previousnext →101–200 of 266, ranked by callers