Skip to content

Relax DEV balance thresholds to silence cron alerts#190

Merged
TaprootFreak merged 3 commits into
developfrom
feat/relax-dev-balance-thresholds
May 16, 2026
Merged

Relax DEV balance thresholds to silence cron alerts#190
TaprootFreak merged 3 commits into
developfrom
feat/relax-dev-balance-thresholds

Conversation

@TaprootFreak
Copy link
Copy Markdown
Contributor

Summary

  • Replaces Scope balance alerts to PRD only #189. Keeps BalanceAlertService fully wired on DEV (cron tick, RPC balance fetch, Telegram pipeline all still exercised) but with permissive thresholds so no LOW/HIGH alert ever fires.
  • DEV gets the same asset/chain list as PRD, derived from PRD_BALANCE_THRESHOLDS with minBalance: 0 and maxBalance: Number.POSITIVE_INFINITY. Adding a new asset to PRD automatically picks it up on DEV with no-op bounds.
  • PRD list unchanged byte-for-byte.

Why this instead of an empty array

DEV is the integration-test environment for the alerting code path itself — Boltz/RPC reads, Telegram send. An empty list would skip the entire checkAndAlert loop and hide regressions in the surrounding code.

Test plan

  • npm run lint clean
  • npm run build clean
  • After deploy to dfxdev: 5-min cron logs show balance fetch succeeded, zero Sent ... alert lines, no Telegram messages to @lds_balance_alerts_dev_bot
  • PRD (post merge develop → main): alerts continue to fire on threshold violations

DEV wallets carry test funds (sub-dollar amounts), so the PRD thresholds
(1000 USDT, 0.1 cBTC, 1 BTC Lightning capacity) fire LOW alerts on every
5-min tick. Keep the same asset list on DEV but with min=0 / max=Infinity
so balance < min and balance > max are never satisfied — the cron, RPC
balance fetch and Telegram pipeline stay exercised on DEV with no noise.
PRD list is unchanged.
Address review: requirement was to lower DEV min thresholds, not to
also disable HIGH alerts. minBalance=0 silences LOW alerts (balance < 0
is never satisfied for non-negative wallet balances) while leaving the
maxBalance bounds as-is so HIGH alerts still fire if a DEV wallet ever
overshoots the PRD-shaped ceiling.
@TaprootFreak TaprootFreak marked this pull request as ready for review May 16, 2026 13:15
@TaprootFreak TaprootFreak merged commit 56072e5 into develop May 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant