clm-studios avatar

Nephyr Risk

clm-studios/nephyr-risk

You'd reach for this when you're actively trading on prediction markets and need programmatic risk management beyond gut feel. It exposes Kelly criterion position sizing so you're not over-betting profitable edges, EV calculations to quantify expected value across positions, and drawdown protection to keep losing streaks from wiping you out. Useful if you're building trading bots or decision tools for platforms like Manifold, Polymarket, or Metaculus where you need systematic guardrails on bet sizing. The stdio transport makes it straightforward to pipe market odds and bankroll data through for position recommendations.

tools
7
transport
STDIO
last updated
Apr 1, 2026

Tools

7 tools

Public tool metadata for what this MCP can expose to an agent.

calculate_kelly_sizeCalculate 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.6 params

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.

Parameters* required
bankrollnumber
Available capital in USD.
entry_pricenumber
Current market price for the YES contract (0 < price < 1).
kelly_fractionnumber
Scaling multiplier for full Kelly (default 0.25 = quarter-Kelly).default: 0.25
max_position_pctnumber
Hard cap as % of bankroll per trade (default 5.0%).default: 5
min_sizenumber
Minimum position size in USD (default $1.00).default: 1
probabilitynumber
Your model's probability of the YES outcome (0 < p < 1).
calculate_evCalculate 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.3 params

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.

Parameters* required
market_pricenumber
Current YES price on the exchange (0 < price < 1).
model_probabilitynumber
Your model's probability of YES (0 < p < 1).
platformstring
Fee model: 'polymarket' or 'kalshi'.one of polymarket · kalshidefault: polymarket
calculate_feeCalculate the fee per leg for a given platform and contract price. Polymarket: flat 2% of price. Kalshi: 7% × P × (1−P).2 params

Calculate the fee per leg for a given platform and contract price. Polymarket: flat 2% of price. Kalshi: 7% × P × (1−P).

Parameters* required
platformstring
Fee model: 'polymarket' or 'kalshi'.one of polymarket · kalshi
pricenumber
Contract price as a probability (0 < price < 1).
check_risk_statusCheck 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.5 params

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.

Parameters* required
bankrollnumber
Current bankroll in USD.
daily_loss_limit_pctnumber
Daily loss ceiling as % of peak bankroll (default 10%).default: 10
daily_pnlnumber
Today's realised P&L in USD (negative = loss).
drawdown_limit_pctnumber
Drawdown ceiling as % of peak bankroll (default 25%).default: 25
peak_bankrollnumber
Highest bankroll ever reached in USD.
validate_tradePre-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.6 params

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.

Parameters* required
bankrollnumber
Current bankroll in USD.
daily_loss_limit_pctnumber
Daily loss ceiling as % of peak bankroll (default 10%).default: 10
daily_pnlnumber
Today's realised P&L in USD (negative = loss).
drawdown_limit_pctnumber
Drawdown ceiling as % of peak bankroll (default 25%).default: 25
peak_bankrollnumber
Highest bankroll ever reached in USD.
proposed_sizenumber
Dollar amount of the proposed trade.
get_exposureSummarise 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).2 params

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).

Parameters* required
bankrollnumber
Total capital in USD.
positionsarray
List of position objects. Each must have a 'size' key with the dollar amount at risk. Example: [{"size": 50.0}]
simulate_drawdownSimulate a hypothetical sequence of losses against a starting bankroll. Shows when daily loss and drawdown limits would trigger, and reports the maximum drawdown percentage reached.4 params

Simulate a hypothetical sequence of losses against a starting bankroll. Shows when daily loss and drawdown limits would trigger, and reports the maximum drawdown percentage reached.

Parameters* required
bankrollnumber
Starting bankroll in USD.
daily_loss_limit_pctnumber
Daily loss ceiling as % of peak bankroll (default 10%).default: 10
drawdown_limit_pctnumber
Drawdown ceiling as % of peak bankroll (default 25%).default: 25
loss_sequencearray
List of loss amounts in USD (positive = money lost, negative = gain). E.g. [30, 40, 50] simulates three losses.

Sponsors

Readme

Details

Repository
github.com/clm-studios/nephyr-risk
Package
nephyr-risk
Transport
STDIO
Registry
MCP registry, active

More from clm-studios