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 insrc/core/shared/variants/index.ts:
- 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
- Session metadata (time, invocations, cash)
- Market intelligence
- Portfolio snapshot
- Open positions table
- Performance overview
- Mission/instructions
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 bypromptSections.ts:buildPortfolioSnapshotSection():
Open Positions
Built bypromptSections.ts:buildOpenPositionsSection():
Performance Metrics
Built bypromptSections.ts:buildPerformanceOverview():
Prompt Data Principles
The system follows strict guidelines for prompt construction:- Spoon-feed data: AI should never infer or calculate - provide all metrics explicitly
- Explicit labels: Use
risk_usd $128.56notrisk $128.56- no ambiguity - Show zeros:
scaled_realized $0.00is meaningful (no partial closes yet) - Omit N/A: If data doesn’t exist, don’t show it (noise reduction)
- No token optimization: Clarity > brevity. Full descriptive labels always
- Section separation: Header (session), PORTFOLIO (current state), PERFORMANCE (historical), OPEN POSITIONS (per-position)
- No duplication: Each metric lives in exactly one section
promptSections.ts:1-176
Tool Interface
All variants use the same tool interface for portfolio control:createPosition: Open new positions with leverage, stops, targetsclosePosition: Exit positionsupdateExitPlan: Modify stops/targets on open positionsholding: Explicit no-action with reasoning
holding() with reasoning.
Common Constraints
All variants share these core constraints:Data Source Hierarchy
- Manual/Exchange Indicators (Execution): Use for exact entry price, stop loss, and invalidation
- 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 pricetime_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
- Risk Tolerance
- Entry Triggers
- Exit Strategy
| Variant | Max Leverage | Risk Profile | Best For |
|---|---|---|---|
| Apex | 10x | Extremely Aggressive | High-conviction squeezes |
| Trendsurfer | 5x | Moderate | Strong trends (ADX > 25) |
| Contrarian | 5x | Moderate | Ranging markets (ADX < 25) |
| Sovereign | 5x | Balanced | All market conditions |
Adding a New Variant
To add a new trading strategy variant:-
Add to SSOT: Update
src/core/shared/variants/index.ts -
Create Prompt File: Add
src/server/features/trading/prompts/yournewvariant.ts -
Register in Variants: Update
src/server/features/trading/prompts/variants.ts -
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

