A Telegram bot that monitors Bitcoin (BTC) price changes on Bitstamp exchange and provides notifications for significant price movements.
- Real-time BTC price monitoring
- Price change notifications for different time periods:
- Hourly (≥3% change)
- Daily (≥5% change)
- Weekly (≥10% change)
- Trading functionality through Bitstamp API
- User management and authentication
- Configurable notification thresholds
- Go 1.16 or higher
- Telegram Bot Token (from @BotFather)
- Bitstamp API credentials
- Clone the repository:
git clone https://github.com/yourusername/bits.git
cd bits- Install dependencies:
go mod download-
Configure the bot:
- Copy
config.example.jsontoconfig.json - Add your Telegram bot token
- Add your Bitstamp API credentials
- Copy
-
Build the bot:
go build -o bitsThe bot uses the following configuration files:
config.json: Main configuration filetelegram_token: Your Telegram bot tokenbitstamp_key: Bitstamp API keybitstamp_secret: Bitstamp API secretbitstamp_uid: Bitstamp user ID
Start the bot:
./bits/start- Start receiving price notifications/stop- Stop receiving notifications/register- Register your Bitstamp API credentials/balance- Check your BTC and USD balance/buy- Buy BTC with available USD/sell- Sell all available BTC/open- Show open orders/cancel- Cancel all orders/help- Show this help message
bits/
├── cmd/
│ └── bits/
│ └── main.go
├── internal/
│ ├── bot/ # Telegram bot implementation
│ ├── config/ # Configuration management
│ ├── exchange/ # Bitstamp API integration
│ ├── notifier/ # Price change notification logic
│ └── storage/ # Data persistence
├── pkg/ # Public packages
├── config.json # Configuration file
└── README.md
The bot implements comprehensive error handling:
- API call failures are logged and retried
- Invalid user input is handled gracefully
- Configuration errors are caught at startup
- Network issues are handled with retries
This bot is provided as-is. Use at your own risk. The developers are not responsible for any financial losses incurred while using this bot.