Skip to main content

Elena & backtesting

Elena is QuantDesk’s dedicated backtest lifecycle agent. It is not MIKEY-AI (general protocol intelligence). Elena orchestrates dataset selection, strategy specs, simulation, walk-forward validation, and deploy gating.

Status

ComponentStatusNotes
elena-ai/ service (port 3006)ShippedConductor + tool registry
/api/v2/backtest/*ShippedJob queue, manifests, deploy gate
Pro BT + Lite backtest flowsShippedReal APIs — no mock-only production path
Live LLM ConductorOptionalSet LLM API key; VITE_MOCK_ELENA=true for UI-only dev
GPU optimization poolOptionalCPU path default; use_gpu: true falls back with notice

Architecture

Browser → backend :3002 (/api/elena/chat, /api/v2/backtest/*)

         elena-ai :3006 (Conductor tools)

         Redis job queue → Python sim workers

         databaseService (manifests, ledger, deploy bundles)
  • Elena never re-implements sim logic — it calls backend /api/v2/backtest/* as a client.
  • MIKEY has no tool that submits sim jobs directly.

Gateway routes

RoutePurpose
POST /api/elena/chatConductor chat (privacy-scrubbed proxy to Elena)
GET /api/elena/healthElena service health via gateway

Backtest API (narrative)

Base: /api/v2/backtest. Full schemas in Swagger (/api/docs/).
RoutePurpose
GET /datasetsBrowse oracle-history datasets (dataset_id, version, resolution)
POST /runsSubmit backtest job (requires fees, slippage, funding — zero-cost rejected)
GET /runs/:idManifest + metrics (Sharpe, Sortino, max DD, DSR, trade count)
POST /runs/:run_id/deploy-gate/checkPass/fail vs thresholds (min trades, OOS Sharpe, max DD)
POST /runs/:run_id/deploy-bundleVersioned artifact for paper → live place_order_v2
POST /compliance/scanAST guardrail before queue (lookahead, blocklisted imports)
POST /optimizeParameter sweeps (optional GPU queue)
POST /walk-forwardRolling OOS validation

StrategyCardSchema

Developer output emits StrategyCardSchema JSON — SSOT for max_leverage, cost model refs, and Solana friction (priority fees + slippage floor). Deploy bundles extend this schema; there is no competing parallel format.

Deploy gate → flex publish

  1. Complete backtest → run_id
  2. deploy-gate/check passes (evaluates DSR, not raw Sharpe alone)
  3. Optional paper/live deploy via scoped session keys
  4. Publish flex card: POST /api/v2/social/flex-cards with run_id — see Verified flex charter

Local dev

# Backend + Redis required
cd backend && pnpm run start:dev

export QUANTDESK_BACKEND_URL=http://localhost:3002
cd elena-ai && pnpm dev   # port 3006

# Optional mock Conductor UI without LLM key
# frontend/.env: VITE_MOCK_ELENA=true
Fleet: bash scripts/services/start-all.sh from repo root (full fleet; docs site not auto-started).