
EPSILON is a safety-first autonomous AI trading agent built for Alpaca paper trading. It combines LLM-based market analysis with deterministic Python risk controls so the AI can analyze markets and propose decisions without being trusted to control execution or risk limits. The agent follows a controlled decision pipeline: real market data is collected through the Alpaca MCP infrastructure, technical signals are calculated, and a configured LLM provider such as Featherless generates structured trading decisions. Every decision then passes deterministic validation, position sizing, risk rules, a final order gate, and a second risk validation immediately before submission. Safety is enforced through multiple independent layers, including paper-only trading, kill-switch protection, approved-symbol controls, position and notional limits, market-data freshness checks, buying-power validation, duplicate-order protection, and fail-closed behavior. If market data, the LLM, PostgreSQL, or Alpaca becomes unavailable, the agent refuses to trade rather than guessing or continuing unsafely. The backend uses FastAPI, PostgreSQL, SQLAlchemy, and a dedicated worker/orchestrator architecture. PostgreSQL provides durable production state for decisions, executions, risk events, worker heartbeats, leases, and idempotency. Worker leader election prevents multiple workers from executing simultaneously, while lease-loss handling stops trading if ownership cannot be verified. The system also provides JWT authentication, RBAC, audit logging, health/readiness checks, structured observability, execution reconciliation, and a production frontend that displays real backend state instead of fabricated portfolio values. EPSILON is designed around a core principle: an AI model may propose a trade, but deterministic infrastructure decides whether that trade is allowed to reach Alpaca.
4 Sep 2026