Skip to main content
Every order — autopilot, CLI agent, web terminal trade ticket, intent executor — runs through these gates. They fail-closed on every violation: the order is rejected with a structured reason, never silently downsized.

Gate checks (entry orders)

CheckFailing condition
Min balancebalance_cents < min_balance_cents
Single-order caporder_cost_cents > max_single_order_cents
Total exposure(current_exposure + order_cost) > max_total_exposure_cents
Daily loss cap|daily_realized_pnl| > max_daily_loss_cents (if PnL is negative)
Position countopen_positions >= max_positions
Orders this tickorders_this_tick >= max_orders_per_tick
Cooldown after lossticks_since_last_loss < cooldown_after_loss_ticks

Gate checks (exit orders)

Exit orders skip the position-count and exposure gates (they reduce exposure), but still respect single-order cap and daily-loss cap.

Configuration

Per-user limits live in portfolio_config. Update with:
sf portfolio config max_total_exposure_cents 500000
sf portfolio config max_per_market_cents 150000
Defaults:
max_total_exposure_cents:    300000  ($3,000)
max_per_market_cents:        100000  ($1,000)
max_daily_loss_cents:        15000   ($150)
max_positions:               20
min_balance_cents:           10000   ($100)
max_orders_per_tick:         3
max_single_order_cents:      20000   ($200)
cooldown_after_loss_ticks:   4

Drawdown halt

Two thresholds beyond per-trade gates:
  • drawdown_warn_cents (default $300) — emits a health_alert but doesn’t halt.
  • max_drawdown_halt_cents (default $500) — auto-flips execution_mode to halted. Recoverable only by manual sf portfolio config executionMode live.

Where gates apply

The same gate semantics apply across the CLI agent, web terminal trade ticket, intent executor, and portfolio autopilot. Treat the gate result as the contract: accepted orders proceed, rejected orders return a structured reason.

Next steps

Portfolio autopilot

The autopilot runtime calling these gates.

Trade intents

Gate also runs on intent submission.