fix: add keeper wallet SOL balance monitoring (C4)#82
fix: add keeper wallet SOL balance monitoring (C4)#820x-SquidSol wants to merge 1 commit intodcccrypto:mainfrom
Conversation
The keeper wallet pays transaction fees for all cranks, liquidations, oracle pushes, and ADL operations. Previously, when the wallet ran out of SOL, all transactions silently failed with no alert, no log, and no health degradation. Add SOL balance monitoring: - Log wallet address at startup - Check balance at startup and every 60s (piggybacks on stale oracle interval) - Warn at 0.05 SOL, critical alert at 0.01 SOL via Discord - Rate-limit alerts to once per 5 minutes - Expose wallet balance in /health endpoint response - Degrade health status to "down" when balance is critical - Include balance in startup Discord notification - All balance checks are non-fatal (try/catch, never crashes keeper) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 16 minutes and 14 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
connection.getBalance()"down"when balance is critical (can't send txs)walletsection in/healthresponse with address, balance, and statusWhat's added
sendWarningAlertto DiscordsendCriticalAlertto Discordwallet.address,wallet.balanceLamports,wallet.balanceSol,wallet.balanceStatus"down"(HTTP 503)Test plan
index.ts(pre-existing SDK type errors unrelated)checkWalletBalancetested implicitly via startup flow🤖 Generated with Claude Code