A Python-based Telegram bot that listens for token launch/list announcements, executes market buys on Bybit, and places dynamic take-profit or market-sell orders based on configurable market-cap thresholds.
-
Telegram Monitoring: Listens in specified Telegram channels for keywords:
futures will launchwill list
-
Automated Buys: Splits a fixed USDT amount across detected tokens and places market-buy orders.
-
Dynamic Take-Profit: Calculates take-profit levels using live k-line data and adjusts multipliers based on real-time market capitalization.
-
Cooldown Mechanism: Prevents repeated buys of the same token within a configurable interval.
-
Dual Market-Cap Sources: Queries CoinMarketCap first, falls back to CoinGecko if needed.
-
Robust Logging & Error Handling
- Python 3.10 or newer
- Bybit API key & secret (unified trading enabled)
- Telegram API ID & hash (my.telegram.org)
- (Optional) CoinMarketCap API key
-
Clone the repository
git clone https://github.com/<your-username>/telegram-bybit-autotrader.git cd telegram-bybit-autotrader
-
Create a virtual environment
python3 -m venv venv source venv/bin/activate -
Install dependencies
pip install -r requirements.txt
-
Configure environment variables
-
Copy the example file:
cp config.env.example config.env
-
Open
config.envand set your credentials.
-
Edit config.env with the following values:
# Telegram
TG_API_ID=<YOUR_TELEGRAM_API_ID>
TG_API_HASH=<YOUR_TELEGRAM_API_HASH>
TG_PHONE=<YOUR_TELEGRAM_PHONE_NUMBER>
# Bybit
BYBIT_API_KEY=<YOUR_BYBIT_API_KEY>
BYBIT_API_SECRET=<YOUR_BYBIT_API_SECRET>
# CoinMarketCap (optional)
CMC_API_KEY=<YOUR_CMC_API_KEY>Adjust constants at the top of bot.py as needed:
INITIAL_TARGET_USDT: Total USDT per announcementTAKE_PROFIT_MULTIPLIER_FUTURES/SPOT- Market-cap thresholds and adjustment multipliers
COOLDOWN_PERIOD_SECONDSCHANNELSlist
Run the bot:
python bot.pyThe bot will:
- Connect to Telegram and Bybit.
- Monitor specified channels for announcements.
- Execute market buys and schedule post-buy take-profit/market-sell orders.
├── bot.py # Main script
├── config.env.example # Env var template
├── requirements.txt # Dependencies
├── README.md # This file
└── session_name/ # Telethon session data
- Fork the repo
- Create a feature branch (
git checkout -b feature/YourFeature) - Commit your changes (
git commit -m "Add YourFeature") - Push (
git push origin feature/YourFeature) - Open a Pull Request
This project is licensed under the MIT License. See the LICENSE file for details.