A fully permissionless liquidation bot for Jupiter Lend protocol on Solana. This bot helps maintain the health of the lending protocol by liquidating undercollateralized positions and earning liquidation penalties.
- Automated Liquidation Detection: Continuously monitors Jupiter Lend vaults for liquidatable positions
- Multi-RPC Support: Distributes load across multiple RPC endpoints with parallel scanning
- Rate Limit Handling: Intelligent sequential vault scanning with configurable delays
- Telegram Notifications: Optional real-time alerts for opportunities, successes, and failures
- Profit Tracking: Comprehensive stats tracking for successful liquidations and earned profits
- Configurable Parameters: Customize minimum profit thresholds, polling intervals, RPC limits, and more
- Verbose Logging: Detailed logging for monitoring and debugging
The liquidation bot follows these steps for each liquidation opportunity:
- Scan for Opportunities: Fetches all active vaults (≥5% utilization) from Jupiter Lend and checks for liquidatable positions
- Filter by Profit: Identifies positions where collateral value exceeds debt value by your minimum threshold
- Build Transaction: Creates optimized liquidation transaction with proper compute units
- Execute Liquidation: Sends transaction to liquidate the position and receive collateral
- Profit: Keeps the difference between collateral value and debt paid (the liquidation penalty)
- Node.js v18 or higher
- npm or yarn
- A Solana wallet with some SOL for transaction fees
- A reliable RPC endpoint (recommended: Helius, QuickNode, or Triton)
- Clone the repository or navigate to the project directory:
cd jupiter-lend-liquidation-bot- Install dependencies:
npm install- Create a
.envfile from the example:
cp .env.example .env- Configure your environment variables in
.env:
# Solana RPC endpoints - comma-separated for multiple RPCs (recommended)
# Use reliable RPC providers like Helius, QuickNode, or Triton
RPC_ENDPOINTS=https://mainnet.helius-rpc.com/?api-key=YOUR_KEY,https://api.mainnet-beta.solana.com
# Or use single RPC endpoint (backward compatible)
# RPC_ENDPOINT=https://api.mainnet-beta.solana.com
# Your wallet's private key (base58 or array format)
# KEEP THIS SECURE! Never commit this to git
WALLET_PRIVATE_KEY=your_private_key_here
# Minimum profit threshold in USD (optional, defaults to 1)
MIN_PROFIT_USD=1
# Poll interval in milliseconds (defaults to 10000 - 10 seconds)
POLL_INTERVAL_MS=10000
# Maximum concurrent requests per RPC (defaults to 9)
MAX_REQUESTS_PER_RPC=9
# Delay between vault scans in milliseconds (defaults to 300ms)
DELAY_BETWEEN_VAULTS_MS=300
# Enable verbose logging (true/false)
VERBOSE=true
# Telegram Bot Configuration (optional)
TELEGRAM_BOT_TOKEN=your_bot_token_here
TELEGRAM_CHAT_ID=your_chat_id_hereIf you have the Solana CLI installed:
# Display your private key in base58 format
solana-keygen grind --starts-with $(solana-keygen pubkey ~/.config/solana/id.json | cut -c1-1):1
# Or display as array
cat ~/.config/solana/id.jsonExport your private key from your wallet (keep it secure!) and use the base58 format.
.gitignore file is configured to exclude .env files.
Build the TypeScript project:
npm run buildRun with ts-node for development:
npm run devBuild and run the compiled JavaScript:
npm run build
npm startAuto-rebuild on file changes:
npm run watch| Variable | Description | Default | Required |
|---|---|---|---|
RPC_ENDPOINTS |
Comma-separated Solana RPC URLs (recommended) | - | Yes* |
RPC_ENDPOINT |
Single Solana RPC endpoint URL (legacy) | - | Yes* |
WALLET_PRIVATE_KEY |
Wallet private key (base58 or array format) | - | Yes |
MIN_PROFIT_USD |
Minimum profit threshold in USD | 1 | No |
POLL_INTERVAL_MS |
Time between scans in milliseconds | 10000 | No |
MAX_REQUESTS_PER_RPC |
Max concurrent requests per RPC | 9 | No |
DELAY_BETWEEN_VAULTS_MS |
Delay between vault scans (ms) | 300 | No |
VERBOSE |
Enable detailed logging | false | No |
TELEGRAM_BOT_TOKEN |
Telegram bot token for notifications | - | No |
TELEGRAM_CHAT_ID |
Your Telegram chat ID | - | No |
*Either RPC_ENDPOINTS or RPC_ENDPOINT must be provided
For production use, we strongly recommend using a premium RPC provider:
- Helius: https://www.helius.dev/
- QuickNode: https://www.quicknode.com/
- Triton: https://triton.one/
Free public RPCs have rate limits that may impact bot performance. Using multiple RPC endpoints with RPC_ENDPOINTS distributes the load and increases reliability.
To enable Telegram notifications:
-
Create a Telegram Bot:
- Message @BotFather on Telegram
- Send
/newbotand follow the prompts - Save the bot token provided
-
Get Your Chat ID:
- Message @userinfobot on Telegram
- It will reply with your chat ID
- Or start a chat with your bot and send
/start, then check the bot logs
-
Configure Environment Variables:
TELEGRAM_BOT_TOKEN=123456789:ABCdefGHIjklMNOpqrsTUVwxyz TELEGRAM_CHAT_ID=123456789
-
Test Notifications:
npm run test:telegram
The bot will send notifications for:
- Bot startup/shutdown
- Liquidation opportunities found
- Successful liquidations
- Failed liquidation attempts
The bot provides detailed statistics including:
- Total liquidation attempts
- Successful liquidations
- Failed liquidations
- Total profit earned (USD)
- Last liquidation timestamp
Press Ctrl+C to stop the bot and view final statistics.
[INFO] 2025-10-11T20:00:00.000Z - Liquidation bot initialized
[INFO] 2025-10-11T20:00:00.001Z - Wallet: 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU
[INFO] 2025-10-11T20:00:00.002Z - Min profit threshold: $1
[INFO] 2025-10-11T20:00:00.003Z - Starting liquidation bot...
[INFO] 2025-10-11T20:00:00.004Z - Press Ctrl+C to stop
[DEBUG] 2025-10-11T20:00:05.000Z - Scanning for liquidation opportunities...
[INFO] 2025-10-11T20:00:06.234Z - Found 2 liquidation opportunities
[INFO] 2025-10-11T20:00:06.235Z - Attempting liquidation with estimated profit: $15.43
[SUCCESS] 2025-10-11T20:00:08.456Z - Liquidation successful! Signature: 5j7s..., Profit: $15.43
=== LIQUIDATION STATS ===
{
"totalAttempts": 1,
"successfulLiquidations": 1,
"failedLiquidations": 0,
"totalProfitUsd": 15.43,
"lastLiquidationTime": "2025-10-11T20:00:08.456Z"
}
========================
jupiter-lend-liquidation-bot/
├── src/
│ ├── index.ts # Entry point
│ ├── liquidator.ts # Main liquidation logic
│ ├── rpc-manager.ts # Multi-RPC connection manager
│ ├── config.ts # Configuration management
│ ├── logger.ts # Logging utility
│ ├── telegram.ts # Telegram notification service
│ └── types.ts # TypeScript type definitions
├── dist/ # Compiled JavaScript output
├── .env # Environment variables (not in git)
├── .env.example # Example environment variables
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
└── README.md # This file
- LiquidationBot: Main class that orchestrates liquidation operations
- MultiRPCManager: Manages multiple RPC connections with round-robin distribution
- TelegramNotifier: Sends real-time notifications via Telegram
- Config: Loads and validates configuration from environment variables
- Logger: Provides structured logging with different levels
- Types: TypeScript interfaces for type safety
- Check your RPC endpoint is accessible
- Verify your RPC provider has sufficient rate limits
- Try using a premium RPC provider
- Ensure your wallet has sufficient SOL for transaction fees
- The position may have already been liquidated by another bot
- Increase slippage tolerance if swap is failing
- Verify your private key format (base58 or array)
- Check for extra spaces or newlines in .env file
Enable verbose logging to see detailed execution information:
VERBOSE=true- Never share your private key: Keep your
.envfile secure and never commit it - Use a dedicated wallet: Consider using a separate wallet specifically for the bot
- Start with small amounts: Test with a wallet containing minimal SOL first
- Monitor regularly: Keep an eye on bot performance and profits
- Use secure RPC: Prefer authenticated RPC endpoints over public ones
- Multi-RPC Setup: Use multiple high-quality RPC endpoints with
RPC_ENDPOINTSfor better reliability and throughput - RPC Quality: Use premium RPC providers (Helius, QuickNode, Triton) with low latency
- Rate Limit Tuning: Adjust
DELAY_BETWEEN_VAULTS_MSandMAX_REQUESTS_PER_RPCto optimize scanning speed while respecting rate limits - Poll Interval: Adjust
POLL_INTERVAL_MSbased on market conditions (lower for more active markets) - Profit Threshold: Set
MIN_PROFIT_USDto avoid unprofitable liquidations and save on transaction fees - Compute Units: The bot uses optimized compute unit limits (1.4M units) for complex liquidation transactions
This is an open-source project. Contributions welcome:
- Add more sophisticated profit calculations and simulations
- Implement MEV protection strategies
- Add support for custom slippage parameters
- Enhance error handling and retry logic with exponential backoff
- Add Discord/Slack notification integrations
- Implement flash loan integration for capital-efficient liquidations
MIT License - see LICENSE file for details
This software is provided as-is without any guarantees. Liquidation bot operations involve financial risk. Always test thoroughly and understand the risks before running on mainnet with significant capital. The authors are not responsible for any losses incurred through use of this software.
For issues or questions:
- Check the Jupiter Lend Documentation
- Join the Jupiter Discord and ask in the
#devor#jup-lendchannels - Reach out to @jup_lend on Twitter
Built with ❤️ for the Jupiter ecosystem