Skip to content

codebytelabs/CryptoWildfire

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CryptoWildfire

A personal cryptocurrency trading and analysis platform focused on cost optimization by replacing expensive APIs with free alternatives.

Overview

CryptoWildfire is a data-driven crypto trading and analysis platform that integrates market data, social sentiment, and on-chain metrics to generate trading signals. The platform follows a cost-efficient approach by leveraging free APIs and web scraping techniques instead of expensive commercial services.

Architecture

The system consists of several core components:

  1. Data Collection Layer

    • Market data from CoinGecko
    • External sentiment indicators (Fear & Greed Index, CryptoCompare Social Stats, TradingView)
    • Social mentions from Reddit
    • On-chain data (roadmap)
  2. Signal Processing Layer

    • Signal aggregation with configurable weights
    • Composite score calculation
    • Consensus determination
  3. Storage Layer

    • Supabase PostgreSQL database
  4. Frontend Layer

    • React (Vite + TypeScript + Tailwind CSS) dashboard
    • Data visualization (TradingView, custom charts)
    • Frontend ML Engine (Prediction, Validity)

Technology Stack

  • Backend: Python (FastAPI)
  • Database: Supabase (PostgreSQL)
  • AI Services: Gemini/OpenRouter (Backend), Frontend ML Models (TypeScript)
  • Frontend: React (Vite, TypeScript, Tailwind CSS)
  • Cloud Infrastructure: Google Cloud (potential for backend ML), Supabase

Key Features

  • Real-time Market Data: Track prices, market caps, and volumes for various cryptocurrencies
  • Hybrid Sentiment Analysis:
    • External sentiment indicators (Fear & Greed Index, CryptoCompare)
    • Reddit community sentiment (analyzed with AI)
  • Signal Generation: Combines multiple indicators to generate trading signals
  • Responsive Dashboard: Interactive visualization of all data and signals
  • Enhanced Technical Analysis:
    • Dynamic support/resistance levels from API data
    • Moving averages (7-day and 21-day SMA)
    • Volume overlay with separate y-axis
    • Indicator toggles for technical features
  • Advanced Risk Management:
    • ATR-based volatility stop loss calculation
    • Trailing stop logic and position sizing
    • Correlation risk analysis

ML Integration Roadmap

The platform is being enhanced with ML-based prediction capabilities through a 6-phase implementation plan:

  1. ML Training Infrastructure - Building data collection and feature engineering pipelines
  2. Model Training & Evaluation - Implementing quantile regression models for price predictions
  3. Prediction API Integration - Creating prediction services with confidence scoring
  4. Frontend Integration - Building UI components for prediction visualization
  5. Testing & Deployment - Comprehensive testing and monitoring
  6. Post-Launch Optimization - Continuous learning and enhancement

See TODO.md for the detailed implementation plan.

ML-Enhanced Components

  • TechnicalChart Component - Now integrates ML predictions with technical indicators
  • DynamicStopLoss System - Uses ML models to optimize ATR-based stop levels
  • Progressive ML Influence - Initial 25% influence with performance-based growth

Project Structure

CryptoWildfire/
├── src/
│   ├── ai/
│   │   └── sentiment.py     # AI sentiment analysis module
│   ├── collectors/
│   │   ├── coingecko.py     # Market data collection from CoinGecko
│   │   ├── reddit_client.py # Social data collection from Reddit
│   │   └── market_sentiment.py # External sentiment indicators collection
│   ├── database/
│   │   ├── client.py        # Supabase database client
│   │   └── schema.sql       # Database schema definition
│   ├── engine/
│   │   └── aggregator.py    # Signal aggregation and processing
│   └── main_collector.py    # Main data collection orchestration
├── frontend/                # React frontend application
│   ├── src/
│   │   ├── components/      # UI Components
│   │   ├── pages/           # Page views (Dashboard)
│   │   ├── ml/              # Frontend ML logic (engines, ensemble)
│   │   ├── services/        # API communication
│   │   └── main.tsx         # Frontend entry point
│   ├── package.json         # Frontend dependencies
│   └── vite.config.ts       # Vite configuration
├── .env                     # Environment variables (API keys, etc.)
└── README.md                # This file

Setup & Installation

  1. Clone the repository

    git clone https://github.com/yourusername/CryptoWildfire.git
    cd CryptoWildfire
  2. Set up Backend environment

    # Create and activate a virtual environment (recommended)
    python -m venv venv
    source venv/bin/activate # On Windows use `venv\Scripts\activate`
    pip install -r requirements.txt
  3. Set up Frontend environment

    cd frontend
    npm install
    cd ..
  4. Configure environment variables Create a .env file with the following variables:

    # Core Infrastructure
    SUPABASE_URL=your_supabase_url
    SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key
    
    # Market Data Sources
    COINGECKO_API_KEY=your_coingecko_api_key (optional)
    CRYPTOCOMPARE_API_KEY=your_cryptocompare_api_key
    
    # Social Data Sources
    REDDIT_CLIENT_ID=your_reddit_client_id
    REDDIT_CLIENT_SECRET=your_reddit_client_secret
    REDDIT_USER_AGENT=your_reddit_user_agent
    
  5. Initialize database

    # Ensure Supabase is running and accessible
    python -c "from src.database.client import DatabaseClient; client = DatabaseClient(); client.execute_schema('src/database/schema.sql')"

Usage

Start Backend Services

# Start the main data collector (runs continuously)
python -m src.main_collector

# Start the backend API server (in a separate terminal)
# Ensure you are in the root directory with the venv activated
uvicorn src.api.main:app --reload --port 8000 

Start Frontend Development Server

# In a separate terminal
cd frontend
npm run dev

Access the dashboard at http://localhost:5173 (or the port specified by Vite).

Data Collection Strategy

CryptoWildfire uses a hybrid approach to sentiment analysis:

  1. External Sentiment Analysis (NEW)

    • Fear & Greed Index: Market-wide sentiment indicator (0-100 scale)
    • CryptoCompare Social Stats: Pre-analyzed social metrics
    • TradingView Technical Analysis: Buy/Sell signals from technical indicators
  2. In-house Sentiment Analysis

    • Reddit Analysis: Uses AI models via OpenRouter/VertexAI to analyze sentiment

This hybrid approach allows us to leverage existing sentiment analysis where available, reducing computation costs and improving reliability.

Signal Generation

Signals are generated using a weighted system:

  • Price momentum (30%)
  • Reddit sentiment (15%)
  • Volume spikes (10%)
  • On-chain metrics placeholder (10%) # Placeholder, needs implementation
  • Fear & Greed Index (10%)
  • TradingView technicals (10%)
  • CryptoCompare social (10%)

These weights can be adjusted in src/engine/aggregator.py.

Development Roadmap

Phase 1: Foundational Improvements (Current Focus)

This phase focuses on strengthening the core system using existing data sources and infrastructure.

  1. Enhance Data Quality & Monitoring: Implement robust checks (outliers, missing values, staleness) in data collectors (src/collectors/*), add corresponding automated tests (tests/integration/*), potentially structure checks in src/analysis/data_quality.py, and add basic performance monitoring. (Source: Existing APIs)
  2. Add Fibonacci & Refactor Technical Analysis: Implement Fibonacci retracement (src/analysis/technical_analysis_methods.py), ensure correct calculation/use of indicators like Ichimoku in src/analysis/technical_analysis.py, and add basic indicator toggles. (Source: Existing Market Data)
  3. Add Enhanced Volatility Measures: Implement historical volatility calculations in src/risk/risk_assessment.py. (Source: Existing Market Data)
  4. Create ML Benchmarking Suite: Develop baseline model training and evaluation scripts (src/ml/), potentially using MLflow. (Source: Existing Data)
  5. Implement Basic Feature Flag System: Create a simple mechanism (src/config/feature_flags.py) to toggle features for safer rollouts. (Source: New Code)
  6. Improve Backtesting/Validation: Enhance the existing backtester (src/backtesting/) and add basic forward testing logic. (Source: Existing Data)

Phase 2: Infrastructure & Expansion (Future)

  • Migrate to a Time-Series Database (e.g., TimescaleDB).
  • Implement a Data Backfill Pipeline.
  • Expand Exchange Coverage via CCXT configuration.
  • Add basic News Sentiment (e.g., GDELT).

Phase 3: Advanced Features (Longer Term / Requires Budget)

  • Integrate Paid On-Chain Data (e.g., Glassnode).
  • Integrate Paid Social Sentiment (e.g., Twitter/X API).
  • Integrate Whale Tracking data.
  • Develop Advanced ML Models (LSTM, Transformers).
  • Implement Advanced Risk Models (VAR, Liquidity).
  • Implement Advanced UI Features (WebGL, Explainable AI).

Frontend Vision

A detailed blueprint outlining the design principles, architecture, and key components for the next-generation CryptoWildfire frontend can be found in docs/FRONTEND_VISION.md.

License

This project is for personal use only and not licensed for redistribution.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors