Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

📊 Bybit Price Alert Bot

A Telegram bot that monitors live Bybit spot prices and notifies you the moment a target price is hit. Built with Python, aiogram v3, and async architecture.


Features

  • Set price alerts for any USDT pair listed on Bybit
  • Get notified instantly when price goes above or below your target
  • View all your currently active alerts
  • Concurrent price monitoring loop running every 30 seconds
  • FSM-driven conversation flow for a clean, guided user experience

How It Works

  1. Send /start to the bot
  2. Tap Set Alert → enter coin name (e.g. BTC) → enter target price → choose Above or Below
  3. The bot monitors Bybit prices every 30 seconds in the background
  4. When your target is hit, you receive an instant Telegram notification and the alert is cleared

Project Structure

.
├── bot.py                   # Main entry point
├── .env                     # Environment variables (not committed)
└── Learn6_Arbi_System/
    └── learn6.py            # Bybit API client (get_bid_ask)

Key Components

Class Responsibility
Form FSM states for the 3-step alert creation flow
Task_manager Stores active alerts in memory, validates pairs
Handlers All aiogram message and callback handlers
Engine Initialises dependencies, runs the price monitor loop

Setup

Prerequisites

  • Python 3.10+
  • A Telegram bot token from @BotFather

Installation

git clone https://github.com/yourusername/bybit-price-alert-bot.git
cd bybit-price-alert-bot

pip install -r requirements.txt

Environment Variables

Create a .env file in the project root:

TG_BOT_TOKEN=your_telegram_bot_token_here

Run

python -m path.to.bot

Dependencies

aiogram>=3.0
python-dotenv
aiohttp

Usage Example

User:  /start
Bot:   Welcome To my Bot  [Set Alert] [My Alerts]

User:  Set Alert
Bot:   Name of the coin please

User:  BTC
Bot:   What price?

User:  70000
Bot:   Get notified when price is above or below?  [Above] [Below]

User:  (taps Above)
Bot:   Alert successfully set. You will get a notification immediately it is reached.

---  30 seconds later, BTC hits $70,001  ---

Bot:   Price 70000.0 for BTCUSDT reached. Current price: 70001.5

Known Limitations

  • No persistence — alerts are stored in memory. A bot restart clears all active alerts.
  • No /cancel command — if you start setting an alert and want to abort, you currently need to complete the flow or restart with /start.
  • Pairs list is loaded once at startup. Newly listed Bybit pairs won't be recognised until restart.

Roadmap

  • SQLite or Redis persistence for alerts across restarts
  • /cancel command to exit mid-flow
  • /delete command to remove a specific alert by index
  • Periodic refresh of available trading pairs
  • Support for non-USDT pairs

Author

Built by RedoxHussein Ridwan Ademola Digital Services


License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages