MonatTGbot is a Telegram bot and backend service for monitoring Monad validators, delegators, and RPC endpoints.
It is designed to help operators and community users track:
- validator status and validator set membership;
- delegation and staking changes;
- claimable rewards and withdrawal requests;
- RPC availability, lag, and client version drift.
- Telegram bot for creating and managing watches
- FastAPI backend for watch and alert rule APIs
- PostgreSQL persistence with Alembic migrations
- background worker for recurring checks and notifications
- RPC monitoring with lag detection against a reference RPC
- staking monitoring for validators and delegators
- configurable alert rules with cooldowns, thresholds, and quiet hours
- Docker Compose setup for local and VPS deployment
- Validator by
validatorId - Delegator by
0x...address - RPC endpoint by URL
- Validator link containing a validator id
- RPC offline / recovered
- RPC lag started / resolved
- RPC version mismatch
- validator entered / left execution set
- validator entered / left consensus set
- validator entered / left snapshot set
- validator total stake increase / drop
- validator unclaimed rewards changed
- delegation created / increased / decreased / removed
- claimable rewards changed
- withdrawal detected / changed
docs/telegram-bot-spec.md- product specificationdocs/technical-architecture.md- technical architecturedocs/project-status.md- current implementation and deployment statusdocs/deploy-ubuntu.md- Ubuntu/VPS deployment guideapp/- application codealembic/- database migrationssql/- SQL schema assetsscripts/- local helper scriptsdeploy/- deployment templates and server-side helper scripts
pip install -e .[dev]For local development:
Copy-Item .env.local.example .envOr use the helper:
.\scripts\bootstrap-env.ps1For VPS / production:
cp prod.env.example .envMinimum values to review:
TELEGRAM_BOT_TOKENDATABASE_URLREDIS_URLREFERENCE_RPC_URL
alembic upgrade headAPI:
uvicorn app.main:app --reloadBot:
python -m app.bot.runWorker:
python -m app.workers.runscripts/bootstrap-env.ps1- create.envfrom a templatescripts/preflight.ps1- run environment checksscripts/run-api.ps1- start the APIscripts/run-bot.ps1- start the Telegram botscripts/run-worker.ps1- start the workerscripts/deploy-vps.ps1- print VPS deployment commands
Recommended local order:
.\scripts\bootstrap-env.ps1
.\scripts\preflight.ps1
.\scripts\run-api.ps1
.\scripts\run-worker.ps1
.\scripts\run-bot.ps1Local / generic Compose:
docker compose up --buildProduction Compose:
docker compose -f docker-compose.prod.yml up -d --buildWith bundled PostgreSQL and Redis:
docker compose -f docker-compose.prod.yml --profile with-db --profile with-redis up -d --builddocker-compose.prod.ymldeploy/systemd/monat-api.servicedeploy/systemd/monat-bot.servicedeploy/systemd/monat-worker.servicedeploy/nginx/monat-api.confdocs/deploy-ubuntu.md
Server-side helper scripts:
deploy/scripts/bootstrap-server.shdeploy/scripts/migrate.shdeploy/scripts/install-systemd.shdeploy/scripts/install-nginx.shdeploy/scripts/restart-services.shdeploy/scripts/smoke-test.sh
Watches:
GET /v1/watchesPOST /v1/watchesGET /v1/watches/{entity_id}GET /v1/watches/{entity_id}/statusPOST /v1/watches/{entity_id}/refreshPOST /v1/watches/{entity_id}/check-rpc
Resolver:
POST /v1/watches/resolve
Alert rules:
GET /v1/alert-rules/entity/{entity_id}PATCH /v1/alert-rules/{rule_id}
Health:
GET /health
/start/help/add/list/status/check/alerts/alertset/alerton/alertoff
DEFAULT_NETWORKcontrols the default network used by the bot when creating watches from Telegram.REFERENCE_RPC_URLis required for meaningful lag monitoring.TELEGRAM_BOT_TOKEN=replace-mecan be used temporarily to disable Telegram delivery in local development.
- explicit per-user network selection in Telegram
- richer onboarding and localization
- more polished watch summaries and alert copy
- more efficient staking pagination and withdrawal scanning
- stronger production-grade delivery and suppression logic