MCPcopy Create free account

hub / github.com/DextersSlab/Polymarket-Arbitrage-Trading-Bot / functions

Functions389 in github.com/DextersSlab/Polymarket-Arbitrage-Trading-Bot

↓ 48 callersMethodappend
Write one NDJSON line; return monotonic ``seq`` within this cycle.
src/polybot5m/trading_process_log.py:263
↓ 12 callersFunction_log
( tag: str, msg: str, *, slot: MarketSlot | None = None, remaining_s: float | None = None,
src/polybot5m/execution/exit_strategy.py:72
↓ 10 callersFunction_fmt_strike_spot_price
Format a positive strike or spot for logs; missing or non-positive → em dash.
src/polybot5m/execution/executor.py:72
↓ 10 callersFunction_jsonl
(slot: MarketSlot, row: dict[str, Any])
src/polybot5m/execution/exit_strategy.py:85
↓ 8 callersFunction_best_bid_for_outcome
(slot: MarketSlot, outcome: str)
src/polybot5m/execution/exit_strategy.py:60
↓ 7 callersMethod_cached_conditional_pair
( self, yes_token_id: str, no_token_id: str, *, max_age_s: float,
src/polybot5m/execution/clob_client.py:631
↓ 6 callersFunction_best_ask_from_book
Extract best (lowest) ask price from order book. Returns 0.0 if empty.
src/polybot5m/execution/executor.py:251
↓ 6 callersMethod_store_conditional_pair
( self, yes_token_id: str, no_token_id: str, yes_v: float, no_v: float
src/polybot5m/execution/clob_client.py:647
↓ 6 callersFunction_ws_is_open
(ws: Any)
src/polybot5m/data/clob_user_ws.py:54
↓ 6 callersFunctionappend_trading_jsonl
(path: str | Path | None, row: dict[str, Any])
src/polybot5m/trading_process_log.py:395
↓ 6 callersMethodbook_as_executor_view
Snapshot as object with `.bids`/`.asks` list[dict] for executor / influence helpers.
src/polybot5m/data/orderbook.py:35
↓ 6 callersMethodclose
(self)
src/polybot5m/execution/clob_client.py:616
↓ 6 callersFunctionresolve_deposit_wallet_address
Resolve the deposit wallet used as CLOB funder and on-chain inventory holder. Uses POLYBOT5MBES_EXECUTION__FUNDER when set to a non-zero add
src/polybot5m/execution/deposit_wallet.py:292
↓ 6 callersFunctionutc_iso_z
()
src/polybot5m/trading_process_log.py:13
↓ 6 callersMethodwallet_address
(self)
src/polybot5m/execution/clob_client.py:293
↓ 5 callersMethod_is_exit_attempt
(self, reason: str)
src/polybot5m/backtest/simulation.py:264
↓ 5 callersMethod_pos
(self, token_id: str)
src/polybot5m/execution/paper_exchange.py:111
↓ 5 callersMethod_position_shares
(self, slot: MarketSlot, pos: PositionState)
src/polybot5m/execution/exit_strategy.py:280
↓ 5 callersFunctioncollateral_adapter_address
On-chain target for splitPosition / mergePositions / redeemPositions (V2 adapters).
src/polybot5m/constants.py:89
↓ 5 callersMethoddeactivate
(self, sym: str)
src/polybot5m/execution/executor.py:148
↓ 5 callersFunctionround_t_minus_s
Seconds until epoch end, millisecond precision (3 decimals); None if unknown.
src/polybot5m/trading_process_log.py:17
↓ 5 callersFunctionspot_minus_strike_usd
Spot (chain/index) minus epoch strike in USD; None if either value is missing or non-positive.
src/polybot5m/trading_process_log.py:58
↓ 5 callersMethodwait
(self, *, max_polls: int = 30, poll_frequency_ms: int = 2000)
src/polybot5m/execution/deposit_wallet.py:80
↓ 5 callersMethodwrite
(self, data: str)
src/polybot5m/log_setup.py:19
↓ 4 callersFunction_best_bid_from_book
Extract best (highest) bid price from order book. Returns 0.0 if empty.
src/polybot5m/execution/executor.py:236
↓ 4 callersFunction_spot_for_strike_compare
Raw Chainlink spot → value used for spot_minus_strike and sell logic.
src/polybot5m/execution/executor.py:318
↓ 4 callersFunction_utc_now
()
src/polybot5m/schedule.py:21
↓ 4 callersFunction_utc_now
()
src/polybot5m/execution/redeem_scheduler.py:30
↓ 4 callersFunction_ws_is_open
(ws: Any)
src/polybot5m/data/clob_ws.py:26
↓ 4 callersMethodbtc_wave_extrema
(self)
src/polybot5m/execution/exit_strategy.py:216
↓ 4 callersMethodflush
(self)
src/polybot5m/log_setup.py:26
↓ 4 callersFunctionformat_spot_minus_strike_for_log
Suffix fragment like ` spot_minus_strike=+12.345678` for monitor stdout lines; empty if unknown.
src/polybot5m/trading_process_log.py:71
↓ 4 callersFunctionformat_utc_iso_z
Serialize datetime as ISO-8601 UTC with Z suffix (RFC 3339 style).
src/polybot5m/time_utils.py:8
↓ 4 callersMethodrecord
(self, sms: float | None)
src/polybot5m/trading_process_log.py:124
↓ 4 callersMethodvalid
(self)
src/polybot5m/data/clob_user_ws.py:39
↓ 3 callersMethod_apply_chain_balance_fallback
( self, yes_token_id: str, no_token_id: str, yes_v: float, no_v: float
src/polybot5m/execution/clob_client.py:353
↓ 3 callersFunction_best_ask_for_outcome
(slot: MarketSlot, outcome: str)
src/polybot5m/execution/exit_strategy.py:64
↓ 3 callersFunction_fee_on_notional
(notional: float, fee_bps: float)
src/polybot5m/execution/paper_exchange.py:32
↓ 3 callersFunction_fetch_chainlink_report
GET a Chainlink report; returns (json body or None, http status).
src/polybot5m/data/chainlink_feed.py:79
↓ 3 callersFunction_format_yes_no_book_prices
YES/NO top-of-book for monitor stdout (ask + bid on one line).
src/polybot5m/execution/executor.py:266
↓ 3 callersMethod_get_json
GET JSON with 429 retry (Retry-After or exponential backoff).
src/polybot5m/backtest/client.py:29
↓ 3 callersMethod_ingest_buy_fills
(self, slot: MarketSlot)
src/polybot5m/execution/exit_strategy.py:287
↓ 3 callersFunction_levels_from_book
Parse bids or asks from CLOB-style dict { bids: [{price,size}], asks: [...] }.
src/polybot5m/backtest/simulation.py:30
↓ 3 callersMethod_on_connection_lost
(self, e: websockets.ConnectionClosed)
src/polybot5m/data/clob_user_ws.py:273
↓ 3 callersFunction_outcome_token_id
(slot: MarketSlot, outcome: str)
src/polybot5m/execution/exit_strategy.py:68
↓ 3 callersMethod_reconnect
(self)
src/polybot5m/data/clob_user_ws.py:324
↓ 3 callersFunction_refresh_rem_balances
()
src/polybot5m/execution/executor.py:620
↓ 3 callersMethod_set_pos
(self, token_id: str, shares: float, cost_basis_usdc: float)
src/polybot5m/execution/paper_exchange.py:114
↓ 3 callersFunction_utc_now
()
src/polybot5m/engine.py:59
↓ 3 callersFunction_utc_now
()
src/polybot5m/execution/executor.py:279
↓ 3 callersMethodaverage
(self)
src/polybot5m/trading_process_log.py:130
↓ 3 callersMethodbalances
(self)
src/polybot5m/execution/paper_exchange.py:405
↓ 3 callersFunctioncompute_epoch_slugs
( asset: str, interval: str, now_utc: datetime | None = None, )
src/polybot5m/data/slug_builder.py:27
↓ 3 callersMethodconnect
(self, condition_ids: list[str])
src/polybot5m/data/clob_user_ws.py:164
↓ 3 callersFunctionenrich_strategy_row_t_minus
Ensure JSONL strategy rows include ``t_minus_s`` (3 decimal places).
src/polybot5m/trading_process_log.py:38
↓ 3 callersFunctionfetch_book_as_ws_shape
REST book in the same shape as CLOB market WebSocket `book` messages.
src/polybot5m/data/clob_rest.py:13
↓ 3 callersMethodget_neg_risk
(self, token_id: str)
src/polybot5m/execution/clob_client.py:619
↓ 3 callersFunctionnormalize_condition_id
(condition_id: str)
src/polybot5m/data/clob_user_ws.py:47
↓ 3 callersMethodsync_trading_balances
Official SDK: update_balance_allowance(COLLATERAL).
src/polybot5m/execution/clob_client.py:503
↓ 3 callersMethodupdate_btc_strategy_context
( self, *, spot_minus_strike_btc: float | None = None, averge_spot_minus_btc:
src/polybot5m/execution/exit_strategy.py:187
↓ 2 callersFunction_aggregate_levels
price -> total size for bids or asks.
src/polybot5m/data/orderbook_influence.py:15
↓ 2 callersMethod_apply_settlement_locked
( self, p: _PendingSettlement, *, eps: float, )
src/polybot5m/execution/paper_exchange.py:194
↓ 2 callersMethod_averge_spot_minus_btc
(self)
src/polybot5m/execution/exit_strategy.py:255
↓ 2 callersFunction_best_ask_from_orderbook
(ob: Any)
src/polybot5m/backtest/replay.py:68
↓ 2 callersFunction_best_bid_from_orderbook
(ob: Any)
src/polybot5m/backtest/replay.py:42
↓ 2 callersFunction_chainlink_feed_id_for_symbol
(feed_ids: dict[str, str], symbol: str)
src/polybot5m/execution/executor.py:309
↓ 2 callersFunction_clamp_sell_price
(best_bid: float, offset: float)
src/polybot5m/execution/exit_strategy.py:35
↓ 2 callersFunction_classify_event
(event_data: dict[str, Any])
src/polybot5m/data/gamma.py:50
↓ 2 callersFunction_condition_id_to_bytes32
Convert hex condition_id (0x... or raw hex) to 32-byte bytes.
src/polybot5m/execution/redeem.py:134
↓ 2 callersMethod_connect_and_subscribe
(self)
src/polybot5m/data/clob_user_ws.py:188
↓ 2 callersMethod_connect_and_subscribe
(self)
src/polybot5m/data/clob_ws.py:74
↓ 2 callersFunction_encode_redeem_calldata
Return hex-encoded calldata for redeemPositions(collateralToken, parentCollectionId, conditionId, indexSets). Same pattern as: selector = keccak(
src/polybot5m/execution/redeem.py:151
↓ 2 callersMethod_exec_snapshot
( self, decision_ts: datetime, latency_ms: float, )
src/polybot5m/backtest/simulation.py:249
↓ 2 callersMethod_fetch_conditional_pair_via_chain
ERC-1155 balanceOf on CTF — source of truth after relayer split (deposit wallet).
src/polybot5m/execution/clob_client.py:328
↓ 2 callersMethod_fetch_conditional_pair_via_chain_primary
On-chain CTF balanceOf — no CLOB calls (safe for high-frequency monitor polls).
src/polybot5m/execution/clob_client.py:392
↓ 2 callersMethod_fetch_conditional_pair_via_clob_sync
CLOB balance-allowance (optional update), Data API /positions, then on-chain CTF.
src/polybot5m/execution/clob_client.py:415
↓ 2 callersMethod_finish_risk_exit
(self, slot: MarketSlot, reason: str)
src/polybot5m/execution/exit_strategy.py:625
↓ 2 callersMethod_global_gates_ok
( self, cfg: Buy1Config | Buy2Config, *, sms_btc: float, avg_btc: floa
src/polybot5m/execution/exit_strategy.py:362
↓ 2 callersMethod_handle_payload
(self, data: dict[str, Any])
src/polybot5m/data/clob_user_ws.py:293
↓ 2 callersMethod_latency_ms
(self)
src/polybot5m/backtest/simulation.py:236
↓ 2 callersFunction_load_builder_creds_pool
Load builder API credentials from env. Supports: - POLYBOT5MBES_EXECUTION__BUILDER_API_KEY_1, _SECRET_1, _PASSPHRASE_1 (through _5 or more)
src/polybot5m/execution/redeem.py:79
↓ 2 callersMethod_max_sell_attempts_for_reason
(self, reason: str)
src/polybot5m/execution/exit_strategy.py:482
↓ 2 callersFunction_normalized_weekdays
(weekdays: list[str])
src/polybot5m/schedule.py:25
↓ 2 callersMethod_ob_for_side
(self, token_side: str, ob_yes: Any, ob_no: Any)
src/polybot5m/backtest/simulation.py:246
↓ 2 callersFunction_order_type_from_str
(s: str)
src/polybot5m/execution/clob_client.py:68
↓ 2 callersFunction_owner_address
(private_key: str)
src/polybot5m/execution/deposit_wallet.py:206
↓ 2 callersFunction_parse_dt
(s: str | None)
src/polybot5m/backtest/replay.py:27
↓ 2 callersFunction_parse_json_string_list
(value: Any)
src/polybot5m/data/gamma.py:20
↓ 2 callersFunction_parse_slug_structured
Parse btc-updown-5m-1707836100 style slug.
src/polybot5m/data/gamma.py:33
↓ 2 callersMethod_place_limit_sell
( self, slot: MarketSlot, outcome: str, price: float, shares: float,
src/polybot5m/execution/exit_strategy.py:898
↓ 2 callersMethod_post_submit
(self, body: dict[str, Any])
src/polybot5m/execution/deposit_wallet.py:129
↓ 2 callersFunction_price_from_report_payload
(data: object)
src/polybot5m/data/chainlink_feed.py:60
↓ 2 callersMethod_reconnect
(self)
src/polybot5m/data/clob_ws.py:144
↓ 2 callersMethod_refresh_slot_strategy_extras
(self)
src/polybot5m/execution/exit_strategy.py:182
↓ 2 callersMethod_register_conditional_balance_failure
(self)
src/polybot5m/execution/clob_client.py:657
↓ 2 callersMethod_run_buy
( self, slot: MarketSlot, outcome: str, *, label: str, cfg: Bu
src/polybot5m/execution/exit_strategy.py:748
↓ 2 callersMethod_sell_offset_for_reason
(self, reason: str)
src/polybot5m/execution/exit_strategy.py:473
↓ 2 callersMethod_side_book_ok
( self, slot: MarketSlot, outcome: str, *, max_spread: float,
src/polybot5m/execution/exit_strategy.py:346
↓ 2 callersMethod_spot_minus_strike_btc
(self)
src/polybot5m/execution/exit_strategy.py:261
↓ 2 callersMethod_spot_minus_strike_eth
(self)
src/polybot5m/execution/exit_strategy.py:264
next →1–100 of 389, ranked by callers