A Rust-based service that monitors Bybit cryptocurrency trading accounts and sends periodic status updates via Telegram. Built with async Rust and supports multiple trading accounts.
- 🔄 Real-time monitoring of Bybit trading accounts
- 💰 Track account balance and positions
- 📊 Monitor PnL (Profit and Loss)
- Last 100 trades PnL tracking
- Current unrealized PnL monitoring
- 📱 Telegram notifications
- HTML formatted messages
- Secure bot integration
- Group chat support
- ⚡ High Performance
- Async operations with Tokio
- Efficient scheduler implementation
- Configurable update intervals
- 🔐 Security Features
- HMAC SHA256 API authentication
- Non-root Docker container
- Environment-based configuration
- 🐳 Deployment Ready
- Multi-stage Docker builds
- SSL/TLS support included
- Volume mounting for configuration
- Rust 1.76 or higher
- Docker (optional)
- Bybit API credentials
- API Key
- API Secret
- Account Type (UNIFIED/CONTRACT)
- Telegram Bot
- Bot Token
- Group ID
Create a .env
file in the project root:
- Clone the repository:
git clone <repository-url>
cd crypto_notification_service
- Create a
.env
file in the project root with the following variables:
BYBIT_API_KEY=your_api_key
BYBIT_API_SECRET=your_api_secret
ACCOUNT_TYPE=UNIFIED # or CONTRACT
TELEGRAM_BOT_TOKEN=your_bot_token
TELEGRAM_GROUP_ID=your_group_id
CHECK_INTERVAL=3600 # Update interval in seconds
- Build and run the project:
cargo build --release
cargo run --release
- Build the Docker image:
docker build -t crypto-notification-service .
- Run the Docker container:
docker run -d \
--name crypto-notification \
-v $(pwd)/.env:/app/.env \
crypto-notification-service
Once running, the service will:
- Start monitoring your Bybit account
- Send periodic updates to your Telegram group
- Log operational status to the console
You can verify operation by checking:
- Docker logs:
docker logs crypto-notification
- Telegram messages in your configured group
- Console output in local development mode
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b feature-name
- Make your changes and submit a pull request
git commit -m "Add some feature"
- Push to your fork:
git push origin feature-name
- Follow Rust coding conventions and style guidelines
- Add tests for new functionality
- Update documentation for significant changes
- Use descriptive commit messages
- Keep pull requests focused on a single feature
Before submitting a PR, ensure your code follows the project's style:
cargo fmt
cargo clippy
MIT License - See LICENSE file for details