-
https://t.me/ILIVIR3 our channel
AI-Powered Cryptocurrency Market Intelligence System Serverless β’ Multi-Model AI β’ Real-Time Telegram Automation
TradeAgent IV HYBRID is an advanced, serverless cryptocurrency intelligence system built on Cloudflare Workers. It automates Telegram channel posting with real-time market analysis, powered by a proprietary Emotion Engine that gauges market psychology.
The system operates on a 100% free AI tier architecture, using multi-tier API failovers to guarantee maximum uptime with zero infrastructure cost.
- Multi-Model Failover: Cascades through Gemini 3.5 Flash β 3.1 Flash-Lite β 2.5 Flash β OpenRouter FREE models automatically.
- Bilingual Output: Full English analysis followed by a dense Persian (Farsi) summary.
- Custom Prompts: Admins can inject custom focus areas into the AI analysis.
- Tier 1 (Blue Chips): BTC, ETH, SOL, XRP, BNB, XAUT
- Tier 2 (Utility & L2s): ADA, LINK, AVAX, SUI, HBAR, POL, INJ, ARB, OP, ATOM, TON, DOT, LTC, NEAR, APT, UNI, TRX, HYPE
- Tier 3 (Meme & AI): SHIB, DOGE, PEPE, WIF, BONK, TAO, FET, RENDER
Calculates real-time market psychology using BTC/ETH price action, Fear & Greed Index, and BTC Dominance.
Emotion States:
- π PANIC β Extreme market crash detected
- π° FEAR β Conservative accumulation opportunities
- π NEUTRAL β Sideways market, balanced analysis
- π₯ MOMENTUM β Upside building, optimistic tone
- π BREAKOUT β Confirmed breakout, pullback warnings
- 𧨠FOMO β Extreme greed, risk emphasis
- Multi-API Failover: CoinGecko β CoinMarketCap β Binance
- Smart Deduplication (v3): 10-min gap + 5-min lock + race-proof
- Circuit Breakers: Auto-trips failing AI models to prevent quota exhaustion
- Serverless: Runs entirely on Cloudflare Workers with KV storage
- Runtime: Cloudflare Workers (JavaScript ES Modules)
- Storage: Cloudflare KV (Snapshots, Dedup locks, AI Cache, User States)
- Data Providers: CoinGecko, CoinMarketCap, Binance, Alternative.me
- AI Providers: Google Gemini, OpenRouter
- Messaging: Telegram Bot API (HTML Parse Mode, Inline Keyboards, Webhooks)
TELEGRAM_BOT_TOKENβ Your Telegram Bot API tokenTELEGRAM_CHANNEL_IDβ Target Telegram channel ID (e.g.,@mychannelor-100...)ADMIN_IDβ Your Telegram User ID (admin panel access)ADMIN_SECRETβ Secure string for/adminHTTP authenticationCOINGECKO_API_KEYβ CoinGecko Demo/Pro API keyCMC_API_KEYβ CoinMarketCap Pro API keyGEMINI_API_KEYβ Google AI Studio API keyOPENROUTER_API_KEYβ OpenRouter API key for fallback models
ALERTS_KVβ Cloudflare KV Namespace for caching, deduplication, and state storage
/startβ Open the main interactive menu/priceβ Live 3-Tier market snapshot/volumeβ Top 10 coins by 24h trading volume/dailyβ Comprehensive daily market report/trendingβ Currently trending coins/fngβ Fear & Greed Index with visual bar/alertsβ Configure custom price alerts/settingsβ View bot configuration and API status/helpβ List all available commands
/adminβ Open the interactive Admin Control Panel/sendpriceβ Manually push price snapshot to channel/sendaiβ Generate and push new AI analysis/sendallβ Push full bundle (Sticker + AI + F&G + Futures)/sendmoversβ Push top gainers and losers/sendfuturesβ Push funding rates and open interest/senddailyβ Push daily market report/sendvolumeβ Push volume leaders/sendtrendingβ Push trending coins/sendfngβ Push Fear & Greed index/aipromptβ Inject custom prompt for next AI analysis
The system uses Cloudflare Cron Triggers for fully autonomous operation:
Every 30 Minutes (*/30 * * * *)
- Fetches prices
- Checks custom user alerts
- Posts Market Snapshot
Every 8 Hours (0 */8 * * *)
- Posts the "Bundle"
- Starts with custom Sticker
- Followed by AI Analysis, Fear & Greed, and Futures Funding Rates
3 Times Daily (0 9,15,21 * * *)
- Posts Top Movers (Gainers & Losers)
- Based on Binance 24h ticker data
npm install -g wranglerwrangler loginwrangler kv:namespace create ALERTS_KVAdd the output to your wrangler.toml:
[[kv_namespaces]]
binding = "ALERTS_KV"
id = "your-namespace-id"wrangler deploycurl -F "url=https://your-worker.subdomain.workers.dev/webhook" https://api.telegram.org/bot<YOUR_BOT_TOKEN>/setWebhookReceives Telegram updates. No authentication required (secured by Telegram's secret token mechanism).
Manual trigger endpoint. Requires x-admin-secret header.
Example:
curl -X POST \
-H "x-admin-secret: YOUR_SECRET" \
"https://your-worker.workers.dev/admin?type=ai"Available types: price, volume, daily, ai, trending, fng, futures, movers, all, alert, sticker
System health check and API diagnostics. Requires x-admin-secret header.
Example:
curl -H "x-admin-secret: YOUR_SECRET" https://your-worker.workers.dev/debug- Normal β Standard professional analysis
- Deep β Institutional-grade analysis with trend structure and sector rotation
- Short β Only trend direction, risk level, and 1 actionable insight
- Emotion β Analysis matches current market emotion state
- Bullish β Emphasize breakout potential and altseason signals
- Bearish β Emphasize capital flight to safety and support levels
- Neutral β Balanced view, no directional bias
- Volatile β High volatility expected, emphasize risk management
- Full market data
- 7d/30d price changes
- Trending coins
- Categories
- Latest quotes
- Global metrics
- Trending coins
- 24h ticker data
- Top gainers/losers
- Futures data (funding rates, open interest, long/short ratio)
- Fear & Greed Index
- Modern HTML Formatting: Clean Telegram HTML with blockquotes
- Visual Progress Bars: For Fear & Greed index
- Color-Coded Changes: π’ Green for gains, π΄ Red for losses
- Tiered Display: Organized coin listings by market cap tier
- Sticker Integration: Auto-sends custom sticker before bundle posts
- Inline Keyboards: Interactive admin control panel
- Admin Authentication: Secret header for HTTP endpoints
- User ID Verification: Admin-only commands protected
- Rate Limiting: Circuit breakers prevent API quota exhaustion
- Input Sanitization: HTML escaping for user-generated content
- Deduplication: Prevents spam and race conditions
- Timeout Protection: All fetches capped at 15-25 seconds
- Parallel Requests: Uses
Promise.all()for concurrent API calls - Caching: AI responses cached for 1 hour
- Sticker Caching: File IDs cached for 30 days
- Smart Retry Logic: Exponential backoff for failed requests
- Check Gemini API key is valid and has quota
- Verify OpenRouter API key if using fallback models
- Check
/debugendpoint for detailed error messages
- Ensure bot is admin in the channel with "Post Messages" permission
- Verify
TELEGRAM_CHANNEL_IDis correct - Check
/debugfor channel access status
- Verify at least one API key is configured (CoinGecko, CMC, or Binance)
- Check API rate limits
- Review worker logs for specific error messages
Distributed under the MIT License. See LICENSE for more information.
- Cloudflare Workers β Serverless runtime
- Telegram Bot API β Messaging platform
- CoinGecko β Cryptocurrency data
- CoinMarketCap β Market data
- Binance β Exchange data
- Google Gemini β AI models
- OpenRouter β AI model routing
TradeAgent IV Β· AI Crypto Intelligence Β· Built for the decentralized future