A comprehensive Solana token analysis and monitoring system with real-time liquidity pool detection and AI-powered token evaluation via Telegram.
- Real-time Monitoring: Connects to Helius WebSocket to detect new Raydium liquidity pools instantly
- Transaction Analysis: Automatically fetches and parses Raydium liquidity pool creation transactions
- Token Validation: Integrates rug check validation and DexScreener data fetching
- Telegram Notifications: Sends instant alerts with token details and trading links
- AI-Powered Analysis: Uses Google Gemini AI for intelligent token evaluation
- Interactive Bot: Telegram bot with
/analyzecommand for on-demand token screening - Risk Assessment: Provides rug analysis, sentiment evaluation, and trading recommendations
- Comprehensive Reports: Detailed token analysis with leverage advice and trading strategies
- Rug Check Integration: Validates tokens against rugcheck.xyz database
- DexScreener Integration: Fetches real-time token data including price, market cap, and liquidity
- Multi-service Architecture: Containerized microservices for scalability
- Environment Validation: Comprehensive configuration validation on startup
telegram-trading-bot/
βββ websocket_service/ # Real-time liquidity monitoring
β βββ main.py # WebSocket connection and transaction processing
β βββ Dockerfile # Container configuration
βββ ai_service/ # AI token analysis
β βββ ai_token_screener.py # Telegram bot with AI integration
β βββ gemini_prompt.txt # AI analysis prompt template
β βββ Dockerfile # Container configuration
βββ config.py # Centralized configuration management
βββ transactions.py # Transaction processing and API integrations
βββ telegram_utils.py # Telegram messaging utilities
βββ env_validator.py # Environment validation
βββ docker-compose.yml # Service orchestration
βββ requirements.txt # Python dependencies
- Python 3.9+
- Docker and Docker Compose (for containerized deployment)
- Helius RPC API access
- Telegram Bot API token
- Google Gemini AI API key
git clone <repository-url>
cd telegram-trading-botCreate a .env file in the root directory:
# Helius Configuration
HELIUS_WS_URI=wss://atlas-mainnet.helius-rpc.com/?api-key=YOUR_API_KEY
HELIUS_HTTPS_URI_TX=https://mainnet.helius-rpc.com
HELIUS_API_KEY=your_helius_api_key
# Telegram Configuration
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
TELEGRAM_CHAT_ID=your_telegram_chat_id
# AI Configuration
GENAI_API_KEY=your_gemini_api_key
# Optional: Raydium Configuration
RAYDIUM_PROGRAM_ID=675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8
WSOL_PC_MINT=So11111111111111111111111111111111111111112
# Optional: Trading Parameters
MAX_TRIES=10
DELAY=3000
GET_TIMEOUT=1000
# Optional: Rug Check Configuration
RUG_CHECK_ENABLED=True
RUG_CHECK_MAX_SCORE=0
RUG_CHECK_MAX_CREATED_AT=60
# Optional: DexScreener Configuration
CHAIN_ID=solana
DEX_PAIR_FILTER=raydium
DEXSCREENER_FETCH_MAX_TRIES=10
DEXSCREENER_FETCH_RETRY_DELAY=5# Build and start all services
docker-compose up --build
# Run in background
docker-compose up -d --build# Install dependencies
pip install -r requirements.txt
# Run WebSocket service
python websocket_service/main.py
# Run AI service (in separate terminal)
python ai_service/ai_token_screener.pyThe WebSocket service runs automatically and:
- Monitors Raydium for new liquidity pool creations
- Performs rug checks on detected tokens
- Fetches token data from DexScreener
- Sends formatted notifications to Telegram
Interact with the AI bot via Telegram:
/start- Initialize the bot/analyze <token_address>- Get comprehensive AI analysis/help- Show available commands
Example:
/analyze EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
- Detection: WebSocket monitors Raydium program logs
- Validation: Extracts transaction details and validates token mints
- Screening: Performs rug check validation
- Analysis: Fetches comprehensive token data from DexScreener
- Notification: Sends formatted alerts to Telegram with trading links
- Request: User sends
/analyze <token_address>to Telegram bot - Screening: Bot performs rug check and data validation
- AI Analysis: Google Gemini AI evaluates token data
- Response: Bot sends detailed analysis with recommendations
- Risk Assessment: Rug pull detection and security analysis
- Market Data: Real-time price, market cap, and liquidity information
- Social Metrics: Social media presence and community analysis
- Trading Intelligence: AI-generated trading recommendations and leverage advice
- Pump.fun Detection: Identifies tokens launched on Pump.fun
- Time Analysis: Token creation timing and pair availability
- Transaction Fetching: Configurable retry attempts and delays
- Rug Check: Comprehensive validation rules and thresholds
- DexScreener: API integration with filtering options
- AI Analysis: Customizable prompt templates and model parameters
- Environment Validation: Ensures all required configuration is present
- Error Handling: Comprehensive exception handling and retry logic
- Rate Limiting: Built-in delays to prevent API abuse
Monitor service health:
# View service logs
docker-compose logs -f websocket
docker-compose logs -f analyzer
# Check service status
docker-compose ps- KOL CA Shilling Monitor: Real-time monitoring of Key Opinion Leaders (KOLs) and influencers on X (Twitter) for token contract address (CA) mentions and shilling activities
- Social Media Sniping: Automated token discovery and analysis based on KOL tweets, crypto influencer posts, and trending token mentions on X
- Sentiment Analysis: Advanced social sentiment tracking from multiple platforms to gauge token popularity and potential price movements
- Smart Contract Integration: Direct integration with Solana wallets for automated token purchases based on AI analysis scores
- Portfolio Management: Track and manage token positions with profit/loss monitoring
- Advanced Filtering: Machine learning-based filtering to identify high-potential tokens before they trend
- X API Integration: Real-time tweet monitoring and analysis
- Multi-chain Support: Expand beyond Solana to Ethereum, BSC, and other chains
- Enhanced AI Models: Integration with multiple AI providers for comprehensive analysis
- Mobile App: Native mobile application for iOS and Android
- Web Dashboard: Real-time web interface for monitoring and management
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and test thoroughly
- Commit your changes:
git commit -am 'Add feature' - Push to the branch:
git push origin feature-name - Submit a pull request
This software is for educational and informational purposes only. Trading cryptocurrencies involves substantial risk and may result in significant financial losses. Users should conduct their own research and consult with financial advisors before making investment decisions.
This project is licensed under the MIT License - see the LICENSE file for details.