Prerequisites
Before installing NeuraTrade, ensure you have the following dependencies installed:Required Dependencies
Go 1.26+
Go 1.26+
NeuraTrade’s backend is written in Go and requires version 1.26 or higher.Install on macOS:Install on Linux:Verify installation:
Bun 1.3+
Bun 1.3+
Required for TypeScript sidecar services (CCXT and Telegram).Install on macOS/Linux:Verify installation:
Bun is a fast JavaScript runtime compatible with Node.js. It’s significantly faster than Node.js for our use case.
SQLite (default)
SQLite (default)
SQLite is the default database for development and testing.Install on macOS:Install on Linux:Verify installation:
Redis (recommended)
Redis (recommended)
Redis is used for caching, distributed locks, and quest coordination.Install on macOS:Install on Linux:Verify installation:
Optional Dependencies
PostgreSQL
Recommended for production deployments. Provides better concurrency and performance than SQLite.
jq
JSON processor for pretty-printing API responses in the terminal.
Native Installation
Configure Environment
Create your environment configuration from the template:Edit
.env and update the following minimum required settings:Install Dependencies
Download Go modules and install service dependencies:This will:
- Download Go dependencies to local cache (
.cache/go-mod) - Install Telegram service Bun dependencies
- Set up build cache directories
Build Binaries
Build all NeuraTrade binaries:This creates the following binaries in
./bin/:| Binary | Description |
|---|---|
neuratrade-server | Go backend API server |
neuratrade | CLI gateway for orchestration |
ccxt-service | Exchange bridge service launcher |
telegram-service | Telegram bot service launcher |
Build output is cached in
.cache/go-build for faster incremental builds.Using the Installation Script
NeuraTrade provides an installation script for automated setup:- Build all binaries
- Install them to
~/.local/bin(or custom$INSTALL_DIR) - Create configuration directory at
~/.neuratrade - Generate environment template from
.env.example - Create CLI shortcuts and compatibility wrappers
Installation Script Options
The
--enable-autostart flag configures a macOS LaunchAgent to start NeuraTrade automatically on login.Directory Structure
NeuraTrade uses the following directory layout:Runtime State Location
All runtime state is stored in the directory specified byNEURATRADE_HOME (default: ~/.neuratrade):
Configuration Files
config.json
config.json
Runtime configuration including:
- Exchange API keys and credentials
- Telegram chat IDs
- AI provider settings
- Operational mode preferences
neuratrade.db (SQLite only)
neuratrade.db (SQLite only)
SQLite database file containing:
- Market data and price history
- Arbitrage opportunities
- Trading signals and indicators
- User accounts and API keys
- Quest and agent state
SQLITE_PATH in .env.logs/
logs/
Service log files:
backend.log- Backend API server logsgateway.log- Gateway orchestration logstelegram.log- Telegram bot logsccxt.log- Exchange service logs
LOG_FORMAT=json.pids/
pids/
Process ID files for running services:
backend.pid- Backend server PIDtelegram.pid- Telegram service PIDccxt.pid- CCXT service PID
Environment Variables
Key environment variables for NeuraTrade configuration:Core Settings
| Variable | Required | Default | Description |
|---|---|---|---|
NEURATRADE_HOME | Yes | ~/.neuratrade | Runtime state directory |
SERVER_PORT | No | 8080 | Backend API port |
BACKEND_HOST_PORT | No | 58080 | External host port mapping |
ENVIRONMENT | No | development | Runtime environment |
LOG_LEVEL | No | info | Logging level (debug/info/warn/error) |
LOG_FORMAT | No | json | Log format (json/text) |
Database Settings
| Variable | Required | Default | Description |
|---|---|---|---|
DATABASE_DRIVER | Yes | sqlite | Database driver (sqlite/postgres) |
SQLITE_PATH | If SQLite | - | Path to SQLite database file |
DATABASE_URL | If PostgreSQL | - | PostgreSQL connection URL |
DATABASE_HOST | If PostgreSQL | localhost | PostgreSQL host |
DATABASE_PORT | If PostgreSQL | 5432 | PostgreSQL port |
DATABASE_USER | If PostgreSQL | postgres | PostgreSQL username |
DATABASE_PASSWORD | If PostgreSQL | - | PostgreSQL password |
DATABASE_DBNAME | If PostgreSQL | neuratrade | PostgreSQL database name |
Service Settings
| Variable | Required | Default | Description |
|---|---|---|---|
REDIS_HOST | No | localhost | Redis host |
REDIS_PORT | No | 6379 | Redis port |
REDIS_PASSWORD | No | - | Redis password |
CCXT_SERVICE_URL | No | http://localhost:3001 | CCXT service URL |
TELEGRAM_PORT | No | 3002 | Telegram service port |
TELEGRAM_BOT_TOKEN | If using Telegram | - | Telegram bot token from @BotFather |
Security Settings
| Variable | Required | Default | Description |
|---|---|---|---|
ADMIN_API_KEY | Recommended | - | Admin API key for protected endpoints |
JWT_SECRET | Yes | - | JWT signing secret (min 32 chars) |
BCRYPT_COST | No | 12 | Bcrypt hashing cost |
Verification
After installation, verify your setup:Next Steps
Configure Exchanges
Add exchange API keys and credentials
Setup Telegram
Configure the Telegram bot for notifications
Enable AI Agents
Set up autonomous trading with AI agents
API Reference
Explore the complete API documentation