OpenAlice
File-driven AI trading agent engine for crypto and securities markets
Install / Use
/learn @TraderAlice/OpenAliceREADME
Open Alice
Your one-person Wall Street. Alice is an AI trading agent that gives you your own research desk, quant team, trading floor, and risk management — all running on your laptop 24/7.
- File-driven — Markdown defines persona and tasks, JSON defines config, JSONL stores conversations. Both humans and AI control Alice by reading and modifying files. The same read/write primitives that power vibe coding transfer directly to vibe trading. No database, no containers, just files.
- Reasoning-driven — every trading decision is based on continuous reasoning and signal mixing.
- OS-native — Alice can interact with your operating system. Search the web through your browser, send messages via Telegram, and connect to local devices.
[!CAUTION] Open Alice is experimental software in active development. Many features and interfaces are incomplete and subject to breaking changes. Do not use this software for live trading with real funds unless you fully understand and accept the risks involved. The authors provide no guarantees of correctness, reliability, or profitability, and accept no liability for financial losses.
Features
- Multi-provider AI — switch between Claude (via Agent SDK with OAuth or API key) and Vercel AI SDK at runtime, no restart needed
- Unified Trading Account (UTA) — each trading account is a self-contained entity that owns its broker connection, git-like operation history, and guard pipeline. AI interacts with UTAs, never with brokers directly. All order types use IBKR's type system (
@traderalice/ibkr) as the single source of truth. Supported brokers: CCXT (100+ crypto exchanges), Alpaca (US equities), Interactive Brokers (stocks, options, futures, bonds via TWS/Gateway). Each broker self-registers its config schema and UI field descriptors — adding a new broker requires zero changes to the framework - Trading-as-Git — stage orders, commit with a message, push to execute. Every commit gets an 8-char hash. Full history reviewable via
tradingLog/tradingShow - Guard pipeline — pre-execution safety checks (max position size, cooldown, symbol whitelist) that run inside each UTA before orders reach the broker
- Market data — TypeScript-native OpenBB engine (
opentypebb) with no external sidecar required. Covers equity, crypto, commodity, currency, and macro data with unified symbol search (marketSearchForResearch) and technical indicator calculator. Can also expose an embedded OpenBB-compatible HTTP API for external tools - Equity research — company profiles, financial statements, ratios, analyst estimates, earnings calendar, insider trading, and market movers (top gainers, losers, most active)
- News — background RSS collection from configurable feeds with archive search tools (
globNews/grepNews/readNews) - Cognitive state — persistent "brain" with frontal lobe memory, emotion tracking, and commit history
- Event log — persistent append-only JSONL event log with real-time subscriptions and crash recovery
- Cron scheduling — event-driven cron system with AI-powered job execution and automatic delivery to the last-interacted channel
- Evolution mode — two-tier permission system. Normal mode sandboxes the AI to
data/brain/; evolution mode gives full project access including Bash, enabling the agent to modify its own source code - Account snapshots — periodic and event-driven account state capture with equity curve visualization. Configurable snapshot intervals and carry-forward for gaps
- Hot-reload — enable/disable trading accounts and connectors (Telegram, MCP Ask) at runtime without restart
- Web UI — local chat interface with real-time SSE streaming, sub-channels with per-channel AI config, portfolio dashboard with equity curve, and full config management. Dynamic broker config forms rendered from broker-declared schemas
Key Concepts
Provider — The AI backend that powers Alice. Claude (via @anthropic-ai/claude-agent-sdk, supports OAuth login or API key) or Vercel AI SDK (direct API calls to Anthropic, OpenAI, Google). Switchable at runtime via ai-provider.json.
Domain — Business logic layer (src/domain/). Each domain module (trading, market-data, analysis, news, brain, thinking) owns its state and persistence. Tool (src/tool/) is a thin bridge layer that registers domain capabilities as AI tools in ToolCenter.
UTA (Unified Trading Account) — The core business entity for trading. Each UTA owns a broker connection (IBroker), a git-like operation history (TradingGit), a guard pipeline, and a snapshot scheduler. Think of it as a git repository for trades — multiple UTAs are like a monorepo with independent histories. AI and the frontend interact with UTAs exclusively; brokers are internal implementation details. All types (Contract, Order, Execution, OrderState) come from IBKR's type system via @traderalice/ibkr. AccountManager owns the full UTA lifecycle (create, reconnect, enable/disable, remove).
Trading-as-Git — The workflow inside each UTA. Stage operations (stagePlaceOrder, stageClosePosition, etc.), commit with a message, then push to execute. Push runs guards, dispatches to the broker, snapshots account state, and records a commit with an 8-char hash. Full history is reviewable via tradingLog / tradingShow.
Guard — A pre-execution check that runs inside a UTA before operations reach the broker. Guards enforce limits (max position size, cooldown between trades, symbol whitelist) and are configured per-account.
Connector — An external interface through which users interact with Alice. Built-in: Web UI, Telegram, MCP Ask. Connectors register with ConnectorCenter; delivery always goes to the channel of last interaction.
Brain — Alice's persistent cognitive state. The frontal lobe stores working memory across rounds; emotion tracking logs sentiment shifts with rationale. Both are versioned as commits.
Heartbeat — A periodic check-in where Alice reviews market conditions and decides whether to send you a message. Uses a structured protocol: HEARTBEAT_OK (nothing to report), CHAT_YES (has something to say), CHAT_NO (quiet).
EventLog — A persistent append-only JSONL event bus. Cron fires, heartbeat results, and errors all flow through here. Supports real-time subscriptions and crash recovery.
Evolution Mode — A permission escalation toggle. Off: Alice can only read/write data/brain/. On: full project access including Bash — Alice can modify her own source code.
Architecture
graph LR
subgraph Providers
AS[Claude / Agent SDK]
VS[Vercel AI SDK]
end
subgraph Core
PR[ProviderRouter]
AC[AgentCenter]
TC[ToolCenter]
S[Session Store]
EL[Event Log]
CCR[ConnectorCenter]
end
subgraph Domain
MD[Market Data]
AN[Analysis]
subgraph UTA[Unified Trading Account]
TR[Trading Git]
GD[Guards]
BK[Brokers]
SN[Snapshots]
end
NC[News Collector]
BR[Brain]
BW[Browser]
end
subgraph Tasks
CRON[Cron Engine]
HB[Heartbeat]
end
subgraph Interfaces
WEB[Web UI]
TG[Telegram]
MCP[MCP Server]
end
AS --> PR
VS --> PR
PR --> AC
AC --> S
TC -->|Vercel tools| VS
TC -->|in-process MCP| AS
TC -->|MCP tools| MCP
MD --> AN
MD --> NC
AN --> TC
GD --> TR
TR --> BK
UTA --> TC
NC --> TC
BR --> TC
BW --> TC
CRON --> EL
HB --> CRON
EL --> CRON
CCR --> WEB
CCR --> TG
WEB --> AC
TG --> AC
MCP --> AC
Providers — interchangeable AI backends. Claude (Agent SDK) uses @anthropic-ai/claude-agent-sdk with tools delivered via in-process MCP — supports Claude Pro/Max OAuth login or API key. Vercel AI SDK runs a ToolLoopAgent in-process with direct API calls. ProviderRouter reads ai-provider.json on each call to select the active backend at runtime.
Core — AgentCenter is the top-level orchestration center that routes all calls (both stateless and session-aware) through ProviderRouter. ToolCenter is a centralized tool registry — tool/ files register domain capabilities there, and it exports them in Vercel AI SDK and MCP formats. EventLog provides persistent append-only event storage (JSONL) with real-time subscriptions and crash recovery. ConnectorCenter tracks which channel the user last spoke through.
Domain — business logic modules registered as AI tools via the tool/ bridge layer. The trading domain centers on UnifiedTradingAccount (UTA) — each UTA bundles a broker connection, git-like operation history, guard pipeline, and snapshot scheduler into a single entity. Guards enforce pre-execution safety checks (position size limits, trade cooldowns, symbol whitelist) inside each UTA before orders reach the broker. Snapshots capture periodic account state for equity curve tracking. NewsCollector runs background RSS fetches into a persistent archive searchable by the agent.
Tasks — scheduled background work. CronEngine manages jobs and fires cron.fire events into the EventLog on schedule; a listener picks them up, runs them through AgentCenter, and delivers replies via ConnectorCenter. `He
