Skip to main content
This guide will walk you through setting up Autonome and running your first AI-powered trading strategy in simulator mode.

Prerequisites

Before you begin, ensure you have:
  • Bun >= 1.1 (required for package management and runtime)
  • PostgreSQL 15+ (local or hosted instance)
  • Node.js 18+ (for compatibility)
Autonome uses Bun exclusively as its package manager and runtime. Do not use npm or pnpm.

Quick Setup

1

Clone and Install

Clone the repository and install dependencies:
git clone <your-autonome-repo>
cd autonome
bun install
2

Configure Environment

Copy the example environment file and configure it:
cp .env.example .env
Edit .env with your configuration. For simulator mode, you only need to configure the database:
.env
# Database (Required)
DATABASE_URL=postgres://user:password@localhost:5432/autonome

# Trading Mode (Simulator - No API keys needed)
TRADING_MODE=simulated

# Simulator Configuration
SIM_INITIAL_CAPITAL=10000
SIM_QUOTE_CURRENCY=USDT
SIM_REFRESH_INTERVAL_MS=10000

# Optional: AI Provider Keys (at least one recommended)
# Get keys from: https://console.anthropic.com/
NIM_API_KEY=your_nim_key_here
OPENROUTER_API_KEY=your_openrouter_key_here
Never commit your .env file to version control. The .env.example file is provided as a template only.
3

Set Up the Database

Generate and apply database migrations:
bun run db:generate
The seed script will create the default AI model variants:
  • Apex - Aggressive momentum trading
  • Trendsurfer - Trend-following strategy
  • Contrarian - Counter-trend positions
  • Sovereign - Balanced, multi-factor approach
You can verify your database setup using Drizzle Studio:
bun run db:studio
This will open a web interface to explore your database schema and data.
4

Start the Development Server

Launch both the API server and frontend:
bun run dev:all
The application will start on:
5

Access the Dashboard

Open your browser to http://localhost:5173. You’ll see the Autonome dashboard with:
  • Portfolio Overview - Real-time net portfolio value and performance metrics
  • Active Positions - Current open positions with P&L tracking
  • Trade History - Closed trades and performance analytics
  • AI Co-Pilot - Chat interface showing AI reasoning and decisions
6

Run Your First Strategy

In the dashboard:
  1. Navigate to the Models section
  2. Select a trading variant (e.g., “Apex” for aggressive momentum)
  3. Click Start Trading to activate the autonomous trading loop
  4. Watch as the AI agent analyzes market data and executes trades in the simulator
The AI will:
  • Fetch real-time market data
  • Analyze technical indicators and market conditions
  • Make trade decisions based on its strategy variant
  • Execute orders in the exchange simulator
  • Monitor positions and update exit plans
In simulator mode, no real money is at risk. The ExchangeSimulator validates your strategies offline using realistic market simulation.

Understanding Simulator Mode

The trading simulator provides a high-fidelity environment for strategy testing:

Features

  • Realistic Order Execution - Simulates market orders, limit orders, and partial fills
  • Portfolio Tracking - Tracks positions, P&L, and account balance
  • Market Data Integration - Uses real market prices via the Lighter API
  • Persistence - All trades and positions are stored in PostgreSQL
  • Zero Risk - No real funds or API credentials required

Simulator Configuration

Fine-tune simulator behavior in your .env:
# Initial account balance
SIM_INITIAL_CAPITAL=10000

# Quote currency for trading pairs
SIM_QUOTE_CURRENCY=USDT

# Price refresh interval (milliseconds)
SIM_REFRESH_INTERVAL_MS=10000

Viewing Simulator State

The simulator maintains state in your database. You can inspect it using:
bun run db:studio
Look for these tables:
  • "Orders" - All orders (OPEN = positions, CLOSED = completed trades)
  • "PortfolioSnapshots" - Historical portfolio values
  • "Models" - AI model configurations and performance

Next Steps

Now that you have a working trading bot, explore these features:

Configure AI Models

Customize AI behavior, risk parameters, and trading strategies

Live Trading

Switch from simulator to live trading with Lighter API

Monitor Performance

Analyze trade history, P&L, and risk metrics

API Reference

Explore oRPC procedures and data models

Troubleshooting

If you see DATABASE_URL connection errors:
  1. Verify PostgreSQL is running:
    psql -U postgres -c "SELECT version();"
    
  2. Check your connection string format:
    postgres://username:password@host:port/database
    
  3. Ensure the database exists:
    createdb autonome
    
If Bun commands fail:
  1. Verify Bun installation:
    bun --version
    
  2. Reinstall Bun:
    curl -fsSL https://bun.sh/install | bash
    
  3. Add Bun to your PATH:
    export PATH="$HOME/.bun/bin:$PATH"
    
If ports 5173 or 8081 are in use:
  1. Change the API port in .env:
    PORT=8082
    
  2. Update the API URL for the frontend:
    VITE_API_URL=http://localhost:8082
    
  3. Kill processes using the ports:
    lsof -ti:5173 | xargs kill -9
    lsof -ti:8081 | xargs kill -9
    
If you see AI provider authentication errors:
  1. Verify your API keys are set in .env
  2. Check that at least one provider key is valid
  3. The platform will automatically cycle through available providers
You can test without AI keys initially - the simulator will work, but autonomous trading requires at least one AI provider configured.

Command Reference

Common commands you’ll use frequently:
CommandPurpose
bun run dev:allStart API + Frontend
bun run db:studioOpen database explorer
bun run db:seedReset and seed database
bun run lintRun code linting
bun run testRun test suite
bun run buildBuild for production
For a complete list of commands, see package.json or run bun run without arguments.

Build docs developers (and LLMs) love