Skip to content

321barney/ai-trader_ts

Repository files navigation

AI Trader - Institutional-Grade AI For Everyone

License Status PRs Welcome

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.

🚀 Features

  • 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.

🛠 Tech Stack

  • 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.

🤖 Bot Integration

AI Trader provides a secure API for external bots to connect and trade.

  1. Go to Settings > API Keys.
  2. Generate a new key (e.g., "Clawbot").
  3. Copy the key (it's only shown once).
  4. Use x-api-key header in your external bot requests.

🏁 Getting Started

Prerequisites

  • Node.js: v20 or higher
  • Docker: Required for local database and Redis services.
  • Git: Version control.

Installation

  1. Clone the repository

    git clone https://github.com/321barney/ai-trader_ts.git
    cd ai-trader_ts
  2. Start Infrastructure (Postgres + Redis)

    docker-compose up -d
  3. 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
  4. Frontend Setup

    cd ../frontend
    npm install
  • Fix backend build errors npm run build
    • Fix subscription.middleware.ts
    • Fix routes/onboarding.ts
    • Fix routes/trading.ts cp .env.example .env.local npm run dev
    
    
  1. Access the Dashboard Open http://localhost:3000 in your browser.

🤝 Contributing

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.

💝 Support the Project

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!

📜 License

This project is licensed under the GNU Affero General Public License v3 (AGPL v3). See the LICENSE file for details.

⚠️ Disclaimer

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.

About

Self-hosted, open-source AI trading platform featuring a 'Council of Agents' (DeepSeek, GPT-4, Claude) for institutional-grade crypto analysis and execution

Resources

License

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors