Skip to content
moazenizPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CryptoAlpha

Hybrid Neuro-Symbolic Crypto Trading Signal System

CryptoAlpha is an intelligent crypto analysis platform that combines LLM agents with ML models to generate high-probability trading signals for DeFi and Layer 2 tokens.

Features

  • Multi-Agent Analysis: LangGraph-based orchestration of specialized AI agents
  • Technical Analysis: RSI, MACD, Bollinger Bands, support/resistance detection
  • On-Chain Analysis: Whale tracking, exchange flows, holder distribution
  • ML Models: Anomaly detection, regime detection, pattern matching
  • Risk Management: Conservative position sizing, stop-loss, take-profit
  • Telegram Delivery: Real-time signal alerts via Telegram bot
  • Learning System: Performance tracking and confidence calibration

Architecture

┌─────────────────────────────────────────────────────────────────────────┐
│                           TELEGRAM BOT                                   │
└─────────────────────────────────────────────────────────────────────────┘
                                    │
                                    ▼
┌─────────────────────────────────────────────────────────────────────────┐
│                         ORCHESTRATOR                                     │
│                    (LangGraph State Machine)                             │
│  ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐       │
│  │  Technical  │ │  On-Chain   │ │  Strategy   │ │   Signal    │       │
│  │   Agent     │ │   Agent     │ │   Agent     │ │ Aggregator  │       │
│  └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘       │
└─────────────────────────────────────────────────────────────────────────┘
                                    │
                    ┌───────────────┼───────────────┐
                    ▼               ▼               ▼
┌──────────────────────┐ ┌──────────────────┐ ┌──────────────────────────┐
│   EXCHANGE LAYER     │ │  ON-CHAIN LAYER  │ │      ML LAYER            │
│   (CCXT/Binance)     │ │   (Web3.py)      │ │  (scikit-learn)          │
└──────────────────────┘ └──────────────────┘ └──────────────────────────┘

Quick Start

1. Installation

# Clone repository
git clone https://github.com/moazeniz/Trade.git
cd Trade

# Create virtual environment
python -m venv venv
source venv/bin/activate  # Linux/Mac
# or
venv\Scripts\activate  # Windows

# Install dependencies
pip install -r requirements.txt

2. Configuration

Create a .env file with your API keys:

# Telegram Bot
TELEGRAM_BOT_TOKEN=your_telegram_bot_token

# Exchange (optional, uses public APIs by default)
BINANCE_API_KEY=your_binance_api_key
BINANCE_SECRET=your_binance_secret

# On-Chain (optional)
ETH_RPC_URL=https://eth-mainnet.g.alchemy.com/v2/your-key
ARB_RPC_URL=https://arb-mainnet.g.alchemy.com/v2/your-key

# LLM (Google Gemini)
GEMINI_API_KEYS=key1,key2,key3

3. Run

# Full system with Telegram bot
python main.py run

# Quick analysis of a single token
python main.py analyze BTC/USDT

# Telegram bot only
python main.py bot

# Performance report
python main.py performance --days 30

Or use the run scripts:

# Linux/Mac
./scripts/run.sh

# Windows
scripts\run.bat

Telegram Commands

Command Description
/start Initialize and show help
/status Current system status
/analyze <TOKEN> Analyze specific token
/signals Recent signals
/performance Performance metrics
/settings Configure preferences
/alerts on/off Toggle alerts

Signal Format

🟢 BUY SIGNAL: ARB/USDT

Confidence: 72%
Entry: $1.24
Stop Loss: $1.18 (-5%)
Take Profit: $1.40 (+13%)
Position Size: 1.5%

Technical: RSI 28 (oversold), price at 200 EMA support
On-Chain: Top 10 whales added 2.1M ARB in 48h
Quant: Similar setups have 62% win rate historically

Project Structure

Trade/
├── main.py                     # Entry point
├── config.py                   # Configuration
├── requirements.txt            # Dependencies
│
├── data/                       # Data layer
│   ├── exchange_client.py      # CCXT wrapper
│   ├── onchain_client.py       # Web3 integration
│   └── cache.py                # Data caching
│
├── features/                   # Feature engineering
│   ├── technical.py            # TA indicators
│   ├── onchain.py              # On-chain features
│   └── pipeline.py             # Feature orchestration
│
├── ml/                         # ML models
│   ├── anomaly_detector.py     # Isolation Forest
│   ├── whale_profiler.py       # K-Means clustering
│   ├── regime_detector.py      # Market state
│   └── pattern_matcher.py      # Historical patterns
│
├── agents/                     # LLM agents
│   ├── orchestrator.py         # LangGraph graph
│   ├── technical_agent.py      # TA agent
│   ├── onchain_agent.py        # On-chain agent
│   └── risk_agent.py           # Risk manager
│
├── core/                       # Core pipeline
│   ├── pipeline.py             # Analysis pipeline
│   ├── signal_generator.py     # Signal creation
│   ├── database.py             # SQLite persistence
│   └── performance_tracker.py  # Metrics
│
├── memory/                     # Memory systems
│   ├── vector_store.py         # ChromaDB
│   ├── episodic.py             # Long-term memory
│   └── working.py              # Session state
│
├── bot/                        # Telegram bot
│   ├── telegram_bot.py         # Main bot
│   ├── handlers.py             # Commands
│   └── alerts.py               # Notifications
│
└── utils/                      # Utilities
    ├── logger.py               # Structured logging
    └── prompts.py              # Agent prompts

Risk Management

CryptoAlpha uses conservative risk management:

Parameter Value
Max Position Size 2%
Default Stop Loss 5%
Min Risk/Reward 1.5
Max Open Positions 5
Signal Cooldown 4 hours
Min Confidence 65%

Performance Targets

Metric Target
Win Rate > 55%
Sharpe Ratio > 1.0
Max Drawdown < 10%
Signal Latency < 2 min

Supported Assets

DeFi Blue-Chips:

  • AAVE, UNI, LINK, MKR, SNX

Layer 2:

  • ARB, OP, MATIC

DeFi Mid-Cap:

  • CRV, LDO, COMP, SUSHI, 1INCH

Dependencies

  • Python 3.10+
  • LangGraph / LangChain
  • Google Gemini (LLM)
  • CCXT (Exchange API)
  • Web3.py (On-Chain)
  • scikit-learn (ML)
  • python-telegram-bot
  • ChromaDB (Vector Store)
  • SQLite (Signal History)

Development

# Run tests
python -m pytest tests/ -v

# Type checking
mypy .

# Linting
ruff check .

License

MIT License

Disclaimer

This software is for educational purposes only. Trading cryptocurrencies involves significant risk. Past performance does not guarantee future results. Always do your own research before making investment decisions.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages