feat(jobs): daily reclaim_rent sweep for zero-balance user banks#827
Merged
Conversation
Adds a ReclaimRentJob to the solana-indexer that, every 24h, closes zero-balance claimable token accounts created in the last 7 days for AUDIO and USDC, returning the rent lamports to the signing fee payer. The 7-day lookback with a 24h cadence provides overlap to ensure no eligible accounts are missed. Reuses the existing solanaRpcProviders, solanaFeePayerKeys, and writeDbUrl configuration via cfg.SolanaConfig and database.DbPool. Skips gracefully when RPC or fee payers are not configured (dev/test). Each batch closes up to 15 accounts per transaction via the existing spl.TransactionSender. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
rickyrombo
approved these changes
May 19, 2026
Member
Author
Yea, ill make it a real cron instead |
Replaces the 24h-after-deploy ticker with a daily scheduler that fires at noon Pacific. Recomputes "next noon LA" each iteration so DST transitions don't drift the schedule. Embeds time/tzdata since the runtime image is Alpine, which doesn't ship IANA tzdata by default. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ReclaimRentJobto the solana-indexer that runs every 24h, closing zero-balance claimable token accounts created in the last 7 days for AUDIO and USDC and returning the rent to the signing fee payer.solanaRpcProviders,solanaFeePayerKeys, andwriteDbUrlconfiguration viacfg.SolanaConfig/database.DbPool.cmd/reclaim_rentlogic (DB candidate query → on-chain re-verify of zero balance → batched 15 closes per tx) but uses the existingspl.TransactionSenderfor confirmation and multi-RPC broadcast.Notes
go reclaimRentJob.Run(...)— first fire is 24h after deploy. Add it if you want it to run on every deployment.solanaRpcProvidersorsolanaFeePayerKeysare empty (dev/local).sol_token_account_balances.created_at(when the indexer first saw the account), sincesol_claimable_accountshas no created-at column. The 7d window with a 24h cadence provides 6 days of overlap so nothing is missed.Test plan
processBatch failederrors after first run🤖 Generated with Claude Code