A Wails-based desktop application for LLM-powered algorithmic trading, combining a Tiger Beetle-inspired event sourcing engine with broker integration and intelligent decision-making.
This platform provides a general-purpose runtime engine with a trading layer built on top:
- Runtime Engine: Event-sourced execution with phases, steps, and deterministic replay
- Trading Layer: Strategy management, order execution, risk validation, and portfolio tracking
- LLM Integration: AI-powered decision making with approval workflows
- Broker Support: ETrade integration (OAuth client in development - see COD-12)
- Event Sourcing: Append-only JSONL logs, perfect audit trail, crash recovery
- Single-Threaded State Mutation: No mutexes, command channels only
- Phase-Based Execution:
data_ingestion→signal_generation→risk_validation→order_execution - Invariant-Driven Development: Runtime and trading invariants enforced at execution and replay time
- Wails v2 desktop application
- Real-time strategy monitoring
- Approval workflows for LLM decisions
- Emergency stop controls
internals/ Go backend packages
runtime/ Event sourcing engine, phase management
clients/ ETrade API client with OAuth
cmd/ Command-line utilities and test tools
pkg/ Shared utility packages (assert, validation)
frontend/ Vite-powered web UI
docs/ Documentation
development.md Engineering principles and standards
ALGO.md Runtime engine invariants
TRADING.md Trading-domain invariants
FLOW.md User journey and workflows
.env.example Environment variable template
- Go 1.21+
- Node.js 18+
- Wails CLI:
go install github.com/wailsapp/wails/v2/cmd/wails@latest
- Clone the repository
- Copy
.env.exampleto.envand configure your credentials:ETRADE_CONSUMER_KEY=your_sandbox_key ETRADE_CONSUMER_SECRET=your_sandbox_secret
- Install dependencies:
cd frontend && npm install
Run with hot reload:
wails devThe dev server runs on http://localhost:34115 for calling Go methods from the browser.
Create production build:
wails build# Run all tests
go test ./...
# Run specific package tests with verbose output
go test ./internals/runtime/... -v
# Run ETrade OAuth test utility
go run ./cmd/etrade-oauth-testdocs/development.md- Engineering principles, code standards, testing strategy (Tiger Beetle-inspired)docs/ALGO.md- Runtime engine invariants (runs, steps, phases, event log)docs/TRADING.md- Trading-domain invariants (strategy, orders, positions, risk, approval, LLM)docs/FLOW.md- User journey and trading workflow documentationAGENTS.md- AI agent instructions for development
Do it right the first time. No potential latency spikes, no exponential algorithms. What we have meets design goals, even if incomplete.
Define what MUST always be true, then design so invariants are enforced or unrepresentable. Code is the implementation of proofs.
Events are the source of truth, state is a cache. All state changes captured as immutable events in append-only JSONL logs.
Assertions everywhere (minimum 2 per function). Panic on programmer errors. Hard limits on everything (70 lines per function, bounded loops, fixed-capacity channels).
- Mode 1: Approval Required - User approves every LLM-generated action
- Mode 2: Autonomous - LLM acts independently within hard limits
- Daily loss limits
- Position size limits
- Concentration limits
- Volatility circuit breakers
- Emergency stop button
- Complete event log with sequence numbers
- Deterministic replay capability
- LLM reasoning captured for every decision
- User approval history tracked
[Add license information]
See docs/development.md for code standards and contribution guidelines.