This repository implements a multithreaded copy trading bot that monitors and replicates trading actions across different accounts on Solana. It is designed for efficiency and reliability, leveraging custom WebSocket listeners and multithreading to ensure optimal performance.
- Multithreaded Execution: Tracks multiple account sets on different threads for high performance.
- Reliable WebSocket Listener: Implements a custom
wssListener
with enhanced stability. - GRPC Support: Includes
grpcListener
as an alternative to WebSocket for tracking accounts. - Supported DEXs:
- RaydiumV4
- Dynamic Configuration: Easily customize accounts, and other parameters via configuration files.
- Node.js (v14 or higher)
- npm or yarn
- Access to:
- Solana RPC Node
- Yellowstone GRPC
-
Clone the repository:
-
Install dependencies:
npm install
Or, if you're using Yarn:
yarn install
-
Configure environment variables:
- Copy the
.env.example
file to.env
. - Fill in your configuration details (e.g., API keys, RPC URLs, and thresholds).
- Copy the
-
Modify
config.json
to set accounts, and other parameters as required -
Toggle between
grpcListener
/wssListener
by commenting/uncommenting listener init lines currently at 207/208 inindex.js

- This was developed using AllThatNode's free gRPC service, which behaves unpredictably by stopping message streams after 1 minute, even though the connection remains active. To address this, a resubscription routine has been implemented.
Important: If you're using a reliable gRPC service, this workaround might cause issues like exceeding maximum subscription limits.
Recommendation: Test the behavior with and without the resubscription logic by commenting out the corresponding lines in the code to
ensure compatibility with your setup. Lines: 184
listener.js

To start the bot, use:
npm start
Or with Yarn:
yarn start
- Listeners:
wssListener
: Reliable WebSocket-based listener with custom socket limits.grpcListener
: GRPC-based listener for accounts on Solana.
- Multithreading:
- Each thread independently monitors a set of wallets.
- Trades are created, simulated and then can be executed based on monitoring
- Error Handling:
- Gracefully handles network issues, transaction failures, and insufficient funds.
- Trade values are in the smallest unit(decimals).
-
Insufficient Funds for Fees: Ensure executing wallet has enough SOL for transaction fees.
-
WebSocket Instability: Use the
grpcListener
as an alternative if WebSocket connections are unreliable. -
Redis Errors: Ensure Redis is running and correctly configured.
Contributions are welcome! Please submit issues or pull requests to help improve the project.
This bot is for educational purposes only. Use it at your own risk. The authors are not responsible for any financial losses incurred through the use of this software.