MCPcopy Create free account

hub / github.com/Jonmaa/btc-polymarket-bot / functions

Functions46 in github.com/Jonmaa/btc-polymarket-bot

↓ 9 callersMethodget_order_book
Get order book for a token.
src/simple_arb_bot.py:248
↓ 8 callersMethod_compute_buy_fill
Compute fill information for buying `target_size` shares using the ask book. Returns: dict with keys: filled, vwap, wors
src/simple_arb_bot.py:210
↓ 8 callersMethodget_time_remaining
Get remaining time until market closes.
src/simple_arb_bot.py:140
↓ 7 callersFunctionget_client
(settings: Settings)
src/trading.py:24
↓ 4 callersFunctionfind_current_btc_15min_market
Find the current active BTC 15min market on Polymarket. Searches for markets matching the pattern 'btc-updown-15m-<timestamp>' and r
src/simple_arb_bot.py:42
↓ 3 callersMethod__init__
(self, settings)
src/simple_arb_bot.py:85
↓ 3 callersFunction_coerce_float
(val)
src/trading.py:202
↓ 3 callersMethodcheck_arbitrage
Check if an arbitrage opportunity exists. Uses order book (best ask) to get REAL prices we can buy at. Also verifies
src/simple_arb_bot.py:302
↓ 3 callersMethodexecute_arbitrage
Execute arbitrage by buying both sides.
src/simple_arb_bot.py:376
↓ 3 callersFunctionfetch_market_from_slug
(slug: str)
src/lookup.py:15
↓ 3 callersMethodshow_final_summary
Show final summary when market closes.
src/simple_arb_bot.py:620
↓ 2 callersMethod_book_from_state
(self, bid_levels: list[tuple[float, float]], ask_levels: list[tuple[float, float]])
src/simple_arb_bot.py:823
↓ 2 callersMethod_levels_to_tuples
Convert OrderSummary-like objects into (price, size) tuples.
src/simple_arb_bot.py:196
↓ 2 callersMethodget_balance
Get current USDC balance (or simulated balance in dry_run mode).
src/simple_arb_bot.py:156
↓ 2 callersMethodget_book
(self, asset_id: str)
src/wss_market.py:101
↓ 2 callersMethodrun
Async generator yielding (asset_id, event_type) for each processed message.
src/wss_market.py:104
↓ 2 callersMethodto_levels
(self)
src/wss_market.py:84
↓ 2 callersFunctionwait_for_terminal_order
Poll order state until it is terminal, filled, or timeout.
src/trading.py:254
↓ 1 callersMethod_fetch_order_books_parallel
Fetch UP/DOWN order books concurrently to reduce per-scan latency.
src/simple_arb_bot.py:291
↓ 1 callersFunction_now_s
()
src/wss_market.py:10
↓ 1 callersMethodapply_price_changes
(self, msg: dict[str, Any])
src/wss_market.py:57
↓ 1 callersMethodapply_snapshot
(self, msg: dict[str, Any])
src/wss_market.py:21
↓ 1 callersFunctioncancel_orders
(settings: Settings, order_ids: list[str])
src/trading.py:195
↓ 1 callersFunctionextract_order_id
Best-effort extraction of an order id from API responses.
src/trading.py:171
↓ 1 callersFunctionget_balance
Get USDC balance from Polymarket account.
src/trading.py:57
↓ 1 callersMethodget_current_prices
Get current prices from order book (best ask = lowest price we can BUY at). Using best_ask ensures we get the actual availab
src/simple_arb_bot.py:163
↓ 1 callersMethodget_market_result
Get which option won the market.
src/simple_arb_bot.py:596
↓ 1 callersFunctionget_order
(settings: Settings, order_id: str)
src/trading.py:190
↓ 1 callersFunctionget_positions
Get current positions (shares owned) for the user. Args: settings: Bot settings token_ids: Optional list of token IDs to
src/trading.py:296
↓ 1 callersFunctionload_settings
()
src/config.py:37
↓ 1 callersFunctionmain
()
src/diagnose_config.py:14
↓ 1 callersFunctionmain
Main entry point.
src/simple_arb_bot.py:989
↓ 1 callersFunctionmain
()
src/test_balance.py:11
↓ 1 callersFunctionmain
()
src/generate_api_key.py:6
↓ 1 callersMethodmonitor
Continuously monitor for opportunities.
src/simple_arb_bot.py:754
↓ 1 callersMethodmonitor_wss
Monitor using Polymarket CLOB Market WebSocket instead of polling.
src/simple_arb_bot.py:853
↓ 1 callersFunctionplace_order
(settings: Settings, *, side: str, token_id: str, price: float, size: float, tif: str = "GTC")
src/trading.py:82
↓ 1 callersFunctionplace_orders_fast
Place multiple orders as fast as possible. Strategy: pre-sign all orders first, then submit them together. This minimizes the time gap betwee
src/trading.py:119
↓ 1 callersMethodrun_once_async
Scan once for opportunities (async; fetches books in parallel).
src/simple_arb_bot.py:709
↓ 1 callersMethodshow_current_positions
Show current share positions for UP and DOWN tokens.
src/simple_arb_bot.py:579
↓ 1 callersFunctionsummarize_order_state
Normalize an order payload into a small, stable summary. The API field names vary by version; this function is defensive.
src/trading.py:211
Method__init__
(self, *, ws_base_url: str, asset_ids: list[str])
src/wss_market.py:96
Methodlog_connect_throttled
(msg: str)
src/wss_market.py:110
Functionnext_slug
(slug: str)
src/lookup.py:59
Functionparse_iso
(dt: str)
src/lookup.py:68
Methodrun_once
Scan once for opportunities.
src/simple_arb_bot.py:664