{"id":31322910,"url":"https://github.com/0xfnzero/sol-parser-sdk","last_synced_at":"2026-05-24T21:01:54.301Z","repository":{"id":316093057,"uuid":"1061620005","full_name":"0xfnzero/sol-parser-sdk","owner":"0xfnzero","description":"A lightweight Rust library providing efficient event parsing and subscription capabilities for PumpFun, PumpSwap, Bonk, and Raydium protocols.","archived":false,"fork":false,"pushed_at":"2026-05-13T18:35:36.000Z","size":1555,"stargazers_count":34,"open_issues_count":1,"forks_count":23,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-05-13T20:27:41.522Z","etag":null,"topics":["bonk","copy-trading-bot","grpc","jito","letsbonk","pumpfun","pumpswap","raydium","raydium-launchlab","raydium-launchpad","shreds","shredstream","sniper","streaming","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-09-22T06:57:54.000Z","updated_at":"2026-05-13T18:35:41.000Z","dependencies_parsed_at":"2025-09-22T17:50:19.883Z","dependency_job_id":null,"html_url":"https://github.com/0xfnzero/sol-parser-sdk","commit_stats":null,"previous_names":["0xfnzero/sol-parser-sdk"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/0xfnzero/sol-parser-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xfnzero%2Fsol-parser-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xfnzero%2Fsol-parser-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xfnzero%2Fsol-parser-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xfnzero%2Fsol-parser-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xfnzero","download_url":"https://codeload.github.com/0xfnzero/sol-parser-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xfnzero%2Fsol-parser-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33444703,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-24T13:13:05.286Z","status":"ssl_error","status_checked_at":"2026-05-24T13:13:03.728Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["bonk","copy-trading-bot","grpc","jito","letsbonk","pumpfun","pumpswap","raydium","raydium-launchlab","raydium-launchpad","shreds","shredstream","sniper","streaming","yellowstone","yellowstonegrpc"],"created_at":"2025-09-25T19:29:06.518Z","updated_at":"2026-05-24T21:01:54.293Z","avatar_url":"https://github.com/0xfnzero.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003ch1\u003e⚡ Sol Parser SDK\u003c/h1\u003e\n    \u003ch3\u003e\u003cem\u003eUltra-low latency Solana DEX event parser with SIMD optimization\u003c/em\u003e\u003c/h3\u003e\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cstrong\u003eHigh-performance Rust library for parsing Solana DEX events with microsecond-level latency\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://crates.io/crates/sol-parser-sdk\"\u003e\n        \u003cimg src=\"https://img.shields.io/crates/v/sol-parser-sdk.svg\" alt=\"Crates.io\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://docs.rs/sol-parser-sdk\"\u003e\n        \u003cimg src=\"https://docs.rs/sol-parser-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\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/SIMD-FF6B6B?style=for-the-badge\u0026logo=intel\u0026logoColor=white\" alt=\"SIMD\"\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=\"https://github.com/0xfnzero/sol-parser-sdk/blob/main/README_CN.md\"\u003e中文\u003c/a\u003e |\n    \u003ca href=\"https://github.com/0xfnzero/sol-parser-sdk/blob/main/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\u003e ☕ **Support This Project**\n\u003e\n\u003e This SDK is completely free and open source. However, maintaining and continuously updating it requires significant AI computing resources and token consumption. If this SDK helps with your development, consider making a monthly SOL donation — any amount is appreciated and helps keep this project alive!\n\u003e\n\u003e **Donation Wallet:** `6oW7AXz1yRb57pYSxysuXnMs2aR1ha5rzGzReZ1MjPV8`\n\n---\n\n## 📦 SDK Versions\n\nThis SDK is available in multiple languages:\n\n| Language | Repository | Description |\n|----------|------------|-------------|\n| **Rust** | [sol-parser-sdk](https://github.com/0xfnzero/sol-parser-sdk) | Ultra-low latency with SIMD optimization |\n| **Node.js** | [sol-parser-sdk-nodejs](https://github.com/0xfnzero/sol-parser-sdk-nodejs) | TypeScript/JavaScript for Node.js |\n| **Python** | [sol-parser-sdk-python](https://github.com/0xfnzero/sol-parser-sdk-python) | Async/await native support |\n| **Go** | [sol-parser-sdk-golang](https://github.com/0xfnzero/sol-parser-sdk-golang) | Concurrent-safe with goroutine support |\n\n---\n\n## 📊 Performance Highlights\n\n### ⚡ Ultra-Low Latency\n- **10-20μs** parsing latency in release mode\n- **Zero-copy** parsing with stack-allocated buffers\n- **SIMD-accelerated** pattern matching (memchr)\n- **Lock-free** ArrayQueue for event delivery\n\n### 🎚️ Flexible Order Modes\n| Mode | Latency | Description |\n|------|---------|-------------|\n| **Unordered** | 10-20μs | Immediate output, ultra-low latency |\n| **MicroBatch** | 50-200μs | Micro-batch ordering with time window |\n| **StreamingOrdered** | 0.1-5ms | Stream ordering with continuous sequence release |\n| **Ordered** | 1-50ms | Full slot ordering, wait for complete slot |\n\n### 🚀 Optimization Highlights\n- ✅ **Zero heap allocation** for hot paths\n- ✅ **SIMD pattern matching** for all protocol detection\n- ✅ **Static pre-compiled finders** for string search\n- ✅ **Inline functions** with aggressive optimization\n- ✅ **Event type filtering** for targeted parsing\n- ✅ **Conditional Create detection** (only when needed)\n- ✅ **Multiple order modes** for latency vs ordering trade-off\n\n---\n\n## 🔥 Quick Start\n\n### Installation\n\nClone the repository:\n\n```bash\ncd your_project_dir\ngit clone https://github.com/0xfnzero/sol-parser-sdk\n```\n\nAdd to your `Cargo.toml`:\n\n```toml\n[dependencies]\n# Default: Borsh parser\nsol-parser-sdk = { path = \"../sol-parser-sdk\" }\n\n# Or: Zero-copy parser (maximum performance)\nsol-parser-sdk = { path = \"../sol-parser-sdk\", default-features = false, features = [\"parse-zero-copy\"] }\n```\n\n### Use crates.io\n\n```toml\n# Add to your Cargo.toml\nsol-parser-sdk = \"0.4.16\"\n```\n\nOr with the zero-copy parser (maximum performance):\n\n```toml\nsol-parser-sdk = { version = \"0.4.16\", default-features = false, features = [\"parse-zero-copy\"] }\n```\n\n### Performance Testing\n\nTest parsing latency with the optimized examples:\n\n```bash\n# PumpFun with detailed metrics (per-event + 10s stats)\ncargo run --example pumpfun_with_metrics --release\n\n# PumpSwap with detailed metrics (per-event + 10s stats)\ncargo run --example pumpswap_with_metrics --release\n\n# PumpSwap ultra-low latency test\ncargo run --example pumpswap_low_latency --release\n\n# PumpSwap with MicroBatch ordering\ncargo run --example pumpswap_ordered --release\n\n# Expected output:\n# gRPC receive time: 1234567890 μs\n# Event receive time: 1234567900 μs\n# Latency: 10 μs  \u003c-- Ultra-low latency!\n```\n\n### Examples\n\n| Description | Run Command | Source Code |\n|-------------|-------------|-------------|\n| **PumpFun** | | |\n| PumpFun event parsing with metrics | `cargo run --example pumpfun_with_metrics --release` | [examples/pumpfun_with_metrics.rs](https://github.com/0xfnzero/sol-parser-sdk/blob/main/examples/pumpfun_with_metrics.rs) |\n| PumpFun trade type filtering | `cargo run --example pumpfun_trade_filter --release` | [examples/pumpfun_trade_filter.rs](https://github.com/0xfnzero/sol-parser-sdk/blob/main/examples/pumpfun_trade_filter.rs) |\n| PumpFun trade with ordered mode | `cargo run --example pumpfun_trade_filter_ordered --release` | [examples/pumpfun_trade_filter_ordered.rs](https://github.com/0xfnzero/sol-parser-sdk/blob/main/examples/pumpfun_trade_filter_ordered.rs) |\n| Quick PumpFun connection test | `cargo run --example pumpfun_quick_test --release` | [examples/pumpfun_quick_test.rs](https://github.com/0xfnzero/sol-parser-sdk/blob/main/examples/pumpfun_quick_test.rs) |\n| Parse PumpFun tx by signature | `TX_SIGNATURE=\u003csig\u003e cargo run --example parse_pump_tx --release` | [examples/parse_pump_tx.rs](https://github.com/0xfnzero/sol-parser-sdk/blob/main/examples/parse_pump_tx.rs) |\n| Debug PumpFun transaction | `cargo run --example debug_pump_tx --release` | [examples/debug_pump_tx.rs](https://github.com/0xfnzero/sol-parser-sdk/blob/main/examples/debug_pump_tx.rs) |\n| **PumpSwap** | | |\n| PumpSwap events with metrics | `cargo run --example pumpswap_with_metrics --release` | [examples/pumpswap_with_metrics.rs](https://github.com/0xfnzero/sol-parser-sdk/blob/main/examples/pumpswap_with_metrics.rs) |\n| PumpSwap ultra-low latency | `cargo run --example pumpswap_low_latency --release` | [examples/pumpswap_low_latency.rs](https://github.com/0xfnzero/sol-parser-sdk/blob/main/examples/pumpswap_low_latency.rs) |\n| PumpSwap with MicroBatch ordering | `cargo run --example pumpswap_ordered --release` | [examples/pumpswap_ordered.rs](https://github.com/0xfnzero/sol-parser-sdk/blob/main/examples/pumpswap_ordered.rs) |\n| Parse PumpSwap tx by signature | `TX_SIGNATURE=\u003csig\u003e cargo run --example parse_pumpswap_tx --release` | [examples/parse_pumpswap_tx.rs](https://github.com/0xfnzero/sol-parser-sdk/blob/main/examples/parse_pumpswap_tx.rs) |\n| Debug PumpSwap transaction | `cargo run --example debug_pumpswap_tx --release` | [examples/debug_pumpswap_tx.rs](https://github.com/0xfnzero/sol-parser-sdk/blob/main/examples/debug_pumpswap_tx.rs) |\n| **Meteora DAMM** | | |\n| Meteora DAMM V2 events | `cargo run --example meteora_damm_grpc --release` | [examples/meteora_damm_grpc.rs](https://github.com/0xfnzero/sol-parser-sdk/blob/main/examples/meteora_damm_grpc.rs) |\n| Parse Meteora DAMM tx by signature | `TX_SIGNATURE=\u003csig\u003e cargo run --example parse_meteora_damm_tx --release` | [examples/parse_meteora_damm_tx.rs](https://github.com/0xfnzero/sol-parser-sdk/blob/main/examples/parse_meteora_damm_tx.rs) |\n| **Account subscription** | | |\n| Token account balance updates | `TOKEN_ACCOUNT=\u003cpubkey\u003e cargo run --example token_balance_listen --release` | [examples/token_balance_listen.rs](https://github.com/0xfnzero/sol-parser-sdk/blob/main/examples/token_balance_listen.rs) |\n| Nonce account state changes | `NONCE_ACCOUNT=\u003cpubkey\u003e cargo run --example nonce_listen --release` | [examples/nonce_listen.rs](https://github.com/0xfnzero/sol-parser-sdk/blob/main/examples/nonce_listen.rs) |\n| Mint account info | `MINT_ACCOUNT=\u003cpubkey\u003e cargo run --example token_decimals_listen --release` | [examples/token_decimals_listen.rs](https://github.com/0xfnzero/sol-parser-sdk/blob/main/examples/token_decimals_listen.rs) |\n| PumpSwap pool accounts via memcmp | `cargo run --example pumpswap_pool_account_listen --release` | [examples/pumpswap_pool_account_listen.rs](https://github.com/0xfnzero/sol-parser-sdk/blob/main/examples/pumpswap_pool_account_listen.rs) |\n| All ATAs for mints | `cargo run --example mint_all_ata_account_listen --release` | [examples/mint_all_ata_account_listen.rs](https://github.com/0xfnzero/sol-parser-sdk/blob/main/examples/mint_all_ata_account_listen.rs) |\n| **ShredStream** | | |\n| Jito ShredStream subscription | `cargo run --example shredstream_example --release` | [examples/shredstream_example.rs](https://github.com/0xfnzero/sol-parser-sdk/blob/main/examples/shredstream_example.rs) |\n| **Utility** | | |\n| Dynamic subscription filters | `cargo run --example dynamic_subscription --release` | [examples/dynamic_subscription.rs](https://github.com/0xfnzero/sol-parser-sdk/blob/main/examples/dynamic_subscription.rs) |\n| Debug PumpSwap account filling | `cargo run --example test_account_filling --release` | [examples/test_account_filling.rs](https://github.com/0xfnzero/sol-parser-sdk/blob/main/examples/test_account_filling.rs) |\n\n### Basic Usage\n\n```rust\nuse sol_parser_sdk::grpc::{\n    AccountFilter, ClientConfig, EventType, EventTypeFilter, OrderMode, Protocol,\n    TransactionFilter, YellowstoneGrpc,\n};\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    // Create gRPC client with default config (Unordered mode)\n    let grpc = YellowstoneGrpc::new(\n        \"https://solana-yellowstone-grpc.publicnode.com:443\".to_string(),\n        None,\n    )?;\n    \n    // Or with custom config for ordered events\n    let config = ClientConfig {\n        order_mode: OrderMode::MicroBatch,  // Low latency + ordering\n        micro_batch_us: 100,                // 100μs batch window\n        ..ClientConfig::default()\n    };\n    let grpc = YellowstoneGrpc::new_with_config(\n        \"https://solana-yellowstone-grpc.publicnode.com:443\".to_string(),\n        None,\n        config,\n    )?;\n\n    let protocols = vec![Protocol::PumpFun, Protocol::PumpSwap, Protocol::RaydiumCpmm];\n    let transaction_filter = TransactionFilter::for_protocols(\u0026protocols);\n    let account_filter = AccountFilter::for_protocols(\u0026protocols);\n\n    // Filter before parsing for the lowest-latency path.\n    let event_filter = EventTypeFilter::include_only(vec![\n        EventType::PumpFunBuy,\n        EventType::PumpFunSell,\n        EventType::PumpSwapBuy,\n        EventType::PumpSwapSell,\n        EventType::RaydiumCpmmSwap,\n    ]);\n\n    // Subscribe and get lock-free queue\n    let queue = grpc.subscribe_dex_events(\n        vec![transaction_filter],\n        vec![account_filter],\n        Some(event_filter),\n    ).await?;\n\n    // Consume events with minimal latency\n    tokio::spawn(async move {\n        let mut spin_count = 0;\n        loop {\n            if let Some(event) = queue.pop() {\n                spin_count = 0;\n                // Process event (10-20μs latency!)\n                println!(\"{:?}\", event);\n            } else {\n                // Hybrid spin-wait strategy\n                spin_count += 1;\n                if spin_count \u003c 1000 {\n                    std::hint::spin_loop();\n                } else {\n                    tokio::task::yield_now().await;\n                    spin_count = 0;\n                }\n            }\n        }\n    });\n\n    Ok(())\n}\n```\n\n### ShredStream Usage (Jito)\n\nShredStream provides ultra-low latency (~50-100ms faster than gRPC) by directly subscribing to Jito's ShredStream service:\n\n```rust\nuse sol_parser_sdk::grpc::{EventType, EventTypeFilter};\nuse sol_parser_sdk::shredstream::{ShredStreamClient, ShredStreamConfig};\nuse sol_parser_sdk::DexEvent;\nuse std::sync::Arc;\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    // Create ShredStream client\n    let client = ShredStreamClient::new(\"http://127.0.0.1:10800\").await?;\n\n    // Or with custom config\n    let config = ShredStreamConfig {\n        connection_timeout_ms: 5000,\n        request_timeout_ms: 30000,\n        max_decoding_message_size: 1024 * 1024 * 1024,\n        reconnect_delay_ms: 1000,\n        max_reconnect_attempts: 0, // 0 = infinite reconnect\n    };\n    let client = ShredStreamClient::new_with_config(\"http://127.0.0.1:10800\", config).await?;\n\n    // Subscribe with SDK-side filtering before event conversion.\n    // Use `client.subscribe().await?` to receive every supported event.\n    let event_filter = EventTypeFilter::include_only(vec![\n        EventType::PumpFunBuy,\n        EventType::PumpSwapBuy,\n        EventType::RaydiumCpmmSwap,\n    ]);\n    let queue = client.subscribe_with_filter(Some(event_filter)).await?;\n\n    // Consume events\n    loop {\n        if let Some(event) = queue.pop() {\n            match \u0026event {\n                DexEvent::PumpFunTrade(e) =\u003e {\n                    println!(\"PumpFun Trade: mint={}, is_buy={}\", e.mint, e.is_buy);\n                }\n                DexEvent::PumpSwapBuy(e) =\u003e {\n                    println!(\"PumpSwap Buy: pool={}\", e.pool);\n                }\n                _ =\u003e {}\n            }\n        } else {\n            std::hint::spin_loop();\n        }\n    }\n}\n```\n\n**ShredStream Limitations:**\n- Only `static_account_keys()` - transactions using ALT may have incorrect accounts\n- No Inner Instructions - cannot parse CPI calls\n- No block_time - always 0\n- tx_index is entry-level, not slot-level\n\n---\n\n## 🏗️ Supported Protocols\n\n### DEX Protocols\n- ✅ **PumpFun** - Meme coin trading (ultra-fast zero-copy path, incl. v2 instructions)\n- ✅ **Pump Fees** - Pump fee-sharing configuration events\n- ✅ **PumpSwap** - PumpFun swap protocol\n- ✅ **Raydium Launchpad / Bonk** - Token launch platform\n- ✅ **Raydium AMM V4** - Automated Market Maker\n- ✅ **Raydium CLMM** - Concentrated Liquidity\n- ✅ **Raydium CPMM** - Concentrated Pool\n- ✅ **Orca Whirlpool** - Concentrated liquidity AMM\n- ✅ **Meteora Pools** - Dynamic AMM\n- ✅ **Meteora DAMM v2** - Dynamic AMM V2\n- ✅ **Meteora DLMM** - Dynamic Liquidity Market Maker\n\n### Event Types\nEach protocol supports:\n- 📈 **Trade/Swap Events** - Buy/sell transactions\n- 💧 **Liquidity Events** - Deposits/withdrawals\n- 🏊 **Pool Events** - Pool creation/initialization\n- 🎯 **Position Events** - Open/close positions (CLMM)\n\n---\n\n## ⚡ Performance Features\n\n### Zero-Copy Parsing\n```rust\n// Stack-allocated 512-byte buffer for PumpFun Trade\nconst MAX_DECODE_SIZE: usize = 512;\nlet mut decode_buf: [u8; MAX_DECODE_SIZE] = [0u8; MAX_DECODE_SIZE];\n\n// Decode directly to stack, no heap allocation\ngeneral_purpose::STANDARD\n    .decode_slice(data_part.as_bytes(), \u0026mut decode_buf)\n    .ok()?;\n```\n\n### SIMD Pattern Matching\n```rust\n// Pre-compiled SIMD finders (initialized once)\nstatic PUMPFUN_FINDER: Lazy\u003cmemmem::Finder\u003e =\n    Lazy::new(|| memmem::Finder::new(b\"6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P\"));\n\n// 3-10x faster than .contains()\nif PUMPFUN_FINDER.find(log_bytes).is_some() {\n    return LogType::PumpFun;\n}\n```\n\n### Event Type Filtering\n```rust\n// Ultra-fast path for single event type\nif include_only.len() == 1 \u0026\u0026 include_only[0] == EventType::PumpFunTrade {\n    if log_type == LogType::PumpFun {\n        return parse_pumpfun_trade(  // Zero-copy path\n            log, signature, slot, block_time, grpc_recv_us, is_created_buy\n        );\n    }\n}\n```\n\n### Lock-Free Queue\n```rust\n// ArrayQueue with 100,000 capacity\nlet queue = Arc::new(ArrayQueue::\u003cDexEvent\u003e::new(100_000));\n\n// Non-blocking push/pop (no mutex overhead)\nlet _ = queue.push(event);\nif let Some(event) = queue.pop() {\n    // Process event\n}\n```\n\n---\n\n## 🎯 Event Filtering\n\nReduce processing overhead by filtering specific events:\n\n### Example: Trading Bot\n```rust\nlet event_filter = EventTypeFilter::include_only(vec![\n    EventType::PumpFunBuy,\n    EventType::PumpFunSell,\n    EventType::PumpFunBuyExactSolIn,\n    EventType::PumpSwapBuy,\n    EventType::PumpSwapSell,\n    EventType::BonkTrade,\n    EventType::RaydiumCpmmSwap,\n    EventType::RaydiumAmmV4Swap,\n    EventType::RaydiumClmmSwap,\n    EventType::OrcaWhirlpoolSwap,\n    EventType::MeteoraPoolsSwap,\n    EventType::MeteoraDammV2Swap,\n    EventType::MeteoraDlmmSwap,\n]);\n```\n\n### Example: Pool Monitor\n```rust\nlet event_filter = EventTypeFilter::include_only(vec![\n    EventType::PumpFunCreate,\n    EventType::PumpFeesUpdateFeeShares,\n    EventType::PumpSwapCreatePool,\n    EventType::RaydiumCpmmInitialize,\n    EventType::RaydiumClmmCreatePool,\n    EventType::OrcaWhirlpoolPoolInitialized,\n    EventType::MeteoraPoolsPoolCreated,\n    EventType::MeteoraDammV2CreatePosition,\n    EventType::MeteoraDlmmInitializePool,\n]);\n```\n\n**Performance Impact:**\n- 60-80% reduction in processing\n- Lower memory usage\n- Reduced network bandwidth\n\n---\n\n## 🔧 Advanced Features\n\n### Create+Buy Detection\nAutomatically detects when a token is created and immediately bought in the same transaction:\n\n```rust\n// Detects \"Program data: GB7IKAUcB3c...\" pattern\nlet has_create = detect_pumpfun_create(logs);\n\n// Sets is_created_buy flag on Trade events\nif has_create {\n    trade_event.is_created_buy = true;\n}\n```\n\n### Pump.fun Bonding Curve v2 (buy_v2 / sell_v2 / buy_exact_quote_in_v2)\n\nThe SDK recognizes Pump.fun's new v2 trading instructions introduced in the Bonding Curve upgrade. Event logs from `buy_v2`, `sell_v2`, and `buy_exact_quote_in_v2` are parsed with the same zero-copy path and mapped to the existing event types:\n\n| ix_name in TradeEvent | DexEvent Variant |\n|----------------------|-----------------|\n| `\"buy\"` / `\"buy_v2\"` / `\"buy_exact_quote_in\"` / `\"buy_exact_quote_in_v2\"` | `DexEvent::PumpFunBuy` |\n| `\"sell\"` / `\"sell_v2\"` | `DexEvent::PumpFunSell` |\n| `\"buy_exact_sol_in\"` | `DexEvent::PumpFunBuyExactSolIn` |\n\nNo changes are required in your event handling code — v2 events arrive through the same `PumpFunTradeEvent` struct with the correct `ix_name` field populated. Instruction discriminators for `buy_v2` (`[184, 23, 238, 97, 103, 197, 211, 61]`), `sell_v2` (`[93, 246, 130, 60, 231, 233, 64, 178]`), and `buy_exact_quote_in_v2` (`[194, 171, 28, 70, 104, 77, 91, 47]`) are recognized at the instruction parser level.\n\n`CreateEvent` also exposes `quote_mint` and `virtual_quote_reserves`, so USDC quote pools can be distinguished from native SOL pools and initialized with the correct quote-side reserve.\n\n### Dynamic Subscription\nUpdate filters without reconnecting:\n\n```rust\ngrpc.update_subscription(\n    vec![new_transaction_filter],\n    vec![new_account_filter],\n).await?;\n```\n\n### Order Modes\nChoose the right balance between latency and ordering:\n\n```rust\nuse sol_parser_sdk::grpc::{ClientConfig, OrderMode};\n\n// Ultra-low latency (no ordering guarantee)\nlet config = ClientConfig {\n    order_mode: OrderMode::Unordered,\n    ..ClientConfig::default()\n};\n\n// Low latency with micro-batch ordering (50-200μs)\nlet config = ClientConfig {\n    order_mode: OrderMode::MicroBatch,\n    micro_batch_us: 100,  // 100μs batch window\n    ..ClientConfig::default()\n};\n\n// Stream ordering with continuous sequence release (0.1-5ms)\nlet config = ClientConfig {\n    order_mode: OrderMode::StreamingOrdered,\n    order_timeout_ms: 50,  // Timeout for incomplete sequences\n    ..ClientConfig::default()\n};\n\n// Full slot ordering (1-50ms, wait for complete slot)\nlet config = ClientConfig {\n    order_mode: OrderMode::Ordered,\n    order_timeout_ms: 100,\n    ..ClientConfig::default()\n};\n```\n\n### Performance Metrics\n```rust\nlet config = ClientConfig {\n    enable_metrics: true,\n    ..ClientConfig::default()\n};\n\nlet grpc = YellowstoneGrpc::new_with_config(endpoint, token, config)?;\n```\n\n---\n\n## 📁 Project Structure\n\n```\nsrc/\n├── core/\n│   └── events.rs          # Event definitions\n├── grpc/\n│   ├── client.rs          # Yellowstone gRPC client\n│   ├── buffers.rs         # SlotBuffer \u0026 MicroBatchBuffer\n│   └── types.rs           # OrderMode, ClientConfig, filters\n├── shredstream/\n│   ├── client.rs          # Jito ShredStream client\n│   ├── config.rs          # ShredStreamConfig\n│   └── proto/             # Protobuf definitions\n├── logs/\n│   ├── optimized_matcher.rs  # SIMD log detection\n│   ├── zero_copy_parser.rs   # Zero-copy parsing\n│   ├── pumpfun.rs         # PumpFun parser\n│   ├── raydium_*.rs       # Raydium parsers\n│   ├── orca_*.rs          # Orca parsers\n│   └── meteora_*.rs       # Meteora parsers\n├── instr/\n│   └── *.rs               # Instruction parsers\n├── warmup/\n│   └── mod.rs             # Parser warmup (auto-called)\n└── lib.rs\n```\n\n---\n\n## 🚀 Optimization Techniques\n\n### 1. **SIMD String Matching**\n- Replaced all `.contains()` with `memmem::Finder`\n- 3-10x performance improvement\n- Pre-compiled static finders\n\n### 2. **Zero-Copy Parsing**\n- Stack-allocated buffers (512 bytes)\n- No heap allocation in hot path\n- Inline helper functions\n\n### 3. **Event Type Filtering**\n- Early filtering at protocol level\n- Conditional Create detection\n- Single-type ultra-fast path\n\n### 4. **Lock-Free Queue**\n- ArrayQueue (100K capacity)\n- Spin-wait hybrid strategy\n- No mutex overhead\n\n### 5. **Aggressive Inlining**\n```rust\n#[inline(always)]\nfn read_u64_le_inline(data: \u0026[u8], offset: usize) -\u003e Option\u003cu64\u003e {\n    if offset + 8 \u003c= data.len() {\n        let mut bytes = [0u8; 8];\n        bytes.copy_from_slice(\u0026data[offset..offset + 8]);\n        Some(u64::from_le_bytes(bytes))\n    } else {\n        None\n    }\n}\n```\n\n---\n\n## 📊 Benchmarks\n\n### Parsing Latency (Release Mode)\n| Protocol | Avg Latency | Min | Max |\n|----------|-------------|-----|-----|\n| PumpFun Trade (zero-copy) | 10-15μs | 8μs | 20μs |\n| Raydium AMM V4 Swap | 15-20μs | 12μs | 25μs |\n| Orca Whirlpool Swap | 15-20μs | 12μs | 25μs |\n\n### SIMD Pattern Matching\n| Operation | Before (contains) | After (SIMD) | Speedup |\n|-----------|------------------|--------------|---------|\n| Protocol detection | 50-100ns | 10-20ns | 3-10x |\n| Create event detection | 150ns | 30ns | 5x |\n\n---\n\n## 📄 License\n\nMIT License\n\n## 📞 Contact\n\n- **Repository**: https://github.com/0xfnzero/solana-streamer\n- **Telegram**: https://t.me/fnzero_group\n- **Discord**: https://discord.gg/vuazbGkqQE\n\n---\n\n## ⚠️ Performance Tips\n\n1. **Use Event Filtering** - Filter at the source for 60-80% performance gain\n2. **Run in Release Mode** - `cargo build --release` for full optimization\n3. **Test with sudo** - `sudo cargo run --example basic --release` for accurate timing\n4. **Monitor Latency** - Check `grpc_recv_us` and queue latency in production\n5. **Tune Queue Size** - Adjust ArrayQueue capacity based on your throughput\n6. **Spin-Wait Strategy** - Tune spin count (default: 1000) for your use case\n\n## 🔬 Development\n\n```bash\n# Run tests\ncargo test\n\n# Build release binary\ncargo build --release\n\n# Generate docs\ncargo doc --open\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xfnzero%2Fsol-parser-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xfnzero%2Fsol-parser-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xfnzero%2Fsol-parser-sdk/lists"}