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
↓ 51 callers
Function
book
(bids: &[(f64, f64)], asks: &[(f64, f64)])
src/bot/runtime.rs:1101
↓ 47 callers
Function
market
(id: u64)
src/bot/runtime.rs:1108
↓ 28 callers
Method
len
(&self)
src/service/position_store.rs:84
↓ 24 callers
Method
get
(&self, token_id: &str)
src/service/position_store.rs:76
↓ 24 callers
Method
take
Cross the spread for `shares`, no worse than `limit`, all or nothing. `yes_book` is the market's Yes-quoted book.
src/bot/runtime.rs:364
↓ 21 callers
Method
get
(&self, id: u64)
src/bot/quoting.rs:39
↓ 18 callers
Method
insert
(&self, info: MarketInfo)
src/service/market_cache.rs:91
↓ 17 callers
Method
best_ask
(&self)
src/models.rs:98
↓ 15 callers
Method
is_empty
(&self)
src/service/position_store.rs:88
↓ 14 callers
Method
best_bid
(&self)
src/models.rs:95
↓ 12 callers
Function
paper
()
src/bot/runtime.rs:1136
↓ 11 callers
Method
rest
Rest a limit order. Returns its id, or why it wasn't sent.
src/bot/runtime.rs:452
↓ 9 callers
Function
shares_for
Shares `usd` buys at `price`, rounded down to the hundredth.
src/bot/runtime.rs:52
↓ 9 callers
Function
token_book
`yes_book` as seen by `token`.
src/bot/runtime.rs:746
↓ 8 callers
Method
books
(&self, ids: &[u64])
src/service/predict_fun.rs:929
↓ 8 callers
Function
drive
Run `strategy` until Ctrl-C, keeping the broker's books straight around it.
src/bot/runtime.rs:985
↓ 8 callers
Function
market_amounts
Walk the book for `quantity_wei` shares, as the SDK's MARKET helper does with no slippage: the signed ratio is the worst level reached. Unlike the SDK
src/service/predict_fun.rs:404
↓ 8 callers
Function
wei
(v: &str)
src/service/predict_fun.rs:1755
↓ 7 callers
Function
basket_quotes
Bids on both outcomes, one tick inside the touch. Stops adding to a side once it's ahead of the other by more than the largest tilt allows. Every leg
src/bot/directional_arb.rs:101
↓ 7 callers
Method
holding
(&self, token: &str)
src/bot/runtime.rs:296
↓ 7 callers
Function
live
(venue: &Arc<FakeVenue>)
src/bot/runtime.rs:1194
↓ 7 callers
Method
observe
Fetch `ids` plus every market the broker is tracking, and show the broker those books.
src/bot/quoting.rs:45
↓ 7 callers
Method
remember_market
(&self, market: &ApiMarket)
src/service/predict_fun.rs:588
↓ 7 callers
Function
tradable
The strategy bots' view of a market, with its event's schedule when known.
src/service/predict_fun.rs:747
↓ 6 callers
Function
cfg
()
src/bot/directional_arb.rs:171
↓ 6 callers
Function
check
(filters: &FiltersConfig, market: &MarketInfo)
src/service/eligibility.rs:23
↓ 6 callers
Function
client
(funder: &str, signature_type: Option<&str>)
src/service/clob.rs:1184
↓ 6 callers
Function
decimal_to_wei_exact
Amounts in API responses are already integer wei.
src/service/predict_fun.rs:983
↓ 6 callers
Method
live_trading_allowed
(&self)
src/config.rs:640
↓ 6 callers
Function
market
(slug: &str, category: Option<&str>, tags: &[&str])
src/service/eligibility.rs:81
↓ 6 callers
Method
market_for_token
(&self, token_id: &str)
src/service/predict_fun.rs:580
↓ 6 callers
Method
markets
(&self)
src/bot/runtime.rs:938
↓ 6 callers
Function
mm_quotes
Bid and offer for one market. A long Yes position lowers both quotes, and a long No position raises them.
src/bot/market_maker.rs:62
↓ 6 callers
Function
params
(neg_risk: bool, position_book: bool)
src/service/clob.rs:1193
↓ 6 callers
Method
parse
(raw: &str)
src/service/clob.rs:103
↓ 6 callers
Function
pos
(entry: f64, tp: f64, sl: f64, side: Side)
src/service/position_monitor.rs:268
↓ 6 callers
Function
sdk_book
()
src/service/predict_fun.rs:1829
↓ 6 callers
Method
sign_fields
(&self, f: &OrderFields, params: &BookParams)
src/service/clob.rs:459
↓ 6 callers
Function
wei_to_f64
(v: U256)
src/service/predict_fun.rs:337
↓ 5 callers
Method
cancel
Ask to remove orders. Returns the ones refused for now, which stay working.
src/bot/runtime.rs:543
↓ 5 callers
Function
cfg
(strategy: CopyStrategy)
src/service/strategy.rs:90
↓ 5 callers
Function
cfg
()
src/bot/market_maker.rs:128
↓ 5 callers
Function
clean
(price: f64)
src/bot/runtime.rs:39
↓ 5 callers
Function
f64_to_wei
(v: f64)
src/service/predict_fun.rs:330
↓ 5 callers
Function
farm_quotes
Flat: bid inside a wide spread. Holding: offer inside the ask, never below cost plus a tick, so each round trip that completes makes money.
src/bot/spread_farming.rs:114
↓ 5 callers
Function
fields
(side: Side, expiration: u64)
src/service/clob.rs:1197
↓ 5 callers
Method
get
(&self, path: &str)
src/service/predict_fun.rs:569
↓ 5 callers
Method
holdings
(&self)
src/bot/runtime.rs:300
↓ 5 callers
Method
mid
(&self)
src/models.rs:102
↓ 5 callers
Method
mirrored
The other outcome's view of a Yes-quoted book: a Yes bid at `p` is a No ask at `1 - p`, and vice versa.
src/models.rs:132
↓ 5 callers
Method
open
(&self, pos: OpenPosition)
src/service/position_store.rs:57
↓ 5 callers
Function
order_amounts
(shares: f64, price: f64, side: Side, tick: f64)
src/service/clob.rs:236
↓ 5 callers
Method
remove
(&self, ids: &[String])
src/bot/runtime.rs:1179
↓ 5 callers
Function
round
(now: DateTime<Utc>, secs: i64)
src/bot/arbitrage.rs:222
↓ 5 callers
Function
size_for_trade
(cfg: &StrategyConfig, trade: &WhaleTrade)
src/service/strategy.rs:26
↓ 5 callers
Method
status
Honest status for the TUI. Nothing has traded live through this engine yet.
src/bot/mod.rs:56
↓ 4 callers
Method
allowed
Does the operator's allow/block list let this market through?
src/bot/runtime.rs:877
↓ 4 callers
Method
avg_price
(&self)
src/bot/runtime.rs:88
↓ 4 callers
Method
book
(&self, market_id: u64)
src/service/predict_fun.rs:573
↓ 4 callers
Function
cfg
()
src/service/risk_guard.rs:129
↓ 4 callers
Function
cfg
()
src/bot/spread_farming.rs:157
↓ 4 callers
Function
digital_up
Chance the price ends above `strike`, under a driftless lognormal model.
src/service/spot.rs:192
↓ 4 callers
Method
is_halted
(&self)
src/bot/runtime.rs:288
↓ 4 callers
Function
is_quotable
Whether a market may carry quotes now. A market with no known end stays in.
src/bot/runtime.rs:971
↓ 4 callers
Method
observe
Feed a fresh book: updates marks and the loss limit, and on a dry run simulates fills and expiry.
src/bot/runtime.rs:592
↓ 4 callers
Function
pos
(slug: &str, cat: &str, tags: &[&str], usd: f64)
src/service/position_store.rs:126
↓ 4 callers
Method
quote
Quote every chosen market as `wanted` says, and pull orders anywhere the strategy no longer wants to be.
src/bot/quoting.rs:201
↓ 4 callers
Method
remember
(&mut self, markets: &[TradableMarket])
src/bot/quoting.rs:33
↓ 4 callers
Method
request
( &self, method: Method, path: &str, bearer: Option<&str>, body: Optio
src/service/predict_fun.rs:558
↓ 4 callers
Method
summary
(&self)
src/bot/runtime.rs:218
↓ 4 callers
Method
taker_fee
Taker fee per share at `price`. Makers pay none.
src/service/venue.rs:78
↓ 4 callers
Function
trade
(notional: f64, shares: f64)
src/service/strategy.rs:104
↓ 3 callers
Function
api_market
(outcomes: serde_json::Value, status: &str, trading: &str)
src/service/predict_fun.rs:2140
↓ 3 callers
Method
apply_fill
( &mut self, market_id: u64, token: &str, side: Side, shares: f64,
src/bot/runtime.rs:180
↓ 3 callers
Method
authed_request
`query` isn't covered by the signature, only the path is.
src/service/clob.rs:712
↓ 3 callers
Function
best_gap
The better way to buy both outcomes across the two venues, if it locks in at least `min_edge` after fees and has room for a minimum-size order on both
src/bot/cross_market_arb.rs:197
↓ 3 callers
Function
check
`check-venue` for Polymarket. Reads public data and signs a sample order locally. Nothing is posted. `sign_in` also creates or derives API credentials
src/service/clob.rs:871
↓ 3 callers
Method
creds
API credentials from the config, or else created (or derived, if they already exist) with an L1 signature.
src/service/clob.rs:655
↓ 3 callers
Function
decode_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:39
↓ 3 callers
Method
domain_for
(&self, params: &BookParams)
src/service/clob.rs:441
↓ 3 callers
Method
ensure_clob_v2
The exchange addresses are also what the copy-trading feed watches, so a config from before CLOB V2 would sign rejected orders and see no trades.
src/config.rs:137
↓ 3 callers
Method
execute
(&self, trade: &WhaleTrade)
src/service/order_executor.rs:90
↓ 3 callers
Method
is_live
(&self)
src/bot/runtime.rs:284
↓ 3 callers
Method
is_yes
(&self, token: &str)
src/service/venue.rs:86
↓ 3 callers
Function
limit_amounts
The SDK's `getLimitOrderAmounts`: three significant digits of price, five of quantity.
src/service/predict_fun.rs:450
↓ 3 callers
Function
monitor_once
( pos: &OpenPosition, positions: &PositionStore, venue: &dyn OrderVenue, midprice: &dyn Midpri
src/service/position_monitor.rs:80
↓ 3 callers
Function
order_body
`POST /orders` body. Expiration, side and signature type are JSON integers here even though the other numeric fields are strings.
src/service/predict_fun.rs:1597
↓ 3 callers
Function
pick_snipe
The outcome priced in the near-certain band, if either is and its best ask has room for the order.
src/bot/resolution_sniper.rs:152
↓ 3 callers
Method
poll
New trades, oldest first.
src/service/predict_fun.rs:1064
↓ 3 callers
Method
refresh
True when the list was just re-read.
src/bot/runtime.rs:928
↓ 3 callers
Function
round_entry
The side worth buying in a live round, if either clears `min_edge` after fees.
src/bot/arbitrage.rs:172
↓ 3 callers
Method
secs_left
(&self, now: DateTime<Utc>)
src/service/venue.rs:82
↓ 3 callers
Method
seed_from_venue
Count what the wallet already holds toward the limits, so a restart can't double them. Those positions are never sold by a strategy, including ones fr
src/bot/runtime.rs:327
↓ 3 callers
Function
signer
()
src/service/predict_fun.rs:1733
↓ 3 callers
Function
snap_up
(price: f64, tick: f64)
src/bot/runtime.rs:47
↓ 3 callers
Function
spawn
Spawns the monitor task. The handle lets the caller observe shutdown independently of the main bot loop.
src/service/position_monitor.rs:38
↓ 3 callers
Method
spread
(&self)
src/models.rs:106
↓ 3 callers
Method
step
Take up the latest choice, if a scan has finished since the last tick, and read books for the chosen markets and anything still open from an earlier c
src/bot/quoting.rs:190
↓ 3 callers
Function
vector_order
()
src/service/predict_fun.rs:1737
↓ 3 callers
Function
whale_legs
Project a match onto the legs `whale` took part in, keyed for dedupe.
src/service/predict_fun.rs:948
next →
1–100 of 533, ranked by callers