An automated solution for Kora Node Operators to monitor sponsored accounts and reclaim locked rent-exempt SOL.
Kora is a fee abstraction layer on Solana that allows applications to sponsor transactions. A common use case for Kora is sponsoring account creation (e.g., Associated Token Accounts for new users).
On Solana, every account must maintain a minimum balance to be "rent-exempt" (currently ~0.002 SOL for a standard Token Account). When a Kora node sponsors account creation, this SOL is provided by the operator.
Over time:
- Users abandon accounts (e.g., they empty their balance).
- The account remains on-chain, locking 0.002 SOL.
- Operators experience "silent capital loss" as thousands of these accounts accumulate.
This bot solves that by identifying these accounts and reclaiming the SOL once they are no longer needed.
- Automated Scanning: Historically scans the operator's transaction history to find accounts they funded.
- Smart Filtering: Detects which accounts are truly "sponsored" vs. just processed.
- Eligibility Detection: Checks if accounts have zero balance and are safe to close.
- Automated Reclamation: Closes eligible accounts and returns the SOL to the operator's treasury.
- Reporting Dashboard: Provides a clear summary of total rent locked, potential savings, and reclaimed funds.
The bot uses the getSignaturesForAddress RPC method on the Kora Operator's public key. It parses each transaction to find:
SystemProgram.CreateAccountinstructions where the operator is the funder.AssociatedTokenAccount.Createinstructions where the operator is the payer.
Discovered accounts are periodically checked for status.
- Active: Account has tokens or data.
- Empty: Account has 0 balance and is eligible for closure.
- Reclaimed: Account has already been closed.
The bot issues a closeAccount instruction. For maximum safety and effectiveness, it is recommended that the Kora node is configured to set the Operator address as the closeAuthority during account creation sponsorship.
- Node.js & NPM
- A Solana Keypair for your Kora Operator
npm installCreate a .env file:
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
KORA_OPERATOR_KEYPAIR_PATH=./operator-keypair.json
TREASURY_ADDRESS=YourTreasuryAddressHerenpx ts-node src/bot.ts- Whitelists: You can extend the logic in
scanner.tsto avoid reclaiming certain active accounts. - Simulation: Reclaim transactions are sent with
confirmedcommitment for reliability. - Transparency: Every action is logged with the transaction signature for audit trails.
- Cold Wallet Treasury: Set your
TREASURY_ADDRESSto a cold wallet. The bot only needs the operator's private key for signing, but recovered SOL should go somewhere safer. - Close Authority: For best results, ensure your Kora Node configuration sets the operator's public key as the
closeAuthorityduring account creation instructions.
- Permission Denied: If the bot fails to close an account, verify that the operator keypair is the designated
closeAuthorityfor that account. - Rate Limits: If scanning many transactions, use a private RPC provider (e.g., Helius, QuickNode) to avoid being throttled by public endpoints.
Open Source (MIT)