Skip to main content

Overview

Autonome uses a multi-variant strategy architecture that allows multiple AI trading personalities to operate in parallel. Each variant represents a distinct trading philosophy, risk tolerance, and decision-making approach optimized for different market regimes.

The Four Variants

Autonome currently supports four strategy variants, each designed for specific market conditions:

Apex (Kelly Engine)

Aggressive 10x leverage strategy using volatility squeezes and VWAP momentum validation

Trendsurfer (Momentum)

Trend-following strategy that rides strong directional moves using ADX filtering and Kijun-Sen trailing stops

Contrarian (Reverter)

Mean reversion specialist that fades extremes in ranging markets when ADX < 25

Sovereign (Adaptive)

Balanced regime-adaptive allocator that blends trend and range strategies based on market conditions

Variant Architecture

Code Organization

The variant system is built on a centralized configuration model:

Single Source of Truth

All variant metadata lives in src/core/shared/variants/index.ts:
This configuration is consumed by:
  • Database schema (variant enum)
  • oRPC router schemas (Zod validation)
  • Frontend components (styling, filtering)
  • Seed scripts
  • Export utilities

Prompt System

Each variant has two core components: 1. SYSTEM_PROMPT (Static Instructions)
  • Trading philosophy and identity
  • Decision framework
  • Tool interface documentation
  • Risk management rules
  • Exit plan requirements
  • Response format guidelines
2. USER_PROMPT (Dynamic Data Template)
  • Session metadata (time, invocations, cash)
  • Market intelligence
  • Portfolio snapshot
  • Open positions table
  • Performance overview
  • Mission/instructions
Prompts are built using promptBuilder.ts:buildTradingPrompts():

Data Provided to AI

All variants receive identical market data and portfolio state, but interpret it differently based on their strategy:

Session Header

Market Intelligence

Provided via {{MARKET_INTELLIGENCE}} placeholder:
  • Technical indicators (Bollinger Bands, VWAP, EMA20, ADX, Supertrend, Ichimoku)
  • Volume data (current vs average)
  • Funding rates
  • Price action context

Portfolio Snapshot

Built by promptSections.ts:buildPortfolioSnapshotSection():

Open Positions

Built by promptSections.ts:buildOpenPositionsSection():

Performance Metrics

Built by promptSections.ts:buildPerformanceOverview():

Prompt Data Principles

The system follows strict guidelines for prompt construction:
  1. Spoon-feed data: AI should never infer or calculate - provide all metrics explicitly
  2. Explicit labels: Use risk_usd $128.56 not risk $128.56 - no ambiguity
  3. Show zeros: scaled_realized $0.00 is meaningful (no partial closes yet)
  4. Omit N/A: If data doesn’t exist, don’t show it (noise reduction)
  5. No token optimization: Clarity > brevity. Full descriptive labels always
  6. Section separation: Header (session), PORTFOLIO (current state), PERFORMANCE (historical), OPEN POSITIONS (per-position)
  7. No duplication: Each metric lives in exactly one section
Source: promptSections.ts:1-176

Tool Interface

All variants use the same tool interface for portfolio control:
  • createPosition: Open new positions with leverage, stops, targets
  • closePosition: Exit positions
  • updateExitPlan: Modify stops/targets on open positions
  • holding: Explicit no-action with reasoning
Critical Rule: Every response must end with a tool call. If no action is needed, call holding() with reasoning.

Common Constraints

All variants share these core constraints:

Data Source Hierarchy

  1. Manual/Exchange Indicators (Execution): Use for exact entry price, stop loss, and invalidation
  2. Taapi/Binance Indicators (Context): Use for broad trend and market regime (ADX, Supertrend, Ichimoku)

Mandatory Exit Plan

Every position must specify:
  • invalidation_condition: The thesis-killing event (e.g., “Close below VWAP”)
  • invalidation_price: The exact stop-loss price
  • time_exit: Max hold duration (e.g., “Close if held > 12h without profit”)
  • cooldown_minutes: 1-15 minutes to prevent impulsive flips

Cooldown System

Cooldown prevents direction flips. After closing a LONG position, the AI cannot open a SHORT position on the same symbol until cooldown expires (and vice versa). This applies both while holding AND after closing.

Variant Comparison

Adding a New Variant

To add a new trading strategy variant:
  1. Add to SSOT: Update src/core/shared/variants/index.ts
  2. Create Prompt File: Add src/server/features/trading/prompts/yournewvariant.ts
  3. Register in Variants: Update src/server/features/trading/prompts/variants.ts
  4. Migrate Database: Run bun run db:generate && bun run db:migrate

Next Steps

Apex Strategy

Learn about the aggressive 10x leverage Kelly Engine

Trendsurfer Strategy

Explore the momentum-based trend follower

Contrarian Strategy

Understand the mean reversion specialist

Sovereign Strategy

Discover the balanced adaptive allocator