The decision cycle
Inside one Invest cycle: fetch portfolio and chains, run one model call per symbol candidate, gate the result, submit to the paper account, and manage the lifecycle. Covers the agent's narrow authority, the shared wall-clock budget, the no-fallback model path, and the durable record every decision leaves.
One cycle, end to end
Invest's decision loop is heartbeat-driven, and every order it can produce is a paper order. Each cycle runs the same stages under a shared wall-clock budget, designed so that late results are discarded before they can produce side effects.
Fetch state
Portfolio positions and option chains are gathered for the symbols under consideration.
Decide
One model call per symbol candidate produces a proposal or no_action.
Gate
A fail-closed risk gate validates the proposal before it can proceed.
Submit
An approved proposal becomes an Interactive Brokers paper order.
Manage lifecycle
Open positions stay under lifecycle controls after entry.
The budget is shared across the cycle, with a per-candidate start floor and a re-entrancy guard so cycles do not pile into each other. A wedged cycle is force-retired after its budget plus a grace period expires. Restart safety is part of the same design: execution state persists in a Redis cache, and at boot the system reconciles against broker truth. Entry authority is refused until the broker-versus-cache position comparator matches.
One agent, two terminal answers
The sole order proposer is a PydanticAI-based decision agent with eighteen registered tools, and its terminal authority is narrow: propose an order or a hedge, or return no_action. It cannot approve, size past the gate, or submit. The tools give it a research surface over its own world: option chains and greeks, intraday bars, portfolio state, buying power and pattern day trader status, the market calendar, signal queries, historical replay and event studies, concentration checks, chain resolution, price structure, and stale-cache awareness.
No fallback chain
Model calls route through an OpenAI-compatible LiteLLM proxy. The primary model is pinned and there is no automatic fallback chain: on provider failure the system retries the same lane, then fails closed to no_action. An optional smart-escalation mode allows a second pass within the same model family with its own tool budget, and a panel or consensus-jury mode is observe-only and disabled unless explicitly configured. An optional ranked-batch mode can ask for several ranked convictions instead of one, but it defaults to off, and its deterministic per-intent selector is fail-safe off and instrument-only by design. That selector is the keystone the system is still working to meet, and these docs describe the intended target rather than a completed claim.
Every decision leaves one record
Each decision writes a durable decision_log row carrying the gate result and the submission outcome on the same row, so a proposal, its verdict, and its fate can be reviewed together. Rows ending in no_action are server-stamped as operational (something infrastructure-side prevented a decision) or market_judgment (the model declined on the merits). The split keeps "the system did nothing" interpretable after the fact, without reading health into any single flag. This is also the record the operator console's decision-quality and execution-quality panels review, so the cycle and the console are reading from the same durable source rather than from two reconstructed views.
The gate in stage three is the fail-closed validator described in risk controls; its implemented form is covered in risk in practice.
How Invest works
The evidence-to-lifecycle flow behind Invest's autonomous US options and equities paper-trading system.
Evidence feeds
Invest reads a curated set of market, flow, filing, and policy signals before it decides anything. This page covers the publisher fleet, the admission policy that decides which feeds reach the decision agent, and the freshness, cost, and write-integrity controls around them.