A Solana-based auto-buy trading bot that listens to private Telegram signals. Built using Python, Telethon, and Solana-Py, this bot extracts contract addresses from Telegram messages and prepares the wallet for automated token buys with adjustable slippage and amount settings.
Solana Telegram AutoBuy Bot
A Python bot that listens to private Telegram channels for trading signals (Solana contract addresses) and automatically executes buy transactions on the Solana blockchain via Jupiter aggregator.
Features
- Listens to Telegram channels/groups via Telethon
- Detects Solana contract addresses from messages
- Auto-buys using Jupiter swap API
- Configurable buy amount per signal
- Deduplication โ skips already-bought contracts in the session
- Logs all signals and transaction signatures
Setup
pip install telethon solana requests python-dotenv
Create a .env file:
TELEGRAMAPIID=yourapiid
TELEGRAMAPIHASH=yourapihash
TELEGRAM_PHONE=+1234567890
TARGETCHANNELS=channelusername1,channel_username2
WALLETPRIVATEKEY=yourbase58private_key
BUYAMOUNTSOL=0.1
SLIPPAGE_BPS=100
Usage
python main.py
The bot connects to Telegram, monitors the configured channels, and executes a swap whenever a valid Solana token address is detected.
Files
| File | Purpose | |-----------|-------------------------------------| | main.py | Entry point โ connects and listens | | bot.py | Core signal detection and buy logic | | test.py | Integration tests |
Warning
Use a dedicated wallet with only the funds you intend to trade. Never use your main wallet private key.
License
MIT