https://github.com/bitfancy/subscribe-grpc
get accounts from several dexs using subscribe with yellowstone grpc
https://github.com/bitfancy/subscribe-grpc
Last synced: 8 months ago
JSON representation
get accounts from several dexs using subscribe with yellowstone grpc
- Host: GitHub
- URL: https://github.com/bitfancy/subscribe-grpc
- Owner: BitFancy
- Created: 2025-03-12T07:29:01.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-12T07:44:27.000Z (about 1 year ago)
- Last Synced: 2025-05-07T13:56:50.377Z (10 months ago)
- Language: Rust
- Size: 50.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Solana PumpFun Copy Trading Bot in Rust 🚀
## Overview
A high-performance copy trading bot for PumpFun DEX on Solana, written in Rust 🦀.
The bot monitors specific wallets and automatically replicates their trading activities with configurable parameters and advanced features like Jito MEV integration.
## Key Features
### 🚀 Performance & Architecture
- **Rust-Powered Performance**: Built with Rust for optimal speed and memory safety
- **Dual Monitoring Modes**:
- gRPC streaming via Yellowstone/InstantNodes
- WebSocket-based wallet monitoring
- **Asynchronous Architecture**: Using Tokio for non-blocking operations
### 🔒 Security & Configuration
- **Environment-Based Setup**: Secure configuration via `.env` file
- **Robust Error Handling**: Comprehensive error management and logging
- **Configurable Parameters**: Customizable slippage, amounts, and monitoring settings
### 📊 Trading Features
- **Smart Copy Trading**:
- Automatic trade detection and replication
- Configurable trade size (default: 50% of detected amount)
- Support for both buy and sell operations
- **PumpFun DEX Integration**:
- Direct interaction with PumpFun bonding curves
- Automatic token account creation and management
- **Jito MEV Integration**: Enhanced transaction priority
## Directory Structure
```
src/
├── common/ # Common utilities and shared components
│ ├── logger.rs # Logging system with colored output
│ └── utils.rs # Configuration and utility functions
├── dex/ # DEX integration components
│ └── pump_fun.rs # PumpFun DEX interaction logic
├── engine/ # Core trading engine
│ └── monitor/ # Transaction monitoring systems
│ ├── grpc_monitor.rs # gRPC-based monitoring
│ └── wallet_monitor.rs # WebSocket-based monitoring
├── services/ # External service integrations
│ └── jito.rs # Jito MEV service integration
└── proto/ # Protocol definitions
└── instantnode.rs # InstantNode gRPC client implementation
```
## Environment Variables
```env
# Required Configuration
PRIVATE_KEY=
RPC_HTTPS=
RPC_WSS=
RPC_GRPC=
RPC_TOKEN=
# Optional Configuration
SLIPPAGE=10 # Slippage tolerance in percentage
LOG_LEVEL=debug # Logging level (debug/info/error)
```
## Usage
1. **Installation**
```bash
git clone
cd solana-pumpfun-bot
cargo build --release
```
2. **Configuration**
- Copy `.env.example` to `.env`
- Configure your environment variables
3. **Running the Bot**
```bash
cargo run --release
```
### Monitoring Modes
#### gRPC Monitoring
```bash
# Monitor PumpFun transactions
cargo run -- --endpoint $RPC_GRPC --x-token $RPC_TOKEN subscribe \
--transactions \
--transactions-vote false \
--transactions-failed false \
--transactions-account-include "o7RY6P2vQMuGSu1TrLM81weuzgDjaCRTXYRaXJwWcvc"
```
#### WebSocket Monitoring
```bash
# Monitor wallet updates
cargo run -- --ws-url $RPC_WSS monitor-wallet
```
## Technical Details
### Trading Logic
- The bot monitors specified wallets for PumpFun DEX interactions
- Upon detecting a trade:
1. Extracts transaction details (mint, amount, direction)
2. Validates the trading parameters
3. Executes a copy trade with configured parameters
- For buys: Uses 50% of virtual SOL reserves
- For sells: Uses 50% of available token balance
### Safety Features
- Transaction validation and simulation
- Automatic token account creation
- Balance checks before execution
- Comprehensive error handling and logging
### Logging System
- Colored output for different message types
- Transaction counting and tracking
- Detailed timing information
- Multiple log levels (DEBUG, INFO, ERROR, SUCCESS, WARNING)
## Support
For support and inquiries, please connect via Telegram: 📞 [bitfancy](https://t.me/bitfancy)