Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/HarrierOnChain/Prediction-Markets-Trading-Bot-Toolkits
/ functions
Functions
533 in github.com/HarrierOnChain/Prediction-Markets-Trading-Bot-Toolkits
⨍
Functions
533
◇
Types & classes
160
↓ 3 callers
Method
with_schedule
(&self, market: &TradableMarket)
src/service/predict_fun.rs:907
↓ 2 callers
Function
adaptive_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 callers
Method
add
(&mut self, wallet: &str, usd: f64)
src/bot/whale_signal.rs:55
↓ 2 callers
Method
as_u8
(self)
src/models.rs:12
↓ 2 callers
Method
authed_text
An authenticated request, signing in again once if the JWT has expired.
src/service/predict_fun.rs:1292
↓ 2 callers
Method
balance_allowance
(&self)
src/service/clob.rs:639
↓ 2 callers
Method
book
(&self, token_id: &str)
src/service/polymarket_read.rs:88
↓ 2 callers
Method
book_params
Read how `token_id` has to be signed and sized from its current book.
src/service/clob.rs:426
↓ 2 callers
Method
build_order
( &self, market: &ApiMarket, token_id: &str, side: Side, amounts: &Mar
src/service/predict_fun.rs:1185
↓ 2 callers
Method
build_signed_order
Build and sign an order without sending it.
src/service/clob.rs:547
↓ 2 callers
Function
cfg
()
src/bot/arbitrage.rs:214
↓ 2 callers
Function
cfg
()
src/bot/cross_market_arb.rs:234
↓ 2 callers
Function
cfg
()
src/bot/resolution_sniper.rs:179
↓ 2 callers
Method
check_entry
(&self, state: &State, market_id: u64, usd: f64)
src/bot/runtime.rs:346
↓ 2 callers
Method
check_fast
Synchronous, in-memory only. Call before any network I/O.
src/service/risk_guard.rs:59
↓ 2 callers
Function
ci_eq
(a: &str, b: &str)
src/service/position_store.rs:116
↓ 2 callers
Function
ci_eq
(a: &str, b: &str)
src/service/order_executor.rs:322
↓ 2 callers
Function
clamp_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 callers
Function
classify
The level-1 tag is the category; every tag counts for tag filters.
src/service/predict_fun.rs:670
↓ 2 callers
Function
decimal_to_wei
Parse a plain decimal string into 18-decimal fixed point, truncating extra digits. The API's prices and sizes arrive as JSON doubles, so parsing their
src/service/predict_fun.rs:324
↓ 2 callers
Method
depth_usd
USD-equivalent depth on a given side within `levels` from the top.
src/models.rs:151
↓ 2 callers
Method
ensure_version
(&self)
src/service/clob.rs:400
↓ 2 callers
Method
exchange_spenders
(&self)
src/service/clob.rs:393
↓ 2 callers
Method
fetch_markets_url
(&self, url: &str)
src/service/market_cache.rs:126
↓ 2 callers
Function
geoblock
`None` when the check can't be reached. The CLOB still makes its own decision.
src/service/clob.rs:845
↓ 2 callers
Function
hmac_sha256
(key: &[u8], msg: &[u8])
src/service/clob.rs:1035
↓ 2 callers
Function
in_price_band
(price: f64, cfg: &OrderbookImbalanceConfig)
src/bot/orderbook_imbalance.rs:230
↓ 2 callers
Function
is_allowed
( client: &PredictFunClient, filters: &FiltersConfig, market: &TradableMarket, )
src/bot/runtime.rs:882
↓ 2 callers
Function
l1_headers
( signer: &PrivateKeySigner, chain_id: u64, timestamp: u64, nonce: u32, )
src/service/clob.rs:965
↓ 2 callers
Function
l2_signature
HMAC-SHA256 over timestamp + method + path + body, keyed by the base64-decoded secret and returned as URL-safe base64 with padding.
src/service/clob.rs:996
↓ 2 callers
Function
limit_order_body
`POST /orders` body for a resting order.
src/service/predict_fun.rs:1629
↓ 2 callers
Function
limits
()
src/bot/runtime.rs:1127
↓ 2 callers
Function
link
(market: &ApiMarket, yes_name: &str, no_name: &str)
src/service/polymarket_read.rs:102
↓ 2 callers
Method
linked_market
The tradable market behind a condition id, matched to `yes_name`/`no_name`. `None` when it's closed or its outcomes aren't those two: pairing markets
src/service/polymarket_read.rs:70
↓ 2 callers
Function
log
(maker: &str, taker: &str, data: &str)
src/service/parse.rs:123
↓ 2 callers
Method
market
(&self, id: u64)
src/service/predict_fun.rs:889
↓ 2 callers
Function
order_digest
EIP-712 digest of an order against the exchange its market settles on.
src/service/predict_fun.rs:1551
↓ 2 callers
Function
parse_market
(m: &serde_json::Value)
src/service/market_cache.rs:151
↓ 2 callers
Function
parse_private_key
(raw: &str)
src/service/clob.rs:1017
↓ 2 callers
Method
peek
(&self, slug: &str)
src/service/market_cache.rs:80
↓ 2 callers
Function
plan_quotes
Which working orders to remove and which wanted ones to send. An order within `tolerance` of a wanted quote on the same token and side stays, so a quo
src/bot/runtime.rs:768
↓ 2 callers
Method
pnl_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 callers
Method
remaining
(&self)
src/bot/runtime.rs:114
↓ 2 callers
Method
remove
(&self, order_ids: &[String])
src/service/predict_fun.rs:1478
↓ 2 callers
Method
request_text
( &self, method: Method, path: &str, bearer: Option<&str>, body: Optio
src/service/predict_fun.rs:531
↓ 2 callers
Method
resting_in
Orders still working in a market, excluding ones being removed.
src/bot/runtime.rs:305
↓ 2 callers
Function
retain_significant_digits
Keep the leading `digits` significant digits, zeroing the rest. The exchange matches on exact ratios, so the SDK trims amounts this way before signing
src/service/predict_fun.rs:343
↓ 2 callers
Function
run
(cfg: AppConfig)
src/ui/mod.rs:40
↓ 2 callers
Method
settle
(&self, market: &TradableMarket, payout_yes: f64)
src/bot/runtime.rs:712
↓ 2 callers
Function
sha256
(input: &[u8])
src/service/clob.rs:1062
↓ 2 callers
Function
sign_for_account
Sign `hash` for a Predict Account. Kernel validates EIP-1271 signatures over a wrapped hash, and expects them prefixed with its mode byte and validato
src/service/predict_fun.rs:1563
↓ 2 callers
Method
sign_order
(&self, order: &Order, market: &ApiMarket)
src/service/predict_fun.rs:1211
↓ 2 callers
Function
snap_down
(price: f64, tick: f64)
src/bot/runtime.rs:43
↓ 2 callers
Function
snapshot
Polymarket lists its best prices last, so sort: best first, like every book here.
src/service/polymarket_read.rs:121
↓ 2 callers
Function
spawn_tp_sl
TP/SL monitor — only spawn if we have a venue client (cfg permitted it).
src/bot/copy_trading.rs:201
↓ 2 callers
Method
sync_live
Live runs: read each working order's state and book what filled.
src/bot/runtime.rs:661
↓ 2 callers
Function
taker_leg
The taker side of a match, as a trade by whoever sent it.
src/service/predict_fun.rs:988
↓ 2 callers
Method
tracked_markets
Every market with a holding or a resting order, which must keep being observed even after a strategy loses interest in it.
src/bot/runtime.rs:317
↓ 2 callers
Function
two_outcomes
()
src/service/predict_fun.rs:2157
↓ 2 callers
Method
update
(&mut self, price: f64, at_secs: f64)
src/service/spot.rs:148
↓ 1 callers
Method
allowed
(&self, spender: Address)
src/service/clob.rs:822
↓ 1 callers
Function
base64_decode
Accepts standard or URL-safe base64, padded or not.
src/service/clob.rs:1150
↓ 1 callers
Function
base64_url
URL-safe base64 with padding, the format the CLOB expects.
src/service/clob.rs:1133
↓ 1 callers
Method
binance
(&self, symbol: &str)
src/service/spot.rs:91
↓ 1 callers
Function
bot_detail
(kind: BotKind)
src/ui/mod.rs:189
↓ 1 callers
Function
build_filter
(cfg: &AppConfig, whale: &str)
src/bot/copy_trading.rs:266
↓ 1 callers
Method
by_token_id
(&self, token_id: &str)
src/service/order_executor.rs:338
↓ 1 callers
Method
by_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:69
↓ 1 callers
Method
category_of
(&self, slug: &str)
src/service/predict_fun.rs:646
↓ 1 callers
Function
cfg
()
src/bot/orderbook_imbalance.rs:260
↓ 1 callers
Method
check
(&mut self, ctx: &Ctx, market: &TradableMarket, book: &BookSnapshot)
src/bot/cross_market_arb.rs:125
↓ 1 callers
Function
check_exit
(pos: &OpenPosition, midprice: f64)
src/service/position_monitor.rs:25
↓ 1 callers
Method
check_exposure
(&self, market: &MarketInfo, want_usd: f64)
src/service/order_executor.rs:216
↓ 1 callers
Function
check_limit
Refuse a fill worse than `limit_price`. The book is a snapshot, but the signed ratio caps the price regardless of what it does before matching.
src/service/predict_fun.rs:472
↓ 1 callers
Method
check_loss_limit
(&self, state: &mut State)
src/bot/runtime.rs:645
↓ 1 callers
Method
check_with_book
Phase two, after the caller has fetched the book.
src/service/risk_guard.rs:98
↓ 1 callers
Function
ci_eq
(a: &str, b: &str)
src/service/eligibility.rs:71
↓ 1 callers
Method
close
(&self, token_id: &str)
src/service/position_store.rs:61
↓ 1 callers
Method
coinbase
(&self, symbol: &str)
src/service/spot.rs:106
↓ 1 callers
Function
coinbase_pair
(symbol: &str)
src/service/spot.rs:121
↓ 1 callers
Method
confirmed_fill
Wait for a MARKET order to settle. `None` means the API couldn't say.
src/service/predict_fun.rs:1349
↓ 1 callers
Method
contains_token
Returns true if this market metadata describes the given outcome token.
src/service/market_cache.rs:31
↓ 1 callers
Function
deployment
(network: PredictNetwork)
src/service/predict_fun.rs:116
↓ 1 callers
Function
draw
(f: &mut Frame, cfg: &AppConfig, state: &mut ListState)
src/ui/mod.rs:109
↓ 1 callers
Method
dump_stale
Sell anything held past the limit at the bid.
src/bot/spread_farming.rs:39
↓ 1 callers
Method
entries
( &mut self, ctx: &Ctx, books: &HashMap<u64, BookSnapshot>, watched: &[u64],
src/bot/orderbook_imbalance.rs:154
↓ 1 callers
Method
equity
(&self)
src/bot/runtime.rs:137
↓ 1 callers
Function
execute
(ctx: &Ctx, command: Command, listed: &mut Vec<TradableMarket>)
src/bot/sports_execution.rs:122
↓ 1 callers
Function
exit_reason
The target is what can actually be sold for, so it's measured at the bid. The stop is measured at the mid: at the bid, a spread as wide as the stop wo
src/bot/orderbook_imbalance.rs:237
↓ 1 callers
Method
exits
(&mut self, ctx: &Ctx, books: &HashMap<u64, BookSnapshot>)
src/bot/orderbook_imbalance.rs:119
↓ 1 callers
Function
expiration_for
GTD orders live one minute less than stated and have to be at least three minutes out. Every other type must carry zero.
src/service/clob.rs:268
↓ 1 callers
Method
fetch_by_slug
(&self, slug: &str)
src/service/market_cache.rs:99
↓ 1 callers
Method
fetch_by_token
(&self, token_id: &str)
src/service/market_cache.rs:109
↓ 1 callers
Function
filled_from_response
Shares filled, as far as the POST response can say. `None` means unknown.
src/service/clob.rs:288
↓ 1 callers
Method
flip
(self)
src/models.rs:19
↓ 1 callers
Method
follow
(&mut self, ctx: &Ctx, trade: &WhaleTrade)
src/bot/whale_signal.rs:95
↓ 1 callers
Function
handle_trade
(executor: &OrderExecutor, trade: &WhaleTrade)
src/bot/copy_trading.rs:239
↓ 1 callers
Method
has_room
(&self, wallet: &str, usd: f64, cap: f64)
src/bot/whale_signal.rs:51
↓ 1 callers
Method
held_wei
Wei held of an outcome. Buy fees are taken in shares, so this is less than the size bought and is the only safe size to sell.
src/service/predict_fun.rs:1331
↓ 1 callers
Method
id
(&self)
src/service/position_monitor.rs:193
← previous
next →
101–200 of 533, ranked by callers