Judge
Gate cascade, expected value, and position sizing for Catalysm Polymarket bots.
The judge is the final decision engine inside each pipeline run. It takes the strategy score and confidence, runs an ordered gate cascade, and outputs UP, DOWN, or NO_TRADE with a suggested bet size.
Inputs and outputs
Inputs: directional score, confidence, setup grade, all module outputs, indicator features, and Polymarket book prices (mid, best bid, best ask).
Outputs:
- Decision:
UP,DOWN, orNO_TRADE - Expected value (EV): edge after entry price and execution buffer
- Directional probability (
dirProb): calibrated estimate that the chosen side wins - Suggested size: USD notional capped at the configured maximum order size
- Gate audit: which thresholds applied this window
- Rationale: human-readable notes on adjustments
Gate cascade
Gates run in order. The first failure returns NO_TRADE with a reason logged to the bet log.
-
Market quality: Checks that the order book is tradable. Wide spread or poor liquidity stops the trade before direction is evaluated.
-
Signal strength: Checks that the score is strong enough to pick a side. Weak or conflicting signals fall in a dead zone and produce
NO_TRADE. Pattern and regime rules can block setups that history shows are unprofitable. -
Conviction and edge: Checks that confidence and expected value clear minimum thresholds. The bot needs both a clear directional read and enough edge after entry price and slippage.
-
Context alignment: Checks that higher timeframes and market regime support the trade. Trend, pattern, and regime filters remove bets that fight the broader setup.
Thresholds tighten automatically in quiet or choppy conditions. Gate limits, pattern blocks, and regime rules are current defaults tuned from the bet log and updated through the agentic loop.
Expected value
After the dead zone picks a direction, the judge computes EV:
dirProb = calibrated probability from |score|
entryPrice = best ask (UP) or 1 − best bid (DOWN)
executionBuffer = spread and size slippage estimate
EV = dirProb − entryPrice − executionBufferdirProb starts from a logistic mapping of |score|, then blends with historical calibration once enough resolved bets exist (20+ samples). Entry price uses the real ask/bid, not mid, so EV reflects what you actually pay.
Position sizing
When all gates pass, size scales from several multipliers stacked together. These are current defaults; the agentic loop can adjust them after weekly review:
- Setup grade: A (0.38×), B (1.0×), C (0.25×)
- EV ramp: scales with edge up to EV 0.15, then tapers above 0.18
- Spread band: 2 to 4% spread cuts size 20%; 5 to 7% cuts 40%
- Counter-trend: reduced size when 15M bias fights 1H trend
- Pattern boost: validated edges (e.g. double top) get a 10% boost
- Quiet regime: 48% size multiplier in squeeze conditions
Final size is rounded and capped at the maximum order size. A daily loss limit can halt all trading for the rest of the UTC day. Both limits are configurable through the agentic loop.
Regime awareness
The judge detects market regime from 1-hour ADX, ATR, and Bollinger squeeze state:
trending_up/trending_downrangingvolatilequiet
Regime adjusts gate strictness and position size. Some patterns only pass when trend and volatility conditions match.
Relationship to the historian
Gate thresholds and pattern blocks come from empirical analysis of the bet log. The weekly profitability review recommends threshold changes that agents deploy through the agentic loop.
At runtime the judge is fully deterministic: no LLM calls, no per-window parameter search.
Next step
Approved decisions flow to execution for on-chain order placement.
