MCPcopy Create free account

hub / github.com/brodyautomates/polymarket-pipeline / functions

Functions101 in github.com/brodyautomates/polymarket-pipeline

↓ 12 callersFunction_conn
()
logger.py:10
↓ 9 callersFunctionfetch_active_markets
Fetch active, liquid markets from Polymarket's Gamma API.
markets.py:29
↓ 8 callersFunctionfilter_by_categories
Filter markets to only target categories.
markets.py:189
↓ 6 callersFunction_log_and_return
Log trade to SQLite and return result dict.
executor.py:68
↓ 5 callersFunctionscrape_all
Run all scrapers and return deduplicated, sorted results.
scraper.py:117
↓ 4 callersMethod_headers
(self)
news_stream.py:46
↓ 4 callersMethodage_hours
(self)
scraper.py:21
↓ 4 callersMethodrefresh_markets
Fetch and filter markets from Gamma API.
market_watcher.py:55
↓ 4 callersMethodstream
Poll RSS feeds periodically and emit new headlines.
news_stream.py:215
↓ 3 callersFunction_infer_category
Infer category from question text and tags.
markets.py:170
↓ 3 callersFunctionfilter_news_for_market
Quick keyword filter to reduce noise before scoring.
scorer.py:94
↓ 3 callersFunctionmatch_news_to_markets
Find markets that a news headline is relevant to. Uses keyword overlap scoring — fast, no API call.
matcher.py:31
↓ 3 callersFunctionscore_market
Score a market question against recent news using Claude.
scorer.py:39
↓ 3 callersFunctionsize_position
Quarter-Kelly position sizing. Capped at MAX_BET_USD.
edge.py:121
↓ 2 callersFunctioncheck_resolutions
Check if any open trades have resolved. Update calibration table. Queries Gamma API for market resolution status.
calibrator.py:29
↓ 2 callersFunctionclassify
Classify a news headline against a market question. Synchronous.
classifier.py:55
↓ 2 callersFunctiondetect_edge
V1: Compare Claude's confidence against market price.
edge.py:30
↓ 2 callersFunctionexecute_trade
Execute a trade on Polymarket or log a dry-run. Synchronous.
executor.py:11
↓ 2 callersFunctionget_report
Generate a calibration report from stored data.
calibrator.py:110
↓ 2 callersFunctionrender_footer
()
dashboard.py:320
↓ 2 callersFunctionrender_header
()
dashboard.py:130
↓ 2 callersFunctionrender_performance
()
dashboard.py:176
↓ 2 callersFunctionrender_scanner
()
dashboard.py:212
↓ 2 callersFunctionrender_status
()
dashboard.py:144
↓ 2 callersFunctionrender_trades
()
dashboard.py:276
↓ 2 callersMethodrun
Start all sources and the dedup router.
news_stream.py:272
↓ 2 callersMethodrun
Start all pipeline components concurrently.
pipeline.py:53
↓ 2 callersFunctionrun_backtest
Run a backtest against resolved markets. Uses mock headlines derived from market questions if none provided.
backtest.py:110
↓ 2 callersFunctionrun_dashboard
Launch the live dashboard. Scans on a configurable interval.
dashboard.py:343
↓ 2 callersFunctionrun_pipeline
V1: Run the full pipeline once. Returns list of trade results.
pipeline.py:166
↓ 2 callersFunctionscrape_rss
Parse a single RSS feed and return recent items.
scraper.py:26
↓ 1 callersMethod_connect_websocket
Connect to Polymarket WebSocket for live price updates.
market_watcher.py:92
↓ 1 callersMethod_dedup_router
Deduplicate and forward events to output queue.
news_stream.py:282
↓ 1 callersFunction_execute_live
Place a real order via Polymarket CLOB client.
executor.py:28
↓ 1 callersMethod_execute_signals
Execute trades from the signal queue.
pipeline.py:122
↓ 1 callersFunction_extract_keywords
Extract meaningful keywords from a market question.
scorer.py:109
↓ 1 callersFunction_fetch_from_clob
Fallback: fetch from CLOB API directly.
markets.py:123
↓ 1 callersMethod_handle_ws_message
Process a WebSocket price update.
market_watcher.py:130
↓ 1 callersFunction_migrate_v2_columns
Add V2 columns to trades table if they don't exist.
logger.py:91
↓ 1 callersMethod_polling_fallback
Poll Gamma API for price updates when WebSocket unavailable.
market_watcher.py:156
↓ 1 callersFunction_print_report
Print a rich backtest report.
backtest.py:229
↓ 1 callersFunction_print_summary
(results: list[dict], markets_scanned: int, signals_found: int)
pipeline.py:245
↓ 1 callersMethod_process_news
Process each news event: match → classify → detect edge.
pipeline.py:75
↓ 1 callersMethod_status_printer
Print periodic status updates.
pipeline.py:137
↓ 1 callersFunction_test
()
news_stream.py:302
↓ 1 callersFunction_test
()
market_watcher.py:193
↓ 1 callersFunctionclassify_async
Async wrapper around classify().
classifier.py:111
↓ 1 callersFunctiondeduplicate
Remove near-duplicate headlines by normalized prefix matching.
scraper.py:105
↓ 1 callersFunctiondetect_edge_v2
V2: Use classification direction + materiality instead of probability estimation. Only generates a signal when: - Direction is bullish or
edge.py:64
↓ 1 callersFunctionexecute_trade_async
Async wrapper around execute_trade.
executor.py:23
↓ 1 callersFunctionextract_keywords
Extract meaningful keywords from a market question.
matcher.py:13
↓ 1 callersFunctionfetch_resolved_markets
Fetch recently resolved markets from Gamma API.
backtest.py:53
↓ 1 callersMethodget_niche_markets
Filter to niche markets within volume bounds.
market_watcher.py:47
↓ 1 callersFunctionget_token_id
Get the token ID for a given side (YES/NO).
markets.py:195
↓ 1 callersFunctioninit_db
()
logger.py:17
↓ 1 callersFunctionmain
()
cli.py:380
↓ 1 callersFunctionmake_layout
()
dashboard.py:108
↓ 1 callersFunctionprinter
()
news_stream.py:306
↓ 1 callersMethodrun
Start the market watcher — refresh + WebSocket + polling fallback.
market_watcher.py:164
↓ 1 callersFunctionrun_pipeline_v2
Entry point for V2 event-driven pipeline.
pipeline.py:153
↓ 1 callersFunctionrun_scan_cycle
Execute one full pipeline scan and update state.
dashboard.py:59
↓ 1 callersFunctionscrape_newsapi
Pull from NewsAPI.org if key is configured.
scraper.py:60
↓ 1 callersMethodsetup_rules
Set up filtered stream rules based on keywords.
news_stream.py:49
Method__init__
(self, bearer_token: str, keywords: list[str])
news_stream.py:40
Method__init__
(self, bot_token: str, channel_ids: list[str])
news_stream.py:154
Method__init__
(self, interval_seconds: float = 120)
news_stream.py:211
Method__init__
(self, output_queue: asyncio.Queue)
news_stream.py:261
Method__init__
(self)
dashboard.py:42
Method__init__
(self)
market_watcher.py:36
Method__init__
(self)
pipeline.py:40
Methodage_seconds
(self)
news_stream.py:33
Functioncmd_backtest
Run backtest against resolved markets.
cli.py:67
Functioncmd_calibrate
Show classification accuracy report.
cli.py:73
Functioncmd_dashboard
(args)
cli.py:137
Functioncmd_markets
(args)
cli.py:290
Functioncmd_niche
Browse niche markets only (volume-filtered).
cli.py:104
Functioncmd_run
V1: Synchronous pipeline — RSS → score → trade.
cli.py:47
Functioncmd_scrape
(args)
cli.py:273
Functioncmd_stats
(args)
cli.py:354
Functioncmd_trades
(args)
cli.py:311
Functioncmd_verify
Check all API keys and connections work.
cli.py:142
Functioncmd_watch
V2: Event-driven pipeline — real-time news → classify → trade.
cli.py:30
Functionget_calibration_stats
()
logger.py:262
Functionget_daily_pnl
()
logger.py:217
Functionget_latency_stats
()
logger.py:301
Methodget_market_by_question
Find a tracked market by partial question match.
market_watcher.py:180
Functionget_recent_news_events
(limit: int = 20)
logger.py:240
Functionget_recent_trades
(limit: int = 20)
logger.py:231
Methodget_snapshot
(self, condition_id: str)
market_watcher.py:188
Functionget_trade_stats
()
logger.py:249
Methodimplied_probability
(self)
markets.py:25
Functionlog_calibration
( trade_id: int, classification: str, materiality: float, entry_price: float, exit_price:
logger.py:168
Functionlog_news_event
( headline: str, source: str, received_at: str, latency_ms: int = 0, matched_markets: int
logger.py:147
Functionlog_run_end
(run_id: int, markets_scanned: int, signals_found: int, trades_placed: int, status: str = "completed")
logger.py:204
Functionlog_run_start
()
logger.py:192
Functionlog_trade
( market_id: str, market_question: str, claude_score: float, market_price: float, edge: fl
logger.py:109
Functionmatch_news_to_markets_broad
Broader matching using headline + summary text. Falls back to category matching if keyword matching returns nothing.
matcher.py:62
Methodprice_change
(self)
market_watcher.py:29
Methodrefresh_loop
()
market_watcher.py:168
Methodstream
Connect to filtered stream and emit NewsEvents.
news_stream.py:90
next →1–100 of 101, ranked by callers