Documentation Index
Fetch the complete documentation index at: https://docs.simplefunctions.dev/llms.txt
Use this file to discover all available pages before exploring further.
Gate checks (entry orders)
| Check | Failing condition |
|---|---|
| Min balance | balance_cents < min_balance_cents |
| Single-order cap | order_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 count | open_positions >= max_positions |
| Orders this tick | orders_this_tick >= max_orders_per_tick |
| Cooldown after loss | ticks_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 inportfolio_config. Update with:
Drawdown halt
Two thresholds beyond per-trade gates:drawdown_warn_cents(default $300) — emits ahealth_alertbut doesn’t halt.max_drawdown_halt_cents(default $500) — auto-flipsexecution_modetohalted. Recoverable only by manualsf portfolio config executionMode live.
Source
cli/src/risk-gates.ts— gate evaluator.cli/src/commands/agent.ts— pre-place_ordergate call.src/trigger/portfolio-tick.ts— env-var injection for autopilot.
Next steps
Portfolio autopilot
The autopilot runtime calling these gates.
Trade intents
Gate also runs on intent submission.