Skip to main content

Overview

Autonome supports multiple AI providers (OpenRouter, Nvidia NIM, AIHubMix) and strategy variants that implement distinct trading philosophies. Each variant has a custom system prompt and user prompt that shape the agent’s decision-making.

Apex

Geometric Growth Engine
High leverage (10x), volatility squeezes, profit ratcheting

Trendsurfer

Momentum Rider
ADX filtering, Ichimoku cloud breakouts, trailing stops

Contrarian

Mean Reversion Specialist
RSI extremes, oversold bounces, fixed targets

Sovereign

Risk-Adjusted Strategist
Kelly Criterion sizing, macro confluence, structured exits

Variant Configuration

Variants are defined in the shared configuration module:

AI Provider Setup

Autonome integrates three AI providers with API key rotation:
Key Rotation:
  • Define multiple API keys in .env.local: NIM_API_KEY_1, NIM_API_KEY_2, …
  • getNextNimApiKey() cycles through keys using a round-robin counter
  • Prevents rate limits when running multiple parallel agents
See src/env.ts for rotator implementation.

Prompt Architecture

Each variant has two prompts:
  1. System Prompt: Static strategy rules, identity, tool usage guidelines
  2. User Prompt: Dynamic template with placeholders for market data and portfolio state

Example: Apex (High Leverage Aggressor)

Example: Trendsurfer (Momentum Rider)

Trendsurfer uses no fixed profit targets—only trailing stops via updateExitPlan. This prevents premature exits in strong trends.

Data Source Hierarchy

All prompts enforce a critical data hierarchy:
  1. Manual/Exchange Indicators (Execution): Use for exact entry price, stop loss, and invalidation (orderbook-based)
  2. Taapi/Binance Indicators (Context): Use for broad trend and market regime (ADX, Supertrend, Ichimoku)
This prevents agents from using stale or misaligned indicators for trade execution.

Prompt Data Principles

Autonome follows strict spoon-feeding guidelines when building prompts:

Principle 1: Explicit Labels

Bad: risk $128.56 (ambiguous: USD or basis points?)
Good: risk_usd $128.56 (unambiguous)

Principle 2: Show Zeros

Bad: Omit scaled_realized if zero
Good: scaled_realized $0.00 (indicates no partial closes yet)

Principle 3: Omit N/A

Bad: funding_rate N/A (noise)
Good: Only show funding_rate if data exists

Principle 4: No Duplication

Each metric lives in exactly one section:
  • Session Header: invocationCount, currentTime, availableCash, exposurePct
  • PORTFOLIO: totalValue, unrealizedPnl, leverage, riskUsd
  • PERFORMANCE: sharpeRatio, winRate, maxDrawdown, closedTradeRealizedPnl
  • OPEN POSITIONS: Per-position entryPrice, markPrice, unrealizedPnl, roe

Principle 5: Clarity Over Brevity

Bad: SR (token-optimized)
Good: sharpe_ratio (explicit, no ambiguity)
Token cost is not a concern. Clarity and completeness are paramount. AI models are cheap; trading mistakes are expensive.

Prompt Builder Implementation

Prompt Sections

Prompts are assembled from modular sections:
Never calculate derived metrics in the prompt. Always compute them server-side and pass as explicit values.

Consensus Orchestrator

For enhanced decision quality, Autonome supports parallel consensus voting across multiple models:
Consensus Pattern:
  1. Run 3+ models in parallel with same market data
  2. Aggregate decisions via weighted voting
  3. Only execute trades where 2/3+ models agree with confidence >= 6/10
Benefits:
  • Reduces single-model bias
  • Higher confidence trades
  • Exploits diverse reasoning styles
See src/server/features/trading/consensusOrchestrator.ts for full implementation.

Model Configuration

Autonomous Trading Loop

Learn how agents execute the full trading workflow

Configuration

Set up API keys and model providers

Strategy Variants

Explore the different AI trading strategies

Trading System

Understand the trading system architecture