Skip to content

Mahmoud-Elmalky/Global-Market-Rates-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌍 Global Market Watch Bot

High-Performance Asynchronous Financial Tracker

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.


🚀 Key Features

  • 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 aiohttp web 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 aiogram and asyncio for 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).

💻 Tech Stack

Component Technology
Framework Python 3, aiogram (v3)
Financial Data yfinance
Web Server & Async aiohttp, asyncio
Data Processing pandas, pytz
Environment Security python-dotenv

📡 Live Demo

Experience the bot in action! It automatically pushes market updates every 2 hours to our public channel: Join Global Market Rates on Telegram


📈 Example Output

 
   🌍 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

⚙️ Installation & Local Setup

  1. 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
  2. Create a virtual environment:

    python -m venv venv
    # Windows:
    venv\Scripts\activate
    # Linux/Mac:
    source venv/bin/activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Configure Environment Variables:

    Create a .env file in the root directory based on the provided .env.example file:

    BOT_TOKEN=your_telegram_bot_token_here
    CHANNEL_ID=@GlobalMarketRates
    PORT=8080
    
  5. Launch the Bot:

    python GlobalMarketRatesBot.py

About

An asynchronous Python Telegram bot using aiogram and yfinance to track global markets, crypto, and forex, featuring a built-in aiohttp web server for cloud deployment.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages