Skip to content

Copy Trading: Solana copytrading bot source code, copy trading target wallet (pumpfun, pumpswap, raydium amm, cpmm, clmm)

Notifications You must be signed in to change notification settings

cutupdev/Solana-Copytrading-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solana Copytrading Bot

This is copy trading bot running on several solana dex platform - raydium, meteora, pumpfun, pumpswap. To boost bot speed and performance, I have updated bot using Rust programming language. In this bot, it tracks the profitable bots fast and copytrade it. If you want, I can offer full version and can develop customized advanced project[Advantage: GRPC for tx fetching, direct dex swap, Rust language].

Advanced Version

In copy trading bot, there are two main things: one is fetching target wallet transaction and other one is copying target wallet transaction. In the basic version, fetching target wallet tx is done by rpc websocket (300-500ms) but with the advanced version, I am using grpc for target wallet tx fetching, and it takes only 50-100ms. Also in most of copy bots, they are using jupiter for swapping to copy target wallet transactions. Jupiter is good aggregator that is supporting swap, but it causes time latency. So with my new solution, I usually swap on dexs directly. If target wallet swap token on raydium pool, then my bot swap on raydium directly and it reduces latency absolutely. Of course, it needs more development time because it needs to interact several dexs directly, but otherwise using jupiter is too easy for development and understanding.


Directory Structure

src/
├── core/
│   ├── token.rs        # Token definitions and handle
│   └── tx.rs           # Transaction handle
|   └── mod.rs          # mod file
| 
├── engine/
│   ├── swap.rs         # Token swap(buy/sell) functionalities in various Dexs
│   └── monitor.rs      # Target wallet monitoring(and parse tx) in Dexs using geyser rpc, and normal rpc
|   └── mod.rs          # mod file
│       
├── dex/
│   ├── pump_fun.rs     # Pump.fun
│   ├── raydium.rs      # Raydium
│   ├── meteora.rs      # Meteora
│   └── pumpswap.rs     # Pumpswap
|   └── mod.rs          # mod file
│
├── services/
│   ├── jito.rs         # Jito service provides ultra-fast transaction confirmation
│   └── nextblock.rs    # NextBlock service provides the ultra-fast transaction confirmation in unique way
|
├── common/
|    ├── logger.rs      # Handles logging to be clean and convenient to monitor.
|    ├── config.rs      # Handles project configurations such as environment variables and constants.
|    ├── constants.rs   # Stores global constants used across the project.
|    ├── targetlist.rs  # Manages lists of targets such as URLs or files.
|    └── utils.rs       # Utility functions used across the project, including input/output operations, string manipulation, etc.
|    └── mod.rs         # mod file
│
├── lib.rs
└── main.rs

How To Run

  1. Environment Variables Settings
PRIVATE_KEY=your_private_key_here
RPC_HTTPS=https://mainnet.helius-rpc.com/?api-key=your_api_key_here
RPC_WSS=wss://atlas-mainnet.helius-rpc.com/?api-key=your_api_key_here
SLIPPAGE=10
JITO_BLOCK_ENGINE_URL=https://ny.mainnet.block-engine.jito.wtf
JITO_TIP_STREAM_URL=ws://bundles-api-rest.jito.wtf/api/v1/bundles/tip_stream
JITO_TIP_PERCENTILE=50
JITO_TIP_VALUE=0.004
TOKEN_PERCENTAGE=1 #percentage
  1. List target wallet address into targetlist.txt.
  2. Run trial/solana-copytrading-trial.exe.

Test results

Buy

Sell

Same Block(Using validator)

Contact Information

About

Copy Trading: Solana copytrading bot source code, copy trading target wallet (pumpfun, pumpswap, raydium amm, cpmm, clmm)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages