Democratizing access to institutional trading intelligence.
AI Trader is a self-hosted, open-source AI trading platform that deploys a "Council of Agents" to analyze crypto markets. It leverages state-of-the-art LLMs (DeepSeek R1, GPT-4o, Claude 3.5 Sonnet) to perform technical analysis, risk assessment, and strategy execution.
- Council of Agents Architecture: Consensus-based trading decisions involving three distinct AI personas:
- 🧠 Strategy Consultant: Market structure analysis (SMC, ICT).
- 🛡️ Risk Officer: Position sizing and veto power over dangerous trades.
- ⏱️ Market Analyst: Timing and volatility analysis.
- Secure Bot Access (API Keys): Generate scoped API keys to allow external bots (like Clawbot) to securely interact with your trading engine.
- Bring Your Own Keys (BYOK): You retain full control. Your API keys (Exchange + LLM) are stored locally/encrypted and never shared.
- Multi-Model Support: Plug in your preferred intelligence: DeepSeek, OpenAI, Anthropic, or Google Gemini.
- Hybrid Strategy Engine: Combines Logic-based rules, reinforcement learning (RL) optimization, and LLM reasoning.
- Backtesting & Paper Trading: Test strategies safely before risking real capital.
- Frontend: Next.js 16 (App Router), React 19, TailwindCSS 4, Framer Motion.
- Backend: Node.js, Express, TypeScript.
- Database: PostgreSQL, Redis (for queues/caching).
- ORM: Prisma.
- Queues: BullMQ.
AI Trader provides a secure API for external bots to connect and trade.
- Go to Settings > API Keys.
- Generate a new key (e.g., "Clawbot").
- Copy the key (it's only shown once).
- Use
x-api-keyheader in your external bot requests.
- Node.js: v20 or higher
- Docker: Required for local database and Redis services.
- Git: Version control.
-
Clone the repository
git clone https://github.com/321barney/ai-trader_ts.git cd ai-trader_ts -
Start Infrastructure (Postgres + Redis)
docker-compose up -d
-
Backend Setup
cd backend npm install cp .env.example .env # Edit .env with your DATABASE_URL and Redis config npx prisma generate npx prisma db push npm run dev
-
Frontend Setup
cd ../frontend npm install
- Fix backend build errors
npm run build- Fix
subscription.middleware.ts - Fix
routes/onboarding.ts - Fix
routes/trading.tscp .env.example .env.local npm run dev
- Fix
- Access the Dashboard Open http://localhost:3000 in your browser.
We welcome contributions from the community! Whether it's fixing bugs, improving documentation, or proposing new features, your efforts are appreciated.
Please read our Contributing Guidelines for details on our code of conduct and the process for submitting pull requests.
If you find AI Trader useful and want to support its development, you can donate BNB to the following address:
BNB (BEP-20): 0xd46e707136bf0944b5e2ebbf1364b04f0fc148ec
Your support helps keep the servers running and the models training!
This project is licensed under the GNU Affero General Public License v3 (AGPL v3). See the LICENSE file for details.
This software is for educational purposes only. Trading cryptocurrencies involves substantial risk of loss and is not suitable for every investor. The AI models provided are experimental tools and do not constitute financial advice. The authors and contributors accept no liability for any financial losses incurred.