Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ConteurShadow/Polymarket-Trading-Bot-Rust
/ functions
Functions
284 in github.com/ConteurShadow/Polymarket-Trading-Bot-Rust
⨍
Functions
284
◇
Types & classes
59
↓ 1 callers
Function
update_balance_allowance
Update balance/allowance cache. asset_type: "Collateral" or "Conditional".
src/clob_sdk.rs:472
↓ 1 callers
Method
wait_for_relayer_transaction
Wait for relayer transaction to be confirmed (like TypeScript SDK's response.wait()) Polls the relayer status endpoint until transaction reaches STATE
src/api.rs:1419
Method
approve_individual_tokens
Fallback: Approve individual tokens (ETH Up/Down, BTC Up/Down) with large allowance This is used when setApprovalForAll fails via relayer Triggers SDK
src/api.rs:1497
Method
ask_price
(&self)
src/models.rs:63
Method
authenticate
Authenticate with Polymarket CLOB API at startup (creates CLOB client via clob_sdk). Equivalent to TypeScript CLOB V2: `new ClobClient({ host, chain,
src/api.rs:404
Function
both_zero
()
src/merge.rs:74
Function
bottom_rule
()
src/term_ui.rs:118
Method
builder_relayer_signature
Builder Relayer HMAC: message = timestamp(ms) + method + path + body, signature = base64url. Must match Polymarket builder-signing-sdk for relayer aut
src/api.rs:455
Method
check_market_closure
Check and settle trades when markets close For momentum strategy: If token wasn't sold, it will be worth $1 if Up won, $0 if Down won
src/trader.rs:3275
Method
cleanup_old_abandoned_trades
Clean up old abandoned trades (trades from previous periods that failed redemption) This prevents the pending_trades list from growing indefinitely
src/trader.rs:223
Method
clear_limit_order_tracking
Clear limit order tracking for a specific period to allow re-entry after a sell This is called when a limit sell order fills, allowing the bot to plac
src/detector.rs:597
Method
clear_period_trackers
Clear price trackers for a specific period (when period ends)
src/simulation.rs:398
Function
client_destroy
Destroy client. Call when done with the handle.
src/clob_sdk.rs:292
Method
clob_signer_error_hint
Add concrete context for CLOB signer validation failures.
src/api.rs:173
Method
create_order
Create an order (buy or sell)
src/bin/test_predict_fun.rs:248
Method
default
()
src/config.rs:173
Method
detect_limit_order_opportunities
Detect limit order opportunities: At min_elapsed_minutes, return both Up and Down tokens for limit buy orders Strategy: Place limit buy orders for bot
src/detector.rs:353
Method
detect_opportunities
Detect momentum opportunities: Check BTC and ETH tokens (BTC/ETH Up/Down) for price >= trigger_price after min_elapsed_minutes Strategy: Buy BTC/ETH t
src/detector.rs:257
Function
dollar_pair_styled
Bid/ask pair like `$0.65/$0.67` — higher contrast; cool tones for Up, warm for Down.
src/term_ui.rs:86
Function
enabled_markets_label
(enable_eth: bool, enable_solana: bool, enable_xrp: bool)
src/bin/main_dual_limit_045_same_size.rs:2884
Function
equal_amounts
()
src/merge.rs:44
Method
extract_timestamp_from_slug
Extract timestamp from market slug (e.g., "eth-updown-15m-1767796200" -> 1767796200)
src/monitor.rs:757
Method
fetch_token_price
( &self, token_id: &Option<String>, market_name: &str, outcome: &str, )
src/monitor.rs:717
Function
find_token_market
( api: &PolymarketApi, _token_id: &str, description: &str, )
src/bin/test_redeem.rs:247
Function
find_token_market_manual
( api: &PolymarketApi, token_id: &str, btc_condition_id: Option<&str>, eth_condition_id: Optio
src/bin/test_redeem.rs:280
Function
fmt_btc_book
One market row for the live quote line (plain text matches `price_log_line` slices).
src/term_ui.rs:421
Function
fmt_oracle_tail
Chainlink / price-to-beat suffix (plain body already has leading `|`).
src/term_ui.rs:538
Function
fmt_trailing_note
(line: &str)
src/term_ui.rs:542
Function
format_sim_fills
(up_filled: bool, down_filled: bool)
src/term_ui.rs:736
Function
format_sim_head
(market: &str, m: u64, s: u64)
src/term_ui.rs:681
Function
format_sim_prices
( up_bid: f64, up_ask: f64, up_at_limit: bool, down_bid: f64, down_ask: f64, down_at_l
src/term_ui.rs:694
Function
format_sim_tag_line
`SIM [BTC] …` status for `log_println!`.
src/term_ui.rs:765
Function
format_trend_insufficient
(label: &str, min_samples: usize)
src/term_ui.rs:674
Function
format_trend_row
( label: &str, direction_label: &str, strength: f64, price_change: f64, slope: f64, du
src/term_ui.rs:600
Function
fractional
()
src/merge.rs:80
Method
from_config
(config: &Config)
src/api.rs:138
Method
get_hedge_trades_for_period
Get hedge trades (individual or standard) for a given period. Returns (condition_id, token_id, token_type) for each hedge position we hold.
src/trader.rs:247
Method
get_pending_reentry_limit_trade
Get a pending re-entry limit trade (keyed by `"{period}_{token_id}_reentry_limit"`)
src/trader.rs:302
Method
get_trend_for_hedge
Get trend information for hedge decision making
src/simulation.rs:309
Function
init_history_file
Initialize the global history file writer (called by main.rs)
src/lib.rs:26
Method
is_simulation
(&self)
src/trader.rs:25
Method
is_token_uptrending
Check if a token is uptrending
src/simulation.rs:292
Method
load
(path: &PathBuf)
src/config.rs:232
Method
load_api_credentials_from_env
()
src/api.rs:148
Function
log_trading_event
(event: &str)
src/bin/main_dual_limit_045_5m_btc.rs:76
Function
log_trading_event
(event: &str)
src/bin/main_dual_limit_045_same_size.rs:113
Function
main
()
src/bin/main_dual_limit_045_5m_btc.rs:93
Function
main
()
src/bin/main_trailing.rs:198
Function
main
()
src/bin/test_redeem.rs:31
Function
main
()
src/bin/test_sell.rs:37
Function
main
()
src/bin/test_merge.rs:158
Function
main
()
src/bin/test_cash_balance.rs:16
Function
main
()
src/bin/test_limit_order.rs:37
Function
main
()
src/bin/test_allowance.rs:48
Function
main
()
src/bin/backtest.rs:9
Function
main
()
src/bin/test_multiple_orders.rs:56
Function
main
()
src/bin/test_predict_fun.rs:294
Function
main
()
src/bin/main_dual_limit_045_same_size.rs:218
Method
mark_position_closed
Mark position as closed (for stop-loss re-entry)
src/trader.rs:479
Method
mark_token_bought
Mark that we bought a specific token in this period
src/detector.rs:581
Function
more_down_than_up
()
src/merge.rs:56
Function
more_up_than_down
()
src/merge.rs:50
Function
neg_risk
Get neg_risk for token. Returns true/false.
src/clob_sdk.rs:526
Method
new
(api: Arc<PolymarketApi>, config: TradingConfig, simulation_mode: bool, detector: Option<Arc<PriceDetector>>)
src/trader.rs:33
Method
new
(log_file_path: &str)
src/simulation.rs:54
Method
new
(trigger_price: f64, max_buy_price: f64, min_elapsed_minutes: u64, min_time_remaining_seconds: u64, enable_eth
src/detector.rs:99
Method
new
Create a new MarketMonitor. enable_eth_trading, enable_solana_trading, enable_xrp_trading: if Some(false), that market is omitted from the one-line pr
src/monitor.rs:66
Method
new
( gamma_url: String, clob_url: String, private_key: Option<String>, proxy_wall
src/api.rs:109
Method
new
(base_url: String)
src/bin/test_predict_fun.rs:74
Function
open_first_loadable_library
()
src/clob_sdk.rs:81
Method
place_hedge_sell_orders_with_retry
Place hedge sell orders: standard hedge = 5 orders (4 at $0.93, 1 at $0.98); early/individual = 1 order at $0.98. Called from a background task after
src/trader.rs:54
Method
place_order_hmac
(&self, order: &OrderRequest)
src/api.rs:1704
Method
print_trade_summary
Print summary of all trades (for testing/verification)
src/trader.rs:3795
Method
reset_period
Reset when new period starts
src/detector.rs:587
Method
set_position_sell_price
Update sell price for a position (when limit sell order is placed)
src/simulation.rs:657
Function
sim_divider
()
src/term_ui.rs:592
Function
tick_size
Get tick size for token (e.g. "0.01").
src/clob_sdk.rs:494
Function
top_rule
()
src/term_ui.rs:112
Function
trend_banner
(elapsed_m: u64, elapsed_s: u64)
src/term_ui.rs:564
Function
trend_banner_end
()
src/term_ui.rs:584
Method
write
(&mut self, buf: &[u8])
src/bin/main_dual_limit_045_5m_btc.rs:39
Method
write
(&mut self, buf: &[u8])
src/bin/main_dual_limit_045_same_size.rs:75
Function
zero_down
()
src/merge.rs:68
Function
zero_up
()
src/merge.rs:62
← previous
201–284 of 284, ranked by callers