An enterprise-grade Telegram bot built with Python and aiogram. It continuously monitors global financial markets, providing precise 24-hour updates on cryptocurrencies, precious metals, forex, and major tech equities, all delivered seamlessly through an automated async loop.
- Comprehensive Market Coverage: Tracks Crypto (BTC, ETH, SOL, XRP), Forex cross-rates, Commodities (Gold, Silver, Crude Oil), and Major Equities (S&P 500, NVDA, TSLA, etc.).
- Cloud-Deployment Ready: Features an integrated
aiohttpweb server that acts as a health-check endpoint, preventing the bot from sleeping when deployed on cloud platforms like Railway or Koyeb. - Asynchronous Architecture: Built from the ground up using
aiogramandasynciofor non-blocking execution, ensuring optimal performance and zero lag during data fetching. - Smart Analytics: Automatically calculates and formats 24-hour percentage changes with dynamic precision depending on the asset class (e.g., 4 decimals for Forex, 2 for Equities).
| Component | Technology |
|---|---|
| Framework | Python 3, aiogram (v3) |
| Financial Data | yfinance |
| Web Server & Async | aiohttp, asyncio |
| Data Processing | pandas, pytz |
| Environment Security | python-dotenv |
Experience the bot in action! It automatically pushes market updates every 2 hours to our public channel: Join Global Market Rates on Telegram
🌍 Global Market Watch
📅 30 Apr - 18:09 UTC
━━━━━━━━━━━━━━━━
💎 Crypto Assets (24h)
BTC: $76,266.32 (🟢 +1.04%)
ETH: $2,256.56 (🟢 +0.81%)
SOL: $83.12 (🟢 +1.05%)
XRP: $1.3680 (🟢 +0.81%)
🪙 Precious Metals
🌕 Gold (Oz): $4,629.60 (🟢 +1.69%)
└ Gram: $148.84
⚪ Silver (Oz): $74.14 (🟢 +3.04%)
└ Gram: $2.38 🆕
🛢️ Crude Oil: $103.72 (🔴 -2.88%)
🏢 Tech Giants & Indices
S&P 500: 7,224.50 (🟢 +0.92%)
NVDA: $200.70 (🔴 -3.53%)
TSLA: $380.73 (🟢 +2.51%)
AAPL: $274.13 (🟢 +1.63%)
MSFT: $404.14 (🔴 -4.61%)
GOOG: $380.48 (🟢 +9.58%)
AMZN: $261.65 (🔴 -0.68%)
META: $615.97 (🔴 -8.15%)
💱 Forex Markets
🇪🇺 EUR/USD: $1.1730 (🟢 +0.46%)
🇬🇧 GBP/USD: $1.3585 (🟢 +0.84%)
🇯🇵 USD/JPY: ¥156.44 (🔴 -2.44%)
🇨🇳 USD/CNY: ¥6.8273 (🔴 -0.15%)
🇷🇺 USD/RUB: ₽74.8850 (🔴 -0.21%)
━━━━━━━━━━━━━━━━
#Finance #Trading #Stocks #NVDA #TSLA #Bitcoin #Gold #Silver #Forex #Economy #Investing #RUB #CNY #SP500 #CryptoNews
━━━━━━━━━━━━━━━━
⚡ @your_channel_username
-
Clone the repository:
git clone [https://github.com/Mahmoud-Elmalky/Global-Market-Rates-Bot.git](https://github.com/Mahmoud-Elmalky/Global-Market-Rates-Bot.git) cd Global-Market-Rates-Bot -
Create a virtual environment:
python -m venv venv # Windows: venv\Scripts\activate # Linux/Mac: source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Configure Environment Variables:
Create a
.envfile in the root directory based on the provided.env.examplefile:BOT_TOKEN=your_telegram_bot_token_here CHANNEL_ID=@GlobalMarketRates PORT=8080 -
Launch the Bot:
python GlobalMarketRatesBot.py