Context
For a bot running headless on a VPS, push notifications are how you know it's alive. Telegram is free, supports markdown, mobile, web, and desktop clients — and the Bot API is dead-simple HTTP.
Scope
charon-telemetry/src/alerts.rs with a TelegramNotifier
- Config:
bot_token, chat_id (via env vars, not in TOML)
- Events:
- Profit alert — every successful liquidation (amount + tx hash link)
- Error notification — panics, RPC disconnects, > N consecutive tx failures
- Daily summary — once per UTC day: total profit, liquidation count, uptime %
- Rate-limiting (max 20 msgs / minute to avoid Telegram throttling)
- Graceful fallback: if Telegram API is down, log locally and keep running
Acceptance criteria
References
Context
For a bot running headless on a VPS, push notifications are how you know it's alive. Telegram is free, supports markdown, mobile, web, and desktop clients — and the Bot API is dead-simple HTTP.
Scope
charon-telemetry/src/alerts.rswith aTelegramNotifierbot_token,chat_id(via env vars, not in TOML)Acceptance criteria
TELEGRAM_*env vars disables the notifier without crashingReferences