A WebSocket proxy server for Solana DEX events based on sol-parser-sdk. Real-time monitoring of DEX trading events from PumpFun, Raydium, Orca, and more, streamed to clients via WebSocket.
β¨ Features
- π₯ Ultra-low Latency - Built on sol-parser-sdk with 10-20ΞΌs parsing latency
- π Real-time WebSocket Push - Support multiple concurrent client connections
- π Multi-protocol Support - PumpFun, Raydium AMM V4/CLMM/CPMM, Orca Whirlpool, Meteora, etc.
- π― Event Filtering - Only push events you care about
- βοΈ TOML Configuration - All parameters flexibly configurable via config file
- π Auto Reconnection - Automatic client cleanup on disconnect
- π Multi-language Clients - Examples in HTML, TypeScript, Python
ποΈ Architecture
βββββββββββββββββββ
β Yellowstone gRPCβ
β (Solana RPC) β
ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββ
β sol-parser-sdk β
β (10-20ΞΌs parse)β
ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββ
β WebSocket Serverβ
β (Broadcast) β
ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββ
β Clients (HTML/TS/Python/...) β
β (Real-time DEX Events) β
βββββββββββββββββββββββββββββββββββββββ
π¦ Installation
1. Clone Repository
2. Build Project
π Quick Start
1. Configure Server
Edit config.toml:
[]
= "127.0.0.1"
= 9001
[]
= "https://solana-yellowstone-grpc.publicnode.com:443"
= "" # Optional: your gRPC token
= true
= true
= 10000
= 30000
[]
= true
= true
= true
= true
# ... more protocols
[]
= true
= true
= true
# ... more event types
2. Start Server
Method 1: Using Script (Recommended)
Method 2: Direct Run
Server will start based on config file (default ws://127.0.0.1:9001)
3. Start Client
Method 1: Using Script (Recommended)
The script will prompt you to choose client type:
- HTML Client (Browser visualization, auto-convert Pubkey/Signature)
- TypeScript Client (Terminal, auto-convert Pubkey/Signature)
- Python Client (Terminal, auto-convert Pubkey/Signature + latency display)
Method 2: Manual Start
HTML Client (Recommended)
β¨ Features:
- Auto-convert Pubkey/Signature to base58 strings
- Real-time latency display (gRPC β Client)
- Color-coded latency (π’ < 50ms, π‘ < 100ms, π΄ β₯ 100ms)
- βΈοΈ Pause/Resume - Pause event updates to inspect details
TypeScript Client
β¨ Features:
- Auto-convert using @solana/web3.js and bs58
- Terminal real-time latency display (with colors)
- TypeScript type safety
Python Client
β¨ Features:
- Auto-convert Pubkey/Signature using
base58library - Terminal color latency display
- Microsecond precision latency calculation
π Supported Protocols and Events
Supported DEX Protocols
| Protocol | Config Field | Description |
|---|---|---|
| PumpFun | protocols.pumpfun |
PumpFun Meme token trading |
| PumpSwap | protocols.pumpswap |
PumpSwap exchange protocol |
| Bonk | protocols.bonk |
Bonk launch platform |
| Raydium AMM V4 | protocols.raydium_amm_v4 |
Raydium Automated Market Maker V4 |
| Raydium CLMM | protocols.raydium_clmm |
Raydium Concentrated Liquidity MM |
| Raydium CPMM | protocols.raydium_cpmm |
Raydium Constant Product MM |
| Orca Whirlpool | protocols.orca_whirlpool |
Orca Whirlpool Concentrated Liquidity |
| Meteora AMM | protocols.meteora_amm |
Meteora Dynamic AMM |
| Meteora DAMM | protocols.meteora_damm |
Meteora Dynamic AMM V2 |
| Meteora DLMM | protocols.meteora_dlmm |
Meteora Dynamic Liquidity MM |
Supported Event Types
Each protocol supports the following event types (enable in [events] config section):
- π Trade/Swap - Trading/swapping events
- π§ Deposit - Add liquidity
- πΈ Withdraw - Remove liquidity
- π Create/Initialize - Pool creation/initialization
See config.toml for complete event list.
π§ Configuration
Server Configuration
[]
= "127.0.0.1" # WebSocket listen address
= 9001 # WebSocket listen port
gRPC Configuration
[]
= "https://solana-yellowstone-grpc.publicnode.com:443"
= "" # gRPC auth token (optional)
= true # Enable performance metrics
= true # Enable TLS
= 10000 # Connection timeout (ms)
= 30000 # Request timeout (ms)
Protocol and Event Filtering
Enable/disable specific protocols and events via config:
[]
= true # Enable PumpFun protocol
= false # Disable Raydium AMM V4
[]
= true # Enable PumpFun trade events
= false # Disable PumpFun create events
Note: At least one protocol and one event type must be enabled, otherwise server will fail to start
π‘ WebSocket Message Format
Pubkey and Signature Format
Raw data from server:
- Pubkey: 32-byte array
- Signature: 64-byte array
Client display format:
- β
HTML/TypeScript Client: Auto-convert to base58 strings
- β Python Client: Auto-convert using base58 library
Event Format
Event Types
Each event is wrapped in its corresponding type field:
PumpFunTrade- PumpFun tradePumpFunCreate- PumpFun creationRaydiumAmmV4Swap- Raydium AMM swapRaydiumClmmSwap- Raydium CLMM swapOrcaWhirlpoolSwap- Orca swap
π¬ Development
Project Structure
parser-proxy-ws/
βββ src/
β βββ main.rs # Main entry point
β βββ config.rs # Config file loading and parsing
β βββ ws_server.rs # WebSocket server implementation
βββ examples/
β βββ client.html # HTML visualization client
β βββ client.ts # TypeScript client example
β βββ client.py # Python client example
βββ sol-parser-sdk/ # Solana parser SDK (submodule)
βββ config.toml # Configuration file
βββ Cargo.toml # Rust project config
βββ README.md
Run Tests
Performance Monitoring
Performance metrics are displayed when server starts:
π gRPC receive time: 1234567890 ΞΌs
β‘ Event parsing took: 15 ΞΌs
π― Use Cases
- Trading Bots - Real-time DEX monitoring for arbitrage strategies
- Price Monitoring - Track trading prices of specific tokens
- New Token Alerts - Monitor new token creation events
- Liquidity Analysis - Analyze DEX liquidity changes
- Data Analytics - Collect on-chain trading data for analysis
π License
MIT License
π Related Projects
- sol-parser-sdk - Solana DEX event parsing library
- Yellowstone gRPC - Solana gRPC interface
π Contact
For issues or suggestions, please submit an Issue.