For Agents

Risk model for crypto-shortterm (Rev 2). Sizing is net-of-fee portfolio Kelly, ≤0.5×, never full, evaluated at the pessimistic confidence-band edge so size → 0 as the band widens near expiry. A single-writer risk actor owns position + budget. Authoritative formulae are in the codebase spec — see Canonical artifacts.

Working note for risk management of crypto-shortterm.

Risk-first, not profit-first

Aggressive growth with hard controls: capital preservation and bounded drawdown beat maximizing any single trade. Size to survive the worst plausible streak. The dominant tail is the Binance↔Chainlink basis near expiry (see Settlement is Chainlink, not Binance).

Position sizing — net-of-fee portfolio Kelly

  • Stake ≤ 0.5× of f* evaluated at the pessimistic edge: where a is the entry cost (half-spread + slippage) and fee is the Polymarket taker fee at that price. As the band widens, P_fair_lower-band drops → f* → 0.
  • 0.5× is a ceiling, not the control — the control is the band-driven pessimistic edge. Crucially this control is self-conditioning on moneyness near expiry: in the near-the-money corner the band explodes (∂P_fair/∂Ŝ → ∞) so the pessimistic edge collapses and Kelly → 0 (correctly avoids the trap); in the clearly-ITM/OTM corner the band narrows (∂P_fair/∂Ŝ → 0) so the edge survives and Kelly permits the trade. We get the right “size up near expiry when clearly ITM/OTM, stand down near-the-money” behaviour without a hand-tuned moneyness cutoff — the pessimistic band does the separation. See Near-expiry handling (the key correction).
  • Never full Kelly.

Portfolio Kelly across overlapping windows

5-min windows overlap and are vol-correlated. Per-window Kelly summed naively over-levers. Apply a correlation haircut and a portfolio cap bounding total simultaneous Kelly exposure across concurrent windows. The risk actor reserves budget with atomic budget-reservation tokens so two windows can’t double-spend the same capital.

Confidence band

The band is the load-bearing risk primitive: first-order propagated uncertainty of P_fair from {σ error, Binance→Chainlink basis, feed noise, clock δ}.

  • Near expiry its behaviour is moneyness-conditional (not a flat “widens”): the S-driven term scales with ∂P_fair/∂Ŝ. Near-the-money (Ŝ ≈ K) that derivative → ∞ as τ → 0, so the band explodes — the danger zone. Clearly ITM/OTM (Ŝ far from K), Φ saturates and the derivative → 0, so near expiry the band narrows — the high-confidence, tradeable corner. See Near-expiry handling (the key correction).
  • Sizing reads the lower edge; entry threshold includes a margin(band) term.
  • The basis stddev (from the EWMA basis estimator) feeds the band’s price-uncertainty input directly.

Exposure & drawdown limits (hard guardrails)

  • Per-window max loss.
  • Daily loss → halt the day.
  • Rolling drawdown → throttle, then halt.
  • Per-trade cap vs measured book depth (~1k–$25k).

Circuit-breaker

Gate trading (stop / widen drastically) around:

  • RV spikes, liquidation-print bursts, spread blowouts.
  • Scheduled volatility — top-of-hour algorithmic bursts and US macro (NFP / CPI / FOMC).
  • Polymarket engine post-only (425) / cancel-only (503) modes.

Volatility predicts magnitude, not direction

Per crypto-shortterm-prediction-research, vol gates trading rather than calling it. Pair with the adverse-flow veto (contrarian Binance OFI/OBI — the Market-Maker’s Dilemma): heavy imbalance toward the side we’d take signals a toxic fill ⇒ widen / skip / flip, never follow. In Rev 2 this veto applies to takers too, not just makers.

Kill switch (automatic)

Auto-flatten / stop-new-entries on any of:

  • daily / drawdown breach;
  • feed staleness or invalid book;
  • clock skew beyond bound (clock discipline is a first-class input — NTP offset tracked, drift alarmed);
  • position-reconciliation mismatch (WAL vs CLOB open orders vs on-chain balances);
  • abnormal fill rate vs the τ-bucket baseline;
  • settlement basis anomaly.

"Flatten" semantics near expiry

When τ is too small to exit, manual flatten = stop-new-entries + alert, NOT sell-at-any-price (there may be no liquidity to exit into). A dead-man’s heartbeat pages if the bot goes silent.

Financial source of truth

The synchronous WAL + reconciliation is authoritative for orders/positions, not the async Supabase recorder (telemetry, may drop/spill, never blocks the hot path). Startup + periodic reconciliation against CLOB open orders and on-chain balances; mismatch → kill switch. See Architecture.

Key security

  • Hot trading key holds only working capital; cold treasury separate.
  • On-chain withdrawal allow-list.
  • Key encrypted at rest / separate signer.
  • VPS: no inbound, SSH-key-only.

Capacity

The edge is depth- and competition-limited (~150–250 touch depth). The Phase 0 analysis measures the capacity curve specifically in the near-expiry window (crypto-shortterm-backtesting); ramp follows measured investable size, not the nominal capital band.