calculate_kelly_size
Calculate the optimal position size for a prediction market trade using the Kelly criterion (quarter-Kelly by default). Returns the recommended dollar amount to risk, the raw Kelly fraction, and whether the size was capped by the bankroll-percentage limit.
calculate_ev
Calculate the expected value of a YES contract after platform fees. Returns EV, edge (model prob − market price), fee per leg, round-trip fee, and whether EV is positive. Supports Polymarket (2% flat) and Kalshi (7% × P × (1−P)) fee models.
calculate_fee
Calculate the fee per leg for a given platform and contract price. Polymarket: flat 2% of price. Kalshi: 7% × P × (1−P).
check_risk_status
Check current risk management status. Returns ACTIVE (safe to trade), PAUSED (daily loss limit hit — resume tomorrow), or SHUTDOWN (max drawdown exceeded — manual review required). Also returns warnings when approaching limits.
validate_trade
Pre-trade risk check. Projects the worst case (total loss of proposed_size) and checks whether it would breach daily loss or drawdown limits. Returns approved/rejected with a reason and projected percentages.
get_exposure
Summarise portfolio exposure relative to bankroll. Returns total exposure %, largest position %, number of positions, and a concentration risk flag (triggered when any single position exceeds 10% of bankroll).