How TraderBear works, architecturally
The one-sentence version: a language model translates plain-English intent into structured rules, and a deterministic engine — not the model — enforces the money-adjacent responsibilities: qualification gates, permissions, risk caps, order lifecycle, and the audit log.
The two-layer pattern
TraderBear separates understanding from execution. The intent layer (an LLM) reads what you want and emits a machine-readable rule with explicit numeric thresholds. The execution layer is ordinary typed code: it checks every proposed action against hard risk caps (per-position size, per-market and per-day limits, a global kill switch) and writes every decision — fired, sized, rejected, and why — to an append-only audit log. Everyone starts on paper. After a sustained high-level live unlock, the user chooses approval-required execution or authorizes direct execution within explicit permissions and limits.
Three services
- Agent worker (edge): the conversation loop, rule engine, scheduling, and BearScout scoring run on Cloudflare Workers — millisecond cold starts matter when a cron settles markets every few minutes.
- Data sidecar: market data (stocks, crypto, futures, event markets) flows through a dedicated data service; the agent is its only caller, so one layer owns data-quality quirks.
- Accounts service: user auth, paper-trade ledgers, and P&L accounting live in a separate service with its own database — deliberately boring technology for the part that must never be creative.
Paper-first by construction
Every account starts in paper mode and the simulator is intentionally pessimistic where it matters (fills, spreads), because a paper system that flatters you is worse than none — we wrote up what 1,000 paper trades taught us. Live trading remains locked until demanding, sustained qualification criteria are met. An unlock is not a promise of profit, and the user remains responsible for their execution choice and risk. The same engine also powers forecast scoring, where forecasts are Brier-scored against the market ask at call time (full scoring methodology).
More background: why the agent lives on a Worker · how plain English becomes safe rules