fix(wallet-monitor): post only on state changes, drop reminder re-alerts

Slack posts now fire only when a wallet newly drops below its threshold
or recovers above it; a wallet that stays low never re-posts. The
reminder_hours mechanism is removed entirely — per-wallet reminder
clocks drifted apart (Ogmios blips skip wallets from a run), so with
many chronically-low wallets some clock came due nearly every run,
collapsing the 6h cadence to the hourly cron interval.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
david
2026-07-28 11:12:29 +02:00
parent 0b253c73bb
commit b10706cf69
5 changed files with 28 additions and 45 deletions

View File

@@ -2,12 +2,12 @@
One-shot wallet-balance Slack alerter for the `vector-marketplace` mainnet box.
Checks every wallet in `wallets.json` against a threshold (default **10 APEX**),
posts a combined Slack message when any wallet is below it, re-reminds every
`reminder_hours` while a wallet stays low, and posts a recovery message when it
climbs back above. Each alert lists **every** monitored wallet — low (🔴) and
healthy (🟢) — with its full, copy-pasteable address; it stays fully silent
when all wallets are healthy. Balances are read from Ogmios via
Checks every wallet in `wallets.json` against a threshold (default **10 APEX**)
and posts a combined Slack message only when something **changed** since the
last run — a wallet newly dropped below its threshold, or climbed back above
it. A wallet that merely stays low never re-posts. Each alert lists **every**
monitored wallet — low (🔴) and healthy (🟢) — with its full, copy-pasteable
address; it stays fully silent while nothing changes. Balances are read from Ogmios via
`ReadOnlyOgmiosProvider` (`@marketplace/shared/chain`) — the same client behind
the buyer's `/v1/wallet/balance` and `buyer/scripts/monitor-wallets.ts`.