Skip to content

Nabilhassan12345/LineaAI-Crypto-Platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Linea Crypto AI Platform

Complete Linea AI Backend - Crypto Investment Analysis Platform

A comprehensive AI-powered system for analyzing cryptocurrency investment opportunities on the Linea ecosystem, supporting stablecoins, meme coins, and major cryptocurrencies.

🎯 Features

πŸ“Š Triple-Asset Analysis

  • Stablecoins: USDC, USDT, DAI, FRAX, USDB analysis
  • Meme Coins: PEPE, DOGE, SHIB, FLOKI, WOJAK, BONK analysis
  • Major Coins: BTC, ETH, SOL, AVAX, ADA, DOT, LINK, UNI analysis

πŸ€– AI-Powered Analysis

  • OpenAI GPT-4o-mini integration for intelligent ranking
  • Real-time market data from CoinGecko API
  • RAG (Retrieval-Augmented Generation) knowledge base
  • Fallback ranking system for reliability

πŸ”— API Endpoints

  • GET /api/market-data - Real-time crypto market data
  • POST /api/stablecoin-analysis - Stablecoin opportunities
  • POST /api/meme-coin-analysis - Meme coin opportunities
  • POST /api/major-coin-analysis - Major coin opportunities
  • POST /api/rank-opportunities - General analysis (all types)

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • OpenAI API key
  • CoinGecko API key (optional)

Installation

# Clone the repository
git clone https://github.com/YOUR_USERNAME/linea-crypto-ai-platform.git
cd linea-crypto-ai-platform

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env
# Edit .env with your API keys

Environment Variables

PORT=3000
NODE_ENV=development
OPENAI_API_KEY=your_openai_key_here
OPENAI_MODEL=gpt-4o-mini
LANGFUSE_PUBLIC_KEY=your_langfuse_public_key
LANGFUSE_SECRET_KEY=your_langfuse_secret_key
COINGECKO_API_KEY=your_coingecko_key_here

Running the Server

# Install dependencies
npm install

# Copy env template and fill keys
cp env.example .env
# edit .env to set OPENAI_API_KEY (optional), COINGECKO_API_KEY (optional)

# Development mode (serves frontend at /app)
npm run dev

# Open the app UI
open http://localhost:3000/app

# Production mode
npm start

# Health check
curl http://localhost:3000/api/health

πŸ“Š System Architecture

linea-crypto-ai-platform/
β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ openai-service.js      # AI ranking engine
β”‚   β”œβ”€β”€ market-data-service.js # Real-time market data
β”‚   β”œβ”€β”€ rag-service.js         # Knowledge base
β”‚   └── fallback-ranking.js    # Backup system
β”œβ”€β”€ routes/
β”‚   └── ai-routes.js          # API endpoints
β”œβ”€β”€ prompts/
β”‚   β”œβ”€β”€ system-prompt.js      # AI instructions
β”‚   └── user-prompt.js        # Dynamic prompts
β”œβ”€β”€ knowledge/                # RAG knowledge base
β”œβ”€β”€ data/
β”‚   └── opps.json            # Test opportunities
└── tests/                   # Test suites

πŸ§ͺ Testing

# Test complete system
npm run test-complete-crypto

# Test specific components
npm run test-stablecoin
npm run test-meme-coins
npm run test-rag

πŸ“ˆ Usage Examples

Analyze Stablecoin Opportunities

curl -X POST http://localhost:3000/api/stablecoin-analysis \
  -H "Content-Type: application/json" \
  -d '{"opportunities": [...]}'

Get Real-time Market Data

curl http://localhost:3000/api/market-data

πŸ”§ Development

Adding New Asset Types

  1. Update prompts/system-prompt.js with new scoring methodology
  2. Add test data to data/opps.json
  3. Create new API endpoint in routes/ai-routes.js
  4. Update market data service for new asset prices

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

πŸ“š Knowledge Base

The system includes comprehensive knowledge about:

  • DeFi protocols on Linea
  • Stablecoin mechanisms and risks
  • Meme coin market dynamics
  • Major cryptocurrency fundamentals
  • Market trends and analysis

πŸ›‘οΈ Security

  • API keys stored in .env (not committed)
  • Input validation on all endpoints
  • Rate limiting and error handling
  • Conservative AI analysis to prevent hallucination

πŸ“ž Support

For questions or issues:

  1. Check the test suites for examples
  2. Review the API documentation
  3. Open an issue on GitHub

πŸŽ‰ Team

Built for the Linea hackathon with love for the crypto community!


Ready to analyze crypto opportunities like a pro! πŸš€πŸ’°πŸŽ­πŸ¦

About

πŸš€ Professional AI-Powered Cryptocurrency Investment Platform with real-time market data, portfolio management, and intelligent analysis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages