This bot is designed to automate the distribution of SOL to multiple wallets and execute simultaneous buy and sell swap transactions on the Raydium DEX. By integrating Jito Bundle, the bot optimizes all transactions, ensuring maximum performance and efficiency.
- Features
- Prerequisites
- Installation
- Usage
- Code Explanation
- Best Practices
- Contributing
- License
- 💖 Support the Developer
- Automated Distribution: Efficiently distributes SOL across multiple wallets.
- Endless Swaps: Performs simultaneous buy and sell transactions seamlessly.
- Optimized Performance: Leverages Jito Bundle for transaction bundling and enhanced speed.
- Market Impact: Helps increase the token's market holders through active volume generation.
- Powered by Solana: Utilizes Solana’s high-speed, low-cost blockchain for optimal performance.
- Jito bundles for MEV protection
- Comprehensive error handling and logging
- Node.js (v18 or later)
- npm (v6 or later)
- A Solana wallet with SOL for transaction fees
- 0.01 SOL in wallet for swap
-
Clone the repository:
git clone https://github.com/black-rustx/RaydiumVolumeBot-v2.git cd RaydiumVolumeBot-v2
-
Install dependencies:
npm install
-
Create a .env file in the project root and add your Solana RPC URL and wallet private key:
RPC_ENDPOINT=https://your-rpc-url-here PRIVATE_KEY=[your,private,keypair,array,here]
We have included an example .env file in the repository for your convenience.
Run the script with:
npm start
This will execute a sample swap of 0.01 SOL to USDC. Modify the main
function in index.js
to customize the swap parameters. Ensure you have the correct token addresses and amounts for your swap in the wallet for the swap to execute.
The index.js
file contains the following key components:
-
Setup and Imports:
- The script imports essential libraries and modules for interacting with Solana, including @solana/web3.js, @solana/spl-token, and custom utility functions from utils and executor modules.
- Constants like RPC endpoints, intervals, and token mint details are imported from a constants file.
-
Solana Connection and Main Wallet Initialization:
solanaConnection
: Establishes a connection to the Solana blockchain using an RPC endpoint with WebSocket support for real-time updates.mainKp
: Initializes the main wallet using a private key decoded frombase58
.
-
Key Functions:
distributeSol
: Distributes SOL from the main wallet to multiple newly generated wallets, ensuring each has enough balance for subsequent operations.buy
: Executes buy transactions for tokens using Jupiter's aggregator for efficient swaps.Dynamically adjusts the buy amount based on wallet SOL balance and configured percentages (BUY_UPPER_PERCENT and BUY_LOWER_PERCENT). Utilizes Jito Bundle integration for optimized transaction execution when enabled.sell
: Sells tokens held in associated token accounts by leveraging Jupiter's swap functionality. Handles token balance checks and ensures the transaction is completed successfully.
-
Wallet Transfer:
- Transfers remaining SOL to a newly generated wallet after each buy-and-sell cycle to reset the operation loop.
-
Main Logic:
The main function orchestrates the entire bot process:
- Prints bot settings, wallet balance, and other configurations..
- Distributes SOL to sub-wallets for parallel operations
- Executes an endless cycle of buying, selling, and redistributing SOL
-
Optimization Features:
Jito Bundle Integration
: Enhances transaction bundling for improved efficiency and ensures optimal MEV protection.Compute Budget Instructions
: Adds compute unit limits and custom unit prices to transactions, improving performance on the Solana network.
-
Error Handling and Logging:
- Comprehensive error handling ensures the bot continues or retries failed transactions without interrupting the workflow.
- Logs detailed messages to track operations, including transaction links for monitoring on Solscan.
-
Example Usage:
- Simply run the script to start the bot. It continuously performs buy-and-sell operations on the Raydium DEX and redistributes SOL across wallets, leveraging Solana's efficiency and Jupiter's aggregation.
To ensure accurate compute unit allocation, we simulate the transaction before sending it. This process:
- Constructs a transaction with all necessary instructions.
- Simulates the transaction using
connection.simulateTransaction()
. - Retrieves the actual compute units consumed.
- Adds a 20% buffer to the consumed units for safety.
This approach helps prevent transaction failures due to insufficient compute budget.
This volume bot implements several best practices:
- Versioned Transactions: Utilizes the latest transaction format for improved efficiency.
- Compute Budget Optimization: Uses transaction simulation to set appropriate compute units.
- Dynamic Priority Fees: Implements adaptive priority fees based on recent network activity.
- Address Lookup Tables: Leverages ALTs to reduce transaction size and cost.
- MEV Protection: Integrates with Jito for protection against MEV (Miner Extractable Value).
- Error Handling: Implements comprehensive error catching and logging for easier debugging.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
If you found this bot helpful and would like to support the development of more resources like this, consider tipping! Your contributions help keep the project alive and thriving.
Solana Wallet Address: 27uqtpRjpnDEiQ9SFJQKN2fEBQLEx3ptvJgGhV8AV83U
ETH Wallet Address: 0xd64EA7D33dd5a96A6522fc6b6621b515f5a11EE7
Thank you for your support!
Happy swapping! If you have any questions or run into issues, please open an issue in the GitHub repository.
Telegram: @g0drlc