Skip to content

TimothyBayode/kora-autoclaim-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automated rent tracking for Kora operators so they never lose $SOL to locked rent again

The Problem

When Kora operators sponsor account creation on Solana, $SOL gets locked as rent. When these accounts close, the rent should automatically return to the operator but nobody tracks this resulting to operators losing $SOL silently.

Example: You sponsor 100 accounts × 0.001 SOL rent each = 0.1 SOL locked. If 50 close, you should get back 0.05 SOL. This bot makes sure you know about it.

The Solution

A simple, automated bot that:

  • Monitors your Kora-sponsored accounts
  • Tracks when accounts close
  • Alerts you about rent returns
  • Shows how much $SOL you've recovered

Quick Start (5 Minutes)

1. Install

# Clone and setup
git clone https://github.com/TimothyBayode/kora-autoclaim-bot.git
cd kora-rent-reclaim-bot
npm install

2. Configure

# Copy the example config
cp .env.example .env

# Edit .env with your info
nano .env

Your .env should look like:

SOLANA_RPC_URL=https://api.devnet.solana.com
KORA_NODE_PUBKEY=YourKoraNodeAddressHere
OPERATOR_WALLET=YourWalletAddressHere
SCAN_INTERVAL_MINUTES=15

3. Run

# Start the bot
npm start

That's it. Your bot is now monitoring for rent returns.

Using the Bot

Once running, you'll see:

Kora Rent Reclaim Bot Started!
Kora Node: YourNodeAddress...
Scanning every 1 minute...

Commands:
  stats - Show statistics
  scan  - Manual scan now
  exit  - Stop bot

Type a command:

Basic Commands:

  • scan - Check for reclaimable accounts right now
  • stats - See how much rent you've tracked
  • exit - Stop the bot gracefully

How It Works

For Users (Simple Version)

  1. Bot runs in the background
  2. Checks your Kora-sponsored accounts
  3. Detects when accounts close
  4. Tracks the rent that gets returned
  5. Shows you the results

For Developers (Technical Version)

1. Fetch Kora-sponsored accounts
   └── From Kora API/logs (real) or mock data (demo)

2. Check each account on-chain
   ├── Account exists? → Still active, rent locked
   └── Account missing? → Closed, rent returned!

3. Track and report
   ├── Log successful rent returns
   ├── Calculate total recovered SOL
   └── Provide operator insights

Advanced Setup

Custom Configuration

Edit .env for:

  • Different RPC: Use your own Solana RPC endpoint
  • Scan frequency: SCAN_INTERVAL_MINUTES=5 for more frequent checks
  • Logging: LOG_LEVEL=debug for detailed output

Integration with Real Kora

Replace the mock Kora client in src/kora-client.ts with:

  • Real Kora API calls
  • Kora RPC integration
  • Transaction log parsing

Project Structure

kora-rent-bot/
├── src/                    # Source code
│   ├── index.ts           # Main bot & CLI
│   ├── rent-checker.ts    # Core rent detection logic
│   ├── kora-client.ts     # Kora integration (mock/real)
│   └── config-manager.ts  # Handles settings
├── scripts/               # Utilities
│   ├── create-test-accounts.ts
│   └── monitor-accounts.ts
├── data/                  # Storage (auto-created)
├── logs/                  # Logs (auto-created)
└── .env                   # Your configuration

Safety & Security

What This Bot DOES:

  • Reads public blockchain data
  • Tracks account status
  • Logs rent return events
  • Provides statistics

What This Bot DOES NOT:

  • Never asks for private keys
  • Never sends transactions
  • Never moves your funds
  • Never modifies accounts

Testing & Development

Extend the Bot

Want to add features? Key files:

  • src/rent-checker.ts - Add new detection logic
  • src/kora-client.ts - Implement real Kora API
  • src/index.ts - Add new CLI commands

Example: Add Telegram Alerts

// In rent-checker.ts, after detecting rent return:
if (config.telegramBotToken) {
  await sendTelegramAlert(`Rent returned: ${amount} SOL`);
}

Contributing

Found a bug? Want a feature?

  1. Fork the repository
  2. Create a feature branch
  3. Submit a pull request

Acknowledgments

  • Superteam Nigeria for the bounty opportunity
  • Kora & Solana teams for the amazing infrastructure
  • Open source community for countless tools and libraries

About

An automated monitoring bot for Kora operators that tracks rent SOL returns from sponsored accounts.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors