FenixAI_tradingBot icon indicating copy to clipboard operation
FenixAI_tradingBot copied to clipboard

Fenix Ai Trading Bot with crew ai and ollama

๐Ÿฆ… FenixAI Trading Bot v2.0

Autonomous Multi-Agent Cryptocurrency Trading System with Self-Evolving Memory

Python 3.10+ LangGraph License PRs Welcome FastAPI React TypeScript Binance arXiv TailwindCSS Socket.IO

An advanced trading system powered by multiple specialized AI agents that collaborate to analyze markets, manage risk, and execute trades on Binance Futures. Features ReasoningBank memory system for self-evolving agent capabilities.

Fenix Dashboard Preview

๐Ÿ“– Documentation ยท ๐Ÿš€ Quick Start ยท ๐Ÿ—๏ธ Architecture ยท ๐Ÿ“ Changelog ยท ๐Ÿ“„ Paper


โš ๏ธ WARNING: This is a BETA project. Fenix is under active development, is not yet profitable, and may not work as expected. Use at your own risk!

๐Ÿฆ… A Message from the Creator (v2.0)

Hello, it has been 6 months since I launched the first version of Fenix. I have been on an incredible journey for six months, learning a ton about programming, LLMs, AI papers, and above all, experimenting a lot with Fenix.

I have been doing hundreds of tests with both paper trading and live trading, testing different LLM configurations, different cryptocurrencies, different timeframes, adding and removing more agents, and I have learned a lot. I believe the main advantage of Fenix is that it evolves over time along with LLMs; they are getting smarter and it shows in their trading decisions.

So far, the best performance I have obtained is with large models of over 50b, but the main problem is that they are expensive and difficult to maintain privacy. I think the best option currently between price/privacy and large models is the Ollama cloud models which are expanding more and more, but without a doubt, I believe the best option will be to fine-tune several small models. Right now I am experimenting with that configuration.

But I didn't want to leave you any longer without updates, so this is Version 2.0. It now includes a nice and intuitive local page to make it more accessible to use. Regarding performance, what has improved the most is undoubtedly the Reasoning Bank; it helps agents not to make the same mistakes repeatedly and also to be right more often thanks to remembering. I am also experimenting with the new HOPE model that learns as it is used, but I still don't have a clear result to share.

While I continue investigating and improving Fenix, I hope this new version can be useful to at least one person as inspiration or to test the new limits of trading.

Thank you for taking the time to read my words. I would appreciate it if you leave me a star, a comment in discussion, a contribution, advice, or some change on my BuyMeACoffee page.

Thank you very much, Ganador


โญ Star History

Star History Chart

โœจ What's New in v2.0

Complete architectural overhaul - Migrated from CrewAI to LangGraph for more robust and flexible agent orchestration.

Feature v1.0 (June 2025) v2.0 (December 2025)
Orchestration CrewAI LangGraph (State Machine)
Memory System Basic TradeMemory ReasoningBank + LLM-as-Judge
Visual Analysis Static screenshots Chart Generator + Playwright TradingView Capture
LLM Providers Ollama only Ollama, MLX, Groq, HuggingFace
Frontend Flask Dashboard React + Vite + TypeScript
Agent Weighting Static Dynamic (performance-based)
Security Basic SecureSecretsManager + Path Validation
Real-time Polling WebSocket + Socket.IO

Notable security and developer workflow improvements

  • API binds to 127.0.0.1 by default to avoid accidental public exposure. To bind to all interfaces intentionally, set ALLOW_EXPOSE_API=true.
  • Demo accounts are not seeded by default; set CREATE_DEMO_USERS=true for local development.
  • DEFAULT_DEMO_PASSWORD and DEFAULT_ADMIN_PASSWORD may be used for local testing; avoid using them in production.
  • We added DEVELOPMENT.md and RELEASE_CHECKLIST.md to help developers follow the release process and avoid secrets leaks.
  • Archived internal reports are now in docs/archives/reports/ to reduce root clutter.

๐Ÿง  How It Works

FenixAI employs a multi-agent architecture where specialized AI agents collaborate to make trading decisions. The system is built on three core pillars:

  1. Multi-Agent Collaboration: Specialized agents analyze different aspects of the market
  2. Self-Evolving Memory: ReasoningBank enables agents to learn from past decisions
  3. Dynamic Risk Management: Real-time circuit breakers and position sizing

๐Ÿงช ReasoningBank: Self-Evolving Agent Memory

FenixAI implements the ReasoningBank architecture based on the research paper "ReasoningBank: Scaling Agent Self-Evolving with Reasoning Memory". This novel memory framework:

  • Distills reasoning strategies from successful and failed trading decisions
  • Semantic retrieval of relevant historical context during analysis
  • LLM-as-Judge evaluates decision quality and provides feedback
  • Continuous learning enables agents to improve over time
  • Embeddings-based search finds similar market conditions from history
# Example: Agent retrieves relevant context from ReasoningBank
context = reasoning_bank.get_relevant_context(
    agent_name="technical_analyst",
    current_prompt=market_analysis_prompt,
    limit=3
)
# Agent uses historical insights to make better decisions

๐Ÿ“Š Visual Analysis System

The Visual Agent supports two modes for chart analysis:

Mode Description Use Case
Chart Generator Generates charts with indicators using mplfinance Fast, offline, customizable
Playwright Capture Captures TradingView screenshots via browser automation Real TradingView charts, advanced indicators

Both modes produce base64-encoded images that are analyzed by vision-capable LLMs (LLaVA, GPT-4V, etc.).

Fenix Agent Architecture

๐Ÿค– The Agent Team

Agent Responsibility Inputs Output
Technical Analyst RSI, MACD, ADX, SuperTrend, EMA crossovers OHLCV data, indicators Signal + confidence
Visual Analyst Chart pattern recognition, support/resistance Generated charts / TradingView screenshots Pattern analysis
Sentiment Analyst News, Twitter, Reddit, Fear & Greed Index Social feeds, news APIs Market sentiment
QABBA Agent Bollinger Bands, volatility, squeeze detection, OBI, CVD Microstructure data Volatility signal
Decision Agent Weighted consensus from all agents All agent reports Final trade decision
Risk Manager Circuit breakers, position sizing, drawdown limits Portfolio state, decision Approved/vetoed trade

๐Ÿ”„ Agent Workflow

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                              FENIX AI v2.0                                  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                             โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚   Frontend  โ”‚โ—„โ”€โ”€โ–บโ”‚              FastAPI + Socket.IO                 โ”‚    โ”‚
โ”‚  โ”‚  React/Vite โ”‚    โ”‚                  (Real-time)                     โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                                          โ”‚                                  โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚                      TRADING ENGINE                                  โ”‚   โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚   โ”‚
โ”‚  โ”‚  โ”‚                 LangGraph Orchestrator                          โ”‚ โ”‚   โ”‚
โ”‚  โ”‚  โ”‚                   (State Machine)                               โ”‚ โ”‚   โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚   โ”‚
โ”‚  โ”‚           โ”‚              โ”‚              โ”‚              โ”‚             โ”‚   โ”‚
โ”‚  โ”‚     โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”       โ”‚   โ”‚
โ”‚  โ”‚     โ”‚ Technical โ”‚  โ”‚  Visual   โ”‚  โ”‚ Sentiment โ”‚  โ”‚   QABBA   โ”‚       โ”‚   โ”‚
โ”‚  โ”‚     โ”‚  Agent    โ”‚  โ”‚  Agent    โ”‚  โ”‚  Agent    โ”‚  โ”‚  Agent    โ”‚       โ”‚   โ”‚
โ”‚  โ”‚     โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜       โ”‚   โ”‚
โ”‚  โ”‚           โ”‚              โ”‚              โ”‚              โ”‚             โ”‚   โ”‚
โ”‚  โ”‚     โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”       โ”‚   โ”‚
โ”‚  โ”‚     โ”‚              Decision Agent + Risk Manager             โ”‚       โ”‚   โ”‚
โ”‚  โ”‚     โ”‚           (Dynamic Weighting + LLM-as-Judge)           โ”‚       โ”‚   โ”‚
โ”‚  โ”‚     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜       โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚                                 โ”‚                                           โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚                         MEMORY LAYER                                 โ”‚   โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚   โ”‚
โ”‚  โ”‚  โ”‚  ReasoningBank  โ”‚  โ”‚  Trade Memory   โ”‚  โ”‚   LLM-as-Judge      โ”‚   โ”‚   โ”‚
โ”‚  โ”‚  โ”‚ (Semantic Search)โ”‚ โ”‚   (History)     โ”‚  โ”‚  (Self-Evaluation)  โ”‚   โ”‚   โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚                                                                             โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚                        EXECUTION LAYER                               โ”‚   โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚   โ”‚
โ”‚  โ”‚  โ”‚  Binance Client โ”‚  โ”‚  Order Executor โ”‚  โ”‚   Market Data       โ”‚   โ”‚   โ”‚
โ”‚  โ”‚  โ”‚ (REST + WS)     โ”‚  โ”‚  (Paper/Live)   โ”‚  โ”‚   (Real-time)       โ”‚   โ”‚   โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚                                                                             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐ŸŒŸ Key Features

Multi-Agent Collaboration

  • ๐Ÿค– 6 Specialized Agents working in parallel and sequence
  • ๐Ÿ”„ Dynamic Weighting based on agent performance history
  • ๐ŸŽฏ Consensus-Based Decisions with configurable thresholds

Self-Evolving Memory (ReasoningBank)

  • ๐Ÿง  Semantic Memory Search using embeddings
  • ๐Ÿ“ Experience Distillation from successes and failures
  • โš–๏ธ LLM-as-Judge for decision quality evaluation
  • ๐Ÿ“ˆ Continuous Improvement over time

Visual Analysis

  • ๐Ÿ“Š Chart Generator with mplfinance (RSI, MACD, Bollinger, etc.)
  • ๐Ÿ–ผ๏ธ TradingView Capture via Playwright browser automation
  • ๐Ÿ‘๏ธ Vision LLM Integration (LLaVA, GPT-4V compatible)

Multi-Provider LLM Support

  • ๐Ÿฆ™ Ollama - Local inference with any GGUF model
  • ๐ŸŽ MLX - Apple Silicon optimized (M1/M2/M3)
  • โšก Groq - Ultra-fast cloud inference
  • ๐Ÿค— HuggingFace - Serverless inference API

Trading Features

  • ๐Ÿ“ˆ Binance Futures integration (testnet & live)
  • ๐Ÿ›ก๏ธ Paper Trading mode by default
  • โš ๏ธ Circuit Breakers for risk management
  • ๐Ÿ“Š Multi-Timeframe Analysis support

Real-Time Dashboard

  • ๐ŸŒ React + TypeScript modern frontend
  • ๐Ÿ”Œ WebSocket real-time updates
  • ๐Ÿ“ฑ Responsive Design with TailwindCSS
  • ๐Ÿ“Š Live Charts and agent performance metrics

๐Ÿš€ Quick Start

Prerequisites

Requirement Version Notes
Python 3.10+ 3.11 recommended
Node.js 18+ For frontend
Ollama Latest Local LLM inference
RAM 16GB+ 32GB for larger models
GPU Optional CUDA for faster inference
Apple Silicon M1/M2/M3 MLX support for optimized inference

Optional Services

  • Binance Account - For live/testnet trading
  • Groq API Key - For cloud LLM inference
  • HuggingFace Token - For HF Inference API
  • Playwright - For TradingView chart capture

Installation

# Clone the repository
git clone https://github.com/Ganador1/FenixAI_tradingBot.git
cd FenixAI_tradingBot

# Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate  # Linux/Mac

# Install dependencies
pip install -e ".[dev,vision,monitoring]"

# Configure environment
cp .env.example .env
# Edit .env with your API keys

# Pull required Ollama models
ollama pull qwen3:8b

Running FenixAI

# Terminal 1: Start the backend with API
python run_fenix.py --api

# Terminal 2: Start the frontend
cd frontend && npm install && npm run client:dev

Access the dashboard at: http://localhost:5173

Note: For safety, the API will bind to 127.0.0.1 by default. To allow external binding, set ALLOW_EXPOSE_API=true. If you want to enable demo accounts for local development, set CREATE_DEMO_USERS=true and (optionally) DEFAULT_DEMO_PASSWORD to control the demo password. Avoid enabling demo users in production.


๐Ÿ” Release v2.0 & Security Highlights

  • This release improves security defaults: API binds to 127.0.0.1 by default, demo users are gated, and secrets scanning is included in the developer workflow.
  • Please follow RELEASE_CHECKLIST.md before final releases. Dev-focused run instructions are in DEVELOPMENT.md.
  • Archived development reports can be found in docs/archives/reports/.
  • Demo credentials information moved to: docs/security/docs/security/DEMO_CREDENTIALS.md.

CLI Options

python run_fenix.py --help

python run_fenix.py                      # Paper trading (default)
python run_fenix.py --symbol ETHUSDT     # Different symbol
python run_fenix.py --timeframe 5m       # Different timeframe
python run_fenix.py --no-visual          # Disable visual agent
python run_fenix.py --mode live --allow-live  # Live trading (โš ๏ธ real money)

๐Ÿ—๏ธ Architecture

Project Structure

FenixAI/
โ”œโ”€โ”€ run_fenix.py              # Main entry point
โ”œโ”€โ”€ pyproject.toml            # Python project configuration
โ”œโ”€โ”€ package.json              # Node.js dependencies (API)
โ”‚
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ analysis/             # Technical analysis modules
โ”‚   โ”œโ”€โ”€ api/                  # FastAPI server & WebSocket
โ”‚   โ”œโ”€โ”€ cache/                # Caching utilities
โ”‚   โ”œโ”€โ”€ core/                 # LangGraph orchestrator
โ”‚   โ”‚   โ””โ”€โ”€ langgraph_orchestrator.py
โ”‚   โ”œโ”€โ”€ dashboard/            # Trading dashboard backend
โ”‚   โ”œโ”€โ”€ inference/            # Multi-provider LLM clients
โ”‚   โ”‚   โ”œโ”€โ”€ providers/        # Ollama, MLX, Groq, HuggingFace
โ”‚   โ”‚   โ”œโ”€โ”€ reasoning_judge.py
โ”‚   โ”‚   โ””โ”€โ”€ unified_inference_client.py
โ”‚   โ”œโ”€โ”€ memory/               # Memory systems
โ”‚   โ”‚   โ”œโ”€โ”€ reasoning_bank.py # ReasoningBank implementation
โ”‚   โ”‚   โ””โ”€โ”€ trade_memory.py   # Trade history storage
โ”‚   โ”œโ”€โ”€ models/               # Data models & schemas
โ”‚   โ”œโ”€โ”€ monitoring/           # System monitoring
โ”‚   โ”œโ”€โ”€ pipeline/             # Data processing pipelines
โ”‚   โ”œโ”€โ”€ prompts/              # Agent prompt templates
โ”‚   โ”œโ”€โ”€ risk/                 # Risk management module
โ”‚   โ”œโ”€โ”€ services/             # External service integrations
โ”‚   โ”œโ”€โ”€ tools/                # Agent tools
โ”‚   โ”‚   โ”œโ”€โ”€ chart_generator.py           # Chart generation with mplfinance
โ”‚   โ”‚   โ”œโ”€โ”€ chart_generator_playwright.py
โ”‚   โ”‚   โ”œโ”€โ”€ tradingview_playwright_capture.py
โ”‚   โ”‚   โ”œโ”€โ”€ fear_greed.py                # Fear & Greed Index
โ”‚   โ”‚   โ”œโ”€โ”€ twitter_scraper.py
โ”‚   โ”‚   โ””โ”€โ”€ reddit_scraper.py
โ”‚   โ”œโ”€โ”€ trading/              # Trading engine
โ”‚   โ”‚   โ”œโ”€โ”€ engine.py         # Main trading engine
โ”‚   โ”‚   โ”œโ”€โ”€ binance_client.py # Binance Futures client
โ”‚   โ”‚   โ””โ”€โ”€ executor.py       # Order execution
โ”‚   โ””โ”€โ”€ utils/                # Utility functions
โ”‚
โ”œโ”€โ”€ config/
โ”‚   โ”œโ”€โ”€ fenix.yaml            # Main configuration
โ”‚   โ”œโ”€โ”€ llm_providers.yaml    # LLM provider profiles
โ”‚   โ””โ”€โ”€ settings.py           # Environment settings
โ”‚
โ”œโ”€โ”€ frontend/                 # React + Vite dashboard
โ”‚   โ”œโ”€โ”€ components/           # React components
โ”‚   โ”œโ”€โ”€ pages/                # Page components
โ”‚   โ”œโ”€โ”€ hooks/                # Custom React hooks
โ”‚   โ”œโ”€โ”€ stores/               # State management
โ”‚   โ””โ”€โ”€ providers/            # Context providers
โ”‚
โ”œโ”€โ”€ api/                      # Express.js API (optional)
โ”œโ”€โ”€ docs/                     # Documentation
โ”œโ”€โ”€ tests/                    # Test suite
โ”œโ”€โ”€ scripts/                  # Utility scripts
โ””โ”€โ”€ logs/                     # Application logs

Technology Stack

Layer Technology Details
Orchestration LangGraph, LangChain State machine-based agent workflow
LLM Inference Ollama, MLX, Groq, HuggingFace Multi-provider with automatic fallback
Backend Python 3.10+, FastAPI, Socket.IO Async REST API + WebSocket
Frontend React 18, Vite, TypeScript, TailwindCSS Modern SPA with real-time updates
Exchange Binance Futures (ccxt, python-binance) Testnet & production support
Memory ReasoningBank Semantic search + embeddings + LLM-as-Judge
Visual Tools mplfinance, Playwright Chart generation + TradingView capture
Database SQLite Trade history & reasoning persistence
Monitoring Custom dashboard System metrics, agent performance

๐Ÿ“Š Configuration

Main Configuration (config/fenix.yaml)

trading:
  symbol: BTCUSDT
  timeframe: 15m
  max_risk_per_trade: 0.02
  
agents:
  enable_technical: true
  enable_qabba: true
  enable_visual: true  # Requires vision model
  enable_sentiment: true  # Requires news APIs
  technical_weight: 0.30
  qabba_weight: 0.30
  consensus_threshold: 0.65

LLM Provider Profile

You can choose a provider profile in config/llm_providers.yaml or by setting the environment variable LLM_PROFILE. For example, to use the Groq Free profile:

export GROQ_API_KEY=gsk_...
export LLM_PROFILE=groq_free
export LLM_ALLOW_NOOP_STUB=1  # optional -- fallback to noop in dev

If Groq packages (langchain_groq) or local providers (e.g., langchain_ollama) are not installed, Fenix will try the configured fallback provider. If none are available and LLM_ALLOW_NOOP_STUB is 1, the system will initialize a Noop stub so the graph can still run for local testing.

LLM Providers (config/llm_providers.yaml)

active_profile: "all_local"  # Options: all_local, mixed_providers, mlx_optimized, all_cloud

all_local:
  technical:
    provider_type: "ollama_local"
    model_name: "qwen3:8b"
    temperature: 0.1

Environment Variables

Variable Description Default
BINANCE_API_KEY Binance API key -
BINANCE_SECRET_KEY Binance secret key -
LLM_PROFILE LLM provider profile to use all_local
GROQ_API_KEY Groq API key (for cloud inference) -
HF_TOKEN HuggingFace token -
ALLOW_EXPOSE_API Allow API to bind to all interfaces false
CREATE_DEMO_USERS Enable demo user creation false
LLM_ALLOW_NOOP_STUB Fallback to noop LLM for testing 0
ENABLE_VISUAL_AGENT Enable chart analysis agent true
ENABLE_SENTIMENT_AGENT Enable news/social analysis true

๐Ÿงช Testing

# Run all tests
pytest

# Run specific test file
pytest tests/test_agents.py -v

# Run with coverage
pytest --cov=src --cov-report=html

# Run integration tests
pytest tests/test_integration.py -v

# Run LangGraph orchestrator tests
pytest tests/test_langgraph_orchestrator.py -v

๐Ÿ“– Documentation

Document Description
QUICKSTART.md Getting started guide
ARCHITECTURE.md System architecture
AGENTS.md Agent system documentation
API.md REST API reference
CHANGELOG.md Version history
DEVELOPMENT.md Developer guide
CONTRIBUTING.md Contribution guidelines

๐Ÿ›ก๏ธ Security Considerations

Trading Safety

Feature Description
Paper Trading Default Always starts in paper mode - no real money at risk
Live Trading Safeguard Requires explicit --allow-live flag
Circuit Breakers Automatic trading halt on excessive losses
Position Limits Configurable maximum position sizes
Daily Loss Limits Stop trading when daily loss threshold reached

Application Security

Feature Description
API Key Encryption SecureSecretsManager for encrypted storage
Local API Binding API binds to 127.0.0.1 by default
Path Validation Prevents path traversal attacks
Rate Limiting Respects Binance API limits
Demo User Gating Demo accounts disabled by default
Secrets Scanning Pre-commit hooks for secret detection

๐Ÿค Contributing

Contributions are welcome! Please read our contributing guidelines before submitting PRs.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Development Setup

# Install dev dependencies
pip install -e ".[dev]"

# Install pre-commit hooks
pre-commit install

# Run linting
ruff check src/

# Run type checking
mypy src/

โš ๏ธ Disclaimer

This software is for educational and research purposes only.

  • โš ๏ธ Cryptocurrency trading involves substantial risk of loss
  • ๐Ÿ“‰ Past performance is not indicative of future results
  • ๐Ÿ’ธ Never trade with money you cannot afford to lose
  • ๐Ÿšซ The authors are not responsible for any financial losses
  • ๐Ÿงช Always test thoroughly on paper trading before considering live trading

๐Ÿ“„ License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Copyright 2025 Ganador1

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

๐Ÿ™ Acknowledgments

Technologies

๐Ÿ“š Research Papers


๐Ÿ“ฌ Contact & Support


Made with โค๏ธ by Ganador1

If you find this project useful, please consider giving it a โญ!

โฌ† Back to Top