{"id":31036630,"url":"https://github.com/0xfnzero/solana-streamer","last_synced_at":"2026-02-23T06:19:59.337Z","repository":{"id":305358233,"uuid":"991778632","full_name":"0xfnzero/solana-streamer","owner":"0xfnzero","description":"A lightweight Rust library for real-time event streaming from Solana DEX trading programs. This library provides efficient event parsing and subscription capabilities for PumpFun, PumpSwap, Bonk, and Raydium CPMM protocols.","archived":false,"fork":false,"pushed_at":"2026-01-27T15:06:06.000Z","size":830,"stargazers_count":150,"open_issues_count":4,"forks_count":69,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-01-28T02:24:11.375Z","etag":null,"topics":["0xfnzero","bonk","copytrading","copytradingbot","fnzero","grpc","jito","letsbonk","pumpbot","pumpfun","pumpswap","raydium","raydium-launchlab","shreds","shredstream","snipe","snipe-bot","yellowstone","yellowstonegrpc"],"latest_commit_sha":null,"homepage":"https://fnzero.dev","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xfnzero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-28T06:21:54.000Z","updated_at":"2026-01-27T14:24:13.000Z","dependencies_parsed_at":"2025-07-19T19:29:40.184Z","dependency_job_id":"3b26f88c-1b49-47a7-a791-c14ef7963b4c","html_url":"https://github.com/0xfnzero/solana-streamer","commit_stats":null,"previous_names":["0xfnzero/solana-streamer"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/0xfnzero/solana-streamer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xfnzero%2Fsolana-streamer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xfnzero%2Fsolana-streamer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xfnzero%2Fsolana-streamer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xfnzero%2Fsolana-streamer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xfnzero","download_url":"https://codeload.github.com/0xfnzero/solana-streamer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xfnzero%2Fsolana-streamer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29738915,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T04:51:08.365Z","status":"ssl_error","status_checked_at":"2026-02-23T04:49:15.865Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["0xfnzero","bonk","copytrading","copytradingbot","fnzero","grpc","jito","letsbonk","pumpbot","pumpfun","pumpswap","raydium","raydium-launchlab","shreds","shredstream","snipe","snipe-bot","yellowstone","yellowstonegrpc"],"created_at":"2025-09-14T04:01:13.316Z","updated_at":"2026-02-23T06:19:59.312Z","avatar_url":"https://github.com/0xfnzero.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003ch1\u003e🌊 Solana Streamer\u003c/h1\u003e\n    \u003ch3\u003e\u003cem\u003eReal-time event streaming from Solana DEX trading programs.\u003c/em\u003e\u003c/h3\u003e\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cstrong\u003eA lightweight Rust library providing efficient event parsing and subscription capabilities for PumpFun, PumpSwap, Bonk, and Raydium protocols.\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://crates.io/crates/solana-streamer-sdk\"\u003e\n        \u003cimg src=\"https://img.shields.io/crates/v/solana-streamer-sdk.svg\" alt=\"Crates.io\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://docs.rs/solana-streamer-sdk\"\u003e\n        \u003cimg src=\"https://docs.rs/solana-streamer-sdk/badge.svg\" alt=\"Documentation\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/0xfnzero/solana-streamer/blob/main/LICENSE\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg\" alt=\"License\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/0xfnzero/solana-streamer\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/stars/0xfnzero/solana-streamer?style=social\" alt=\"GitHub stars\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/0xfnzero/solana-streamer/network\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/forks/0xfnzero/solana-streamer?style=social\" alt=\"GitHub forks\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Rust-000000?style=for-the-badge\u0026logo=rust\u0026logoColor=white\" alt=\"Rust\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Solana-9945FF?style=for-the-badge\u0026logo=solana\u0026logoColor=white\" alt=\"Solana\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Streaming-FF6B6B?style=for-the-badge\u0026logo=livestream\u0026logoColor=white\" alt=\"Real-time Streaming\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/gRPC-4285F4?style=for-the-badge\u0026logo=grpc\u0026logoColor=white\" alt=\"gRPC\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"README_CN.md\"\u003e中文\u003c/a\u003e | \n    \u003ca href=\"README.md\"\u003eEnglish\u003c/a\u003e | \n    \u003ca href=\"https://fnzero.dev/\"\u003eWebsite\u003c/a\u003e |\n    \u003ca href=\"https://t.me/fnzero_group\"\u003eTelegram\u003c/a\u003e |\n    \u003ca href=\"https://discord.gg/vuazbGkqQE\"\u003eDiscord\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## Table of Contents\n\n- [🚀 Project Features](#-project-features)\n- [⚡ Installation](#-installation)\n- [🔄 Migration Guide](#-migration-guide)\n- [⚙️ Configuration System](#️-configuration-system)\n- [📚 Usage Examples](#-usage-examples)\n- [🔧 Supported Protocols](#-supported-protocols)\n- [🌐 Event Streaming Services](#-event-streaming-services)\n- [🏗️ Architecture Features](#️-architecture-features)\n- [📁 Project Structure](#-project-structure)\n- [⚡ Performance Considerations](#-performance-considerations)\n- [📄 License](#-license)\n- [📞 Contact](#-contact)\n- [⚠️ Important Notes](#️-important-notes)\n\n## 🚀 Project Features\n\n### Core Capabilities\n- **Real-time Event Streaming**: Subscribe to live trading events from multiple Solana DEX protocols\n- **Yellowstone gRPC Support**: High-performance event subscription using Yellowstone gRPC\n- **ShredStream Support**: Alternative event streaming using ShredStream protocol\n- **Unified Event Interface**: Consistent event handling across all supported protocols\n\n### Multi-Protocol Support\n- **PumpFun**: Meme coin trading platform events\n- **PumpSwap**: PumpFun's swap protocol events\n- **Bonk**: Token launch platform events (letsbonk.fun)\n- **Raydium CPMM**: Raydium's Concentrated Pool Market Maker events\n- **Raydium CLMM**: Raydium's Concentrated Liquidity Market Maker events\n- **Raydium AMM V4**: Raydium's Automated Market Maker V4 events\n\n### Advanced Features\n- **Event Parsing System**: Automatic parsing and categorization of protocol-specific events\n- **Account State Monitoring**: Real-time monitoring of protocol account states and configuration changes\n- **Transaction \u0026 Account Event Filtering**: Separate filtering for transaction events and account state changes\n- **Dynamic Subscription Management**: Runtime filter updates without reconnection, enabling adaptive monitoring strategies\n- **Multi-Filter Support**: Support for multiple transaction and account filters in a single subscription\n- **Advanced Account Filtering**: Memcmp filters for precise account data matching and monitoring\n- **Token2022 Support**: Enhanced support for SPL Token 2022 with extended state parsing\n\n### Performance \u0026 Optimization\n- **High Performance**: Optimized for low-latency event processing\n- **Batch Processing Optimization**: Batch processing events to reduce callback overhead\n- **Performance Monitoring**: Built-in performance metrics monitoring, including event processing speed\n- **Memory Optimization**: Object pooling and caching mechanisms to reduce memory allocations\n- **Flexible Configuration System**: Support for custom batch sizes, backpressure strategies, channel sizes\n- **Preset Configurations**: High-throughput and low-latency preset configurations optimized for different use cases\n- **Backpressure Handling**: Supports blocking and dropping backpressure strategies\n- **Runtime Configuration Updates**: Dynamic configuration parameter updates at runtime\n- **Graceful Shutdown**: Support for programmatic stop() method for clean shutdown\n\n## ⚡ Installation\n\n### Direct Clone\n\nClone this project to your project directory:\n\n```bash\ncd your_project_root_directory\ngit clone https://github.com/0xfnzero/solana-streamer\n```\n\nAdd the dependency to your `Cargo.toml`:\n\n```toml\n# Add to your Cargo.toml\nsolana-streamer-sdk = { path = \"./solana-streamer\", version = \"1.2.0\" }\n```\n\n### Use crates.io\n\n```toml\n# Add to your Cargo.toml\nsolana-streamer-sdk = \"1.2.0\"\n```\n\n## 🔄 Migration Guide\n\n### Migrating from v0.5.x to v1.x.x\n\nVersion 1.0.0 introduces a major architectural change from trait-based event handling to enum-based events. This provides better type safety, improved performance, and simpler code patterns.\n\n**Key Changes:**\n\n1. **Event Type Changed** - `Box\u003cdyn UnifiedEvent\u003e` → `DexEvent` enum\n2. **Callback Signature** - Callbacks now receive concrete `DexEvent` instead of trait objects\n3. **Event Matching** - Use standard Rust `match` instead of `match_event!` macro\n4. **Metadata Access** - Event properties now accessed through `.metadata()` method\n\nFor detailed migration steps and code examples, see [MIGRATION.md](MIGRATION.md) or [MIGRATION_CN.md](MIGRATION_CN.md) (Chinese version).\n\n**Quick Migration Example:**\n\n```rust\n// Old (v0.5.x)\nlet callback = |event: Box\u003cdyn UnifiedEvent\u003e| {\n    println!(\"Event: {:?}\", event.event_type());\n};\n\n// New (v1.x.x)\nlet callback = |event: DexEvent| {\n    println!(\"Event: {:?}\", event.metadata().event_type);\n};\n```\n\n## ⚙️ Configuration System\n\nYou can customize client configuration:\n\n```rust\nuse solana_streamer_sdk::streaming::grpc::ClientConfig;\n\n// Use default configuration\nlet grpc = YellowstoneGrpc::new(endpoint, token)?;\n\n// Or create custom configuration\nlet mut config = ClientConfig::default();\nconfig.enable_metrics = true;  // Enable performance monitoring\nconfig.connection.connect_timeout = 30;  // 30 seconds\nconfig.connection.request_timeout = 120;  // 120 seconds\n\nlet grpc = YellowstoneGrpc::new_with_config(endpoint, token, config)?;\n```\n\n**Available Configuration Options:**\n- `enable_metrics`: Enable/disable performance monitoring (default: false)\n- `connection.connect_timeout`: Connection timeout in seconds (default: 10)\n- `connection.request_timeout`: Request timeout in seconds (default: 60)\n- `connection.max_decoding_message_size`: Maximum message size in bytes (default: 10MB)\n\n## 📚 Usage Examples\n\n### Usage Examples Summary Table\n\n| Description | Run Command | Source Path |\n|------|---------|----------|\n| Monitor transaction events using Yellowstone gRPC | `cargo run --example grpc_example` | [examples/grpc_example.rs](examples/grpc_example.rs) |\n| Monitor transaction events using ShredStream | `cargo run --example shred_example` | [examples/shred_example.rs](examples/shred_example.rs) |\n| Parse Solana mainnet transaction data | `cargo run --example parse_tx_events` | [examples/parse_tx_events.rs](examples/parse_tx_events.rs) |\n| Update filters at runtime | `cargo run --example dynamic_subscription` | [examples/dynamic_subscription.rs](examples/dynamic_subscription.rs) |\n| Monitor specific token account balance changes | `cargo run --example token_balance_listen_example` | [examples/token_balance_listen_example.rs](examples/token_balance_listen_example.rs) |\n| Track nonce account state changes | `cargo run --example nonce_listen_example` | [examples/nonce_listen_example.rs](examples/nonce_listen_example.rs) |\n| Monitor PumpSwap pool accounts using memcmp filters | `cargo run --example pumpswap_pool_account_listen_example` | [examples/pumpswap_pool_account_listen_example.rs](examples/pumpswap_pool_account_listen_example.rs) |\n| Monitor all associated token accounts for specific mints using memcmp filters | `cargo run --example mint_all_ata_account_listen_example` | [examples/mint_all_ata_account_listen_example.rs](examples/mint_all_ata_account_listen_example.rs) |\n\n### Event Filtering\n\nThe library supports flexible event filtering to reduce processing overhead and improve performance:\n\n#### Basic Filtering\n\n```rust\nuse solana_streamer_sdk::streaming::event_parser::common::{filter::EventTypeFilter, EventType};\n\n// No filtering - receive all events\nlet event_type_filter = None;\n\n// Filter specific event types - only receive PumpSwap buy/sell events\nlet event_type_filter = Some(EventTypeFilter { \n    include: vec![EventType::PumpSwapBuy, EventType::PumpSwapSell] \n});\n```\n\n#### Performance Impact\n\nEvent filtering can provide significant performance improvements:\n- **60-80% reduction** in unnecessary event processing\n- **Lower memory usage** by filtering out irrelevant events\n- **Reduced network bandwidth** in distributed setups\n- **Better focus** on events that matter to your application\n\n#### Filtering Examples by Use Case\n\n**Trading Bot (Focus on Trade Events)**\n```rust\nlet event_type_filter = Some(EventTypeFilter { \n    include: vec![\n        EventType::PumpSwapBuy,\n        EventType::PumpSwapSell,\n        EventType::PumpFunTrade,\n        EventType::RaydiumCpmmSwap,\n        EventType::RaydiumClmmSwap,\n        EventType::RaydiumAmmV4Swap,\n        ......\n    ] \n});\n```\n\n**Pool Monitoring (Focus on Liquidity Events)**\n```rust\nlet event_type_filter = Some(EventTypeFilter { \n    include: vec![\n        EventType::PumpSwapCreatePool,\n        EventType::PumpSwapDeposit,\n        EventType::PumpSwapWithdraw,\n        EventType::RaydiumCpmmInitialize,\n        EventType::RaydiumCpmmDeposit,\n        EventType::RaydiumCpmmWithdraw,\n        EventType::RaydiumClmmCreatePool,\n        ......\n    ] \n});\n```\n\n## Dynamic Subscription Management\n\nUpdate subscription filters at runtime without reconnecting to the stream.\n\n```rust\n// Update filters on existing subscription\ngrpc.update_subscription(\n    vec![TransactionFilter {\n        account_include: vec![\"new_program_id\".to_string()],\n        account_exclude: vec![],\n        account_required: vec![],\n    }],\n    vec![AccountFilter {\n        account: vec![],\n        owner: vec![],\n        filters: vec![],\n    }],\n).await?;\n```\n\n- **No Reconnection**: Filter changes apply immediately without closing the stream\n- **Atomic Updates**: Both transaction and account filters updated together\n- **Single Subscription**: One active subscription per client instance\n- **Compatible**: Works with both immediate and advanced subscription methods\n\nNote: Multiple subscription attempts on the same client return an error.\n\n## 🔧 Supported Protocols\n\n- **PumpFun**: Primary meme coin trading platform\n- **PumpSwap**: PumpFun's swap protocol\n- **Bonk**: Token launch platform (letsbonk.fun)\n- **Raydium CPMM**: Raydium's Concentrated Pool Market Maker protocol\n- **Raydium CLMM**: Raydium's Concentrated Liquidity Market Maker protocol\n- **Raydium AMM V4**: Raydium's Automated Market Maker V4 protocol\n\n## 🌐 Event Streaming Services\n\n- **Yellowstone gRPC**: High-performance Solana event streaming\n- **ShredStream**: Alternative event streaming protocol\n\n## 🏗️ Architecture Features\n\n### Unified Event Interface\n\n- **DexEvent Enum**: Type-safe enum containing all protocol events\n- **Protocol Enum**: Easy identification of event sources\n- **Event Factory**: Automatic event parsing and categorization\n\n### Event Parsing System\n\n- **Protocol-specific Parsers**: Dedicated parsers for each supported protocol\n- **Event Factory**: Centralized event creation and parsing\n- **Extensible Design**: Easy to add new protocols and event types\n\n### Streaming Infrastructure\n\n- **Yellowstone gRPC Client**: Optimized for Solana event streaming\n- **ShredStream Client**: Alternative streaming implementation\n- **Async Processing**: Non-blocking event handling\n\n## 📁 Project Structure\n\n```\nsrc/\n├── common/           # Common functionality and types\n├── protos/           # Protocol buffer definitions\n├── streaming/        # Event streaming system\n│   ├── event_parser/ # Event parsing system\n│   │   ├── common/   # Common event parsing tools\n│   │   ├── core/     # Core parsing traits and interfaces\n│   │   ├── protocols/# Protocol-specific parsers\n│   │   │   ├── bonk/ # Bonk event parsing\n│   │   │   ├── pumpfun/ # PumpFun event parsing\n│   │   │   ├── pumpswap/ # PumpSwap event parsing\n│   │   │   ├── raydium_amm_v4/ # Raydium AMM V4 event parsing\n│   │   │   ├── raydium_cpmm/ # Raydium CPMM event parsing\n│   │   │   └── raydium_clmm/ # Raydium CLMM event parsing\n│   │   └── factory.rs # Parser factory\n│   ├── shred_stream.rs # ShredStream client\n│   ├── yellowstone_grpc.rs # Yellowstone gRPC client\n│   └── yellowstone_sub_system.rs # Yellowstone subsystem\n├── lib.rs            # Main library file\n└── main.rs           # Example program\n```\n\n## ⚡ Performance Considerations\n\n1. **Connection Management**: Properly handle connection lifecycle and reconnection\n2. **Event Filtering**: Use protocol filtering to reduce unnecessary event processing\n3. **Memory Management**: Implement appropriate cleanup for long-running streams\n4. **Error Handling**: Robust error handling for network issues and service interruptions\n5. **Batch Processing Optimization**: Use batch processing to reduce callback overhead and improve throughput\n6. **Performance Monitoring**: Enable performance monitoring to identify bottlenecks and optimization opportunities\n7. **Graceful Shutdown**: Use the stop() method for clean shutdown and implement signal handlers for proper resource cleanup\n\n---\n\n## 📄 License\n\nMIT License\n\n## 📞 Contact\n\n- **Website**: https://fnzero.dev/\n- **Project Repository**: https://github.com/0xfnzero/solana-streamer\n- **Telegram Group**: https://t.me/fnzero_group\n- **Discord**: https://discord.gg/vuazbGkqQE\n\n## ⚠️ Important Notes\n\n1. **Network Stability**: Ensure stable network connection for continuous event streaming\n2. **Rate Limiting**: Be aware of rate limits on public gRPC endpoints\n3. **Error Recovery**: Implement proper error handling and reconnection logic\n5. **Compliance**: Ensure compliance with relevant laws and regulations\n\n## Language Versions\n\n- [English](README.md)\n- [中文](README_CN.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xfnzero%2Fsolana-streamer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xfnzero%2Fsolana-streamer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xfnzero%2Fsolana-streamer/lists"}