Skip to content

Commit

Permalink
add: volume bot solana public
Browse files Browse the repository at this point in the history
  • Loading branch information
topsecretagent007 committed Sep 17, 2024
1 parent ead2694 commit 40878e7
Show file tree
Hide file tree
Showing 17 changed files with 4,585 additions and 38 deletions.
41 changes: 41 additions & 0 deletions .env.copy
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
PRIVATE_KEY=
RPC_ENDPOINT=
RPC_WEBSOCKET_ENDPOINT=


####### BUY SETTING #######
IS_RANDOM=true
DISTRIBUTION_AMOUNT=0.01
BUY_AMOUNT=0.01
BUY_UPPER_AMOUNT=0.002
BUY_LOWER_AMOUNT=0.001

BUY_INTERVAL_MAX=2000
BUY_INTERVAL_MIN=4000

CHECK_BAL_INTERVAL=3000
DISTRIBUTE_WALLET_NUM=8

SWAP_ROUTING=true

###### FOR MASSIVE BUY #####
WALLET_NUM=8

########## FOR SELL MODE ##########
SELL_ALL_BY_TIMES=20 # how many time it will take to sell all tokens in subwallets through small buy and sell
SELL_PERCENT=100 # how many percent of token in main wallet will be sold gradually

#### TOKEN PAIR SETTING ####
#TOKEN_MINT=tgw7RiFwLUsM9dHNGj2mdAZjuivdsk8FH9RESxFX8LX
TOKEN_MINT=6VbEGuqwhjdgV9NxhMhvRkrFqXVNk53CvD7hK3C3yQS9
POOL_ID=null

TX_FEE=10
ADDITIONAL_FEE=0.006 # should be larger than 0.006SOL
JITO_KEY=
JITO_FEE=120000
BLOCKENGINE_URL=ny.mainnet.block-engine.jito.wtf


###### GENERAL SETTING ######
LOG_LEVEL=info
141 changes: 141 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# PNPM
pnpm-lock.yaml

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# JetBrains
.idea

# Visual Studio Code
*.code-workspace

data.json
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"trailingComma": "all",
"printWidth": 120
}
106 changes: 68 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,93 @@
# Volume Bot for Solana
# Raydium Pairs Volume Bot

## Project Description
This bot is designed to automate the distribution of SOL to multiple wallets and execute endless buy and sell swap transactions simultaneously on the Raydium platform. It leverages Solana's blockchain technology to perform these operations efficiently.

The Volume Bot for Solana is a powerful tool designed to analyze and monitor trading volumes on the Solana blockchain. This bot helps traders and analysts to efficiently track real-time data, gain insights, and make informed decisions based on volume fluctuations across various tokens and markets.
## This product is trying to show the basic functions of volume bot, and not suitable for big live tokens. So, if you want better version, you can refer to version 2 in my github.

## Table of Contents
## Features

- **Automated SOL Distribution**: Distributes SOL to new wallets.
- **Endless Buy and Sell Swaps**: Performs simultaneous buy and sell transactions.
- **Configurable Parameters**: Allows customization of buy amounts, intervals, distribution settings, and more.
- **Massive Buy Mode**: Enables the configuration of multiple wallets for large-scale buy operations.
- **Sell Mode**: Gradually sells all tokens in sub-wallets through small transactions.
- **Token Pair Settings**: Configurable token mint and pool ID for swap operations.
- **Logging**: Supports adjustable logging levels for better monitoring and debugging.

## Environment Variables

The bot uses the following environment variables, which should be defined in a `.env` file:

- [Installation](#installation)
- [Usage](#usage)
- [Features](#features)
- [Contributing](#contributing)
- [License](#license)
- [Contact](#contact)
```env
PRIVATE_KEY= # Private key for the main wallet
RPC_ENDPOINT= # RPC endpoint for Solana
RPC_WEBSOCKET_ENDPOINT= # RPC WebSocket endpoint for Solana
## Installation
####### BUY SETTING #######
IS_RANDOM=true # Enable random buy amounts
DISTRIBUTION_AMOUNT=0.01 # Amount of SOL to distribute to each wallet
BUY_AMOUNT=0.01 # Fixed buy amount
BUY_UPPER_AMOUNT=0.002 # Upper limit for random buy amount
BUY_LOWER_AMOUNT=0.001 # Lower limit for random buy amount
To install and run this project locally, follow these steps:
BUY_INTERVAL_MAX=2000 # Maximum interval between buys in milliseconds
BUY_INTERVAL_MIN=4000 # Minimum interval between buys in milliseconds
1. Clone the repository:
```bash
git clone https://github.com/Lendon-B/Volume_Bot_solana_private.git
cd Volume_Bot_solana_private
```
CHECK_BAL_INTERVAL=3000 # Interval to check wallet balances in milliseconds
DISTRIBUTE_WALLET_NUM=8 # Number of wallets to distribute SOL to
2. Install the necessary dependencies:
```bash
npm install
```
SWAP_ROUTING=true # Enable swap routing
Ensure you have [Node.js](https://nodejs.org/) and [npm](https://www.npmjs.com/) installed before proceeding.
###### FOR MASSIVE BUY #####
WALLET_NUM=8 # Number of wallets for massive buy operations
3. Configure environment variables:
Create a `.env` file in the root directory and provide the necessary API keys and configurations as required by the bot.
########## FOR SELL MODE ##########
SELL_ALL_BY_TIMES=20 # Number of times to sell all tokens in sub-wallets gradually
SELL_PERCENT=100 # Percentage of tokens to sell from the main wallet
#### TOKEN PAIR SETTING ####
TOKEN_MINT=6VbEGuqwhjdgV9NxhMhvRkrFqXVNk53CvD7hK3C3yQS9 # Token mint address
POOL_ID=null # Pool ID for the token pair
TX_FEE=10 # Transaction fee
ADDITIONAL_FEE=0.006 # Additional fee (should be larger than 0.006 SOL)
JITO_KEY= # Jito key
JITO_FEE=120000 # Jito fee
BLOCKENGINE_URL=ny.mainnet.block-engine.jito.wtf # Block engine URL
###### GENERAL SETTING ######
LOG_LEVEL=info # Logging level (info, debug, error)
```

## Usage
1. Clone the repository
```
git clone https://github.com/Lamoerey/Volume-Bot_Raydium_Solana.git
cd volume-bot_raydium
```
2. Install dependencies
```
npm install
```
3. Configure the environment variables

After installation, you can start the bot by running the following command:
Rename the .env.copy file to .env and set RPC and WSS, main keypair's secret key, and jito auth keypair.

```bash
4. Run the bot

```
npm start
```

The bot will start monitoring the specified Solana markets for volume changes and provide analytical data in the console output.

## Features
## Author

- Real-time volume monitoring on Solana blockchain
- User-friendly interface for tracking multiple tokens
- Configurable settings for custom alerts and notifications
- High performance and low latency operations

## Contributing

Contributions are welcome! If you'd like to contribute to the project, please fork the repository, make your changes, and submit a pull request. Please ensure your contributions align with the project's goals and follow the coding conventions.
Twitter: [@Lamoerey](https://twitter.com/Lamoerey)

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.
Telegram: [@Lamoerey](https://t.me/Lamoerey)

## Contact

For any questions or inquiries, please reach out to Lendon B at Telegram : https://t.me/lendon1114, Email : [email protected]
You can always find me here, for help, or for other projects.
1 change: 1 addition & 0 deletions constants/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './constants';
1 change: 1 addition & 0 deletions dist.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm start
1 change: 1 addition & 0 deletions gather.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run gather
60 changes: 60 additions & 0 deletions gather.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import {
Keypair,
Connection,
Transaction,
SystemProgram,
sendAndConfirmTransaction,
ComputeBudgetProgram,
} from '@solana/web3.js'
import {
PRIVATE_KEY,
RPC_ENDPOINT,
RPC_WEBSOCKET_ENDPOINT,
} from './constants'
import { Data, readJson } from './utils'
import base58 from 'bs58'

export const solanaConnection = new Connection(RPC_ENDPOINT, {
wsEndpoint: RPC_WEBSOCKET_ENDPOINT,
})
const mainKp = Keypair.fromSecretKey(base58.decode(PRIVATE_KEY))

const gather = async () => {
const data: Data[] = readJson()
if (data.length == 0) {
console.log("No wallet to gather")
return
}
for (let i = 0; i < data.length; i++) {
try {
const wallet = Keypair.fromSecretKey(base58.decode(data[i].privateKey))
const balance = await solanaConnection.getBalance(wallet.publicKey)
if (balance == 0) {
console.log("sol balance is 0, skip this wallet")
continue
}
const rent = await solanaConnection.getMinimumBalanceForRentExemption(32);
console.log("🚀 ~ gather ~ minBalance:", rent)

const transaction = new Transaction().add(
ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 600_000 }),
ComputeBudgetProgram.setComputeUnitLimit({ units: 20_000}),
SystemProgram.transfer({
fromPubkey: wallet.publicKey,
toPubkey: mainKp.publicKey,
lamports: balance - 13 * 10 ** 3 - rent
})
)

transaction.recentBlockhash = (await solanaConnection.getLatestBlockhash()).blockhash
transaction.feePayer = wallet.publicKey
console.log(await solanaConnection.simulateTransaction(transaction))
const sig = await sendAndConfirmTransaction(solanaConnection, transaction, [wallet], { skipPreflight: true })
console.log({ sig })
} catch (error) {
console.log("Failed to gather sol in a wallet")
}
}
}

gather()
Loading

0 comments on commit 40878e7

Please sign in to comment.