MCPcopy Create free account

hub / github.com/HarrierOnChain/Prediction-Markets-Trading-Bot-Toolkits / functions

Functions143 in github.com/HarrierOnChain/Prediction-Markets-Trading-Bot-Toolkits

↓ 14 callersMethodlen
(&self)
src/service/position_store.rs:73
↓ 8 callersMethodget
(&self, token_id: &str)
src/service/position_store.rs:65
↓ 7 callersFunctioncheck
(filters: &FiltersConfig, market: &MarketInfo)
src/service/eligibility.rs:23
↓ 6 callersFunctionmarket
(slug: &str, category: Option<&str>, tags: &[&str])
src/service/eligibility.rs:81
↓ 5 callersFunctioncfg
(strategy: CopyStrategy)
src/service/strategy.rs:90
↓ 5 callersFunctionsize_for_trade
(cfg: &StrategyConfig, trade: &WhaleTrade)
src/service/strategy.rs:26
↓ 4 callersFunctioncfg
()
src/service/risk_guard.rs:129
↓ 4 callersFunctionpos
(entry: f64, tp: f64, sl: f64, side: Side)
src/service/position_monitor.rs:166
↓ 4 callersFunctionpos
(slug: &str, cat: &str, tags: &[&str], usd: f64)
src/service/position_store.rs:115
↓ 4 callersFunctiontrade
(notional: f64, shares: f64)
src/service/strategy.rs:104
↓ 3 callersMethodinsert
(&self, info: MarketInfo)
src/service/market_cache.rs:89
↓ 3 callersMethodopen
(&self, pos: OpenPosition)
src/service/position_store.rs:57
↓ 2 callersFunctionadaptive_percent
Smooth interpolation: pct goes from `adaptive_max_percent` at zero notional down to `adaptive_min_percent` as notional grows past `adaptive_threshold_
src/service/strategy.rs:74
↓ 2 callersMethodbuild_signed_order
Build, sign, and prepare an order without posting it. Useful for unit tests and dry-run logging.
src/service/clob.rs:149
↓ 2 callersMethodcheck_fast
Synchronous, in-memory only. Call before any network I/O.
src/service/risk_guard.rs:59
↓ 2 callersFunctionci_eq
(a: &str, b: &str)
src/service/position_store.rs:105
↓ 2 callersFunctionci_eq
(a: &str, b: &str)
src/service/order_executor.rs:306
↓ 2 callersFunctionclamp_price
Misc small helpers. Clamp a Polymarket limit price to the venue's valid band [0.01, 0.99] and round to the 0.001 tick.
src/utils.rs:5
↓ 2 callersMethodfetch_markets_url
(&self, url: &str)
src/service/market_cache.rs:124
↓ 2 callersFunctionhmac_sha256
(key: &[u8], msg: &[u8])
src/service/clob.rs:333
↓ 2 callersMethodlive_trading_allowed
(&self)
src/config.rs:251
↓ 2 callersFunctionparse_market
(m: &serde_json::Value)
src/service/market_cache.rs:142
↓ 2 callersMethodpeek
(&self, slug: &str)
src/service/market_cache.rs:78
↓ 2 callersMethodpnl_pct
Current unrealised P&L percentage given a midprice quote. For BUY entries (long the outcome), gain = +(midprice - entry) / entry. For SELL entries (r
src/service/position_store.rs:35
↓ 2 callersMethodpost_order
Post a fully signed order to `/order`. Requires L2 API credentials.
src/service/clob.rs:212
↓ 2 callersFunctionrun
(cfg: AppConfig)
src/ui/mod.rs:40
↓ 2 callersFunctionsha256
(input: &[u8])
src/service/clob.rs:360
↓ 2 callersFunctionspawn
Spawns the monitor task. The handle lets the caller observe shutdown independently of the main bot loop.
src/service/position_monitor.rs:38
↓ 1 callersMethodas_u8
(self)
src/models.rs:12
↓ 1 callersFunctionbase64_url_no_pad
(data: &[u8])
src/service/clob.rs:430
↓ 1 callersFunctionbot_detail
(kind: BotKind)
src/ui/mod.rs:189
↓ 1 callersFunctionbuild_filter
(cfg: &AppConfig, whale: &str)
src/bot/copy_trading.rs:161
↓ 1 callersMethodby_token_id
Resolve a CLOB token id (either YES or NO leg) to its full market info. First consults the in-memory token-index; on miss, queries Gamma.
src/service/market_cache.rs:67
↓ 1 callersFunctioncheck_exit
(pos: &OpenPosition, midprice: f64)
src/service/position_monitor.rs:25
↓ 1 callersMethodcheck_exposure
(&self, market: &MarketInfo, want_usd: f64)
src/service/order_executor.rs:200
↓ 1 callersMethodcheck_with_book
Phase two, after the caller has fetched the book.
src/service/risk_guard.rs:98
↓ 1 callersFunctionci_eq
(a: &str, b: &str)
src/service/eligibility.rs:71
↓ 1 callersMethodclob
Return the underlying CLOB client (for the position monitor's exit path).
src/service/order_executor.rs:81
↓ 1 callersMethodclose
(&self, token_id: &str)
src/service/position_store.rs:61
↓ 1 callersMethodcontains_token
Returns true if this market metadata describes the given outcome token.
src/service/market_cache.rs:29
↓ 1 callersFunctiondecode_whale_trade
Returns `Ok(Some(trade))` if the log was an `OrderFilled` involving the given whale address (as maker), `Ok(None)` if it was not relevant, or `Err` on
src/service/parse.rs:37
↓ 1 callersMethoddepth_usd
USD-equivalent depth on a given side within `levels` from the top.
src/models.rs:100
↓ 1 callersFunctiondraw
(f: &mut Frame, cfg: &AppConfig, state: &mut ListState)
src/ui/mod.rs:109
↓ 1 callersMethodexecute
(&self, trade: &WhaleTrade)
src/service/order_executor.rs:89
↓ 1 callersMethodfetch_by_slug
(&self, slug: &str)
src/service/market_cache.rs:97
↓ 1 callersMethodfetch_by_token
(&self, token_id: &str)
src/service/market_cache.rs:107
↓ 1 callersMethodflip
(self)
src/models.rs:19
↓ 1 callersFunctionhmac_sha256_base64url
HMAC-SHA256 over `data` keyed by `secret`, returned as url-safe base64 without padding — the exact format Polymarket requires.
src/service/clob.rs:324
↓ 1 callersMethodis_empty
(&self)
src/service/position_store.rs:77
↓ 1 callersMethodis_production
(self)
src/bot/mod.rs:52
↓ 1 callersMethodis_strict
True when at least one allow list is populated — strict allowlist mode.
src/config.rs:151
↓ 1 callersMethodl2_headers
Build the L2 HMAC auth headers Polymarket expects on signed endpoints.
src/service/clob.rs:247
↓ 1 callersFunctionlimit_price_for
(trade: &WhaleTrade, cfg: &AppConfig)
src/service/order_executor.rs:290
↓ 1 callersMethodmidprice
(&self, token_id: &str)
src/service/midprice.rs:38
↓ 1 callersFunctionmonitor_once
( pos: &OpenPosition, positions: &PositionStore, clob: &ClobClient, midprice: &dyn MidpriceSou
src/service/position_monitor.rs:80
↓ 1 callersMethodopen_usd_by_category
(&self, category: &str)
src/service/position_store.rs:81
↓ 1 callersMethodopen_usd_by_tag
(&self, tag: &str)
src/service/position_store.rs:95
↓ 1 callersFunctionorder_filled_topic
Topic-0 selector for `OrderFilled`, derived once at compile time via the `sol!` macro.
src/service/parse.rs:30
↓ 1 callersFunctionorder_type_for
(side: Side)
src/service/order_executor.rs:299
↓ 1 callersFunctionorder_type_str
(t: OrderType)
src/service/clob.rs:300
↓ 1 callersFunctionpad_address_to_topic
(addr: &str)
src/bot/copy_trading.rs:178
↓ 1 callersFunctionparse_log
(v: &Value)
src/service/onchain.rs:119
↓ 1 callersFunctionparse_private_key
(raw: &str)
src/service/clob.rs:308
↓ 1 callersMethodrecord_open
(&self, market: &MarketInfo, planned: &PlannedOrder)
src/service/order_executor.rs:241
↓ 1 callersFunctionrun_once
( ws_url: &str, filter: &LogFilter, tx: &mpsc::Sender<RawLog>, )
src/service/onchain.rs:59
↓ 1 callersFunctionside_str
(side: Side)
src/service/clob.rs:293
↓ 1 callersMethodsnapshot
(&self)
src/service/position_store.rs:69
↓ 1 callersFunctionspawn_subscription
Spawns a task that maintains a Polygon WS connection and forwards matching logs into `tx`. Returns the JoinHandle so the caller can await shutdown.
src/service/onchain.rs:33
↓ 1 callersFunctionto_f64_with_decimals
(v: U256, decimals: u32)
src/service/parse.rs:114
↓ 1 callersFunctiontopic_to_address
(topic: &str)
src/service/parse.rs:106
↓ 1 callersMethodtp_sl_for
(&self, market: &MarketInfo)
src/service/order_executor.rs:263
↓ 1 callersFunctiontrade
(shares: f64)
src/service/risk_guard.rs:139
↓ 1 callersMethodtrip
Manual trip — e.g. when a book fetch fails, prefer tripping to firing blind.
src/service/risk_guard.rs:110
↓ 1 callersFunctionui_loop
(term: &mut Terminal<B>, cfg: AppConfig)
src/ui/mod.rs:55
↓ 1 callersFunctionusd_and_share_amounts
(shares: f64, price: f64, side: Side)
src/service/clob.rs:281
↓ 1 callersFunctionusd_to_shares
Convert a USD amount + limit price into an integer number of shares (rounded down).
src/utils.rs:11
Functionadaptive_decays_with_size
()
src/service/strategy.rs:147
Functionbase64url_round_trip_known
()
src/service/clob.rs:472
Methodbest_ask
(&self)
src/models.rs:95
Methodbest_bid
(&self)
src/models.rs:92
Methodby_slug
(&self, slug: &str)
src/service/market_cache.rs:56
Functioncaps_at_max
()
src/service/strategy.rs:133
Functioncategory_block_wins_over_allow
()
src/service/eligibility.rs:108
Functioncategory_exposure_sums_only_same_category
()
src/service/position_store.rs:132
Functionclamps_above_upper
()
src/utils.rs:38
Functionclamps_below_lower
()
src/utils.rs:33
Functionclosed_market_always_blocked
()
src/service/eligibility.rs:94
Methoddefault
()
src/config.rs:176
Methoddefault
()
src/bot/directional_arb.rs:49
Functiondefault_filters_allow_everything
()
src/service/eligibility.rs:102
Functiondefault_monitor_secs
()
src/config.rs:190
Functiondefault_sl_pct
()
src/config.rs:189
Functiondefault_tp_pct
()
src/config.rs:188
Functiondefault_true
()
src/config.rs:256
Functiondepth_check_blocks_thin_book
()
src/service/risk_guard.rs:177
Functionfirst_large_requests_book
()
src/service/risk_guard.rs:162
Functionfixed_uses_copy_size
()
src/service/strategy.rs:127
Functionflat_range_does_not_trigger
()
src/service/position_monitor.rs:195
Methodfrom
(b: BotKindArg)
src/main.rs:55
Functionhandle_log
(executor: &OrderExecutor, whale: &str, log: &RawLog)
src/bot/copy_trading.rs:134
next →1–100 of 143, ranked by callers