sol-parser-sdk 0.7.2

A lightweight Rust library for real-time event streaming from Solana DEX trading programs. Supports PumpFun, PumpSwap, Raydium LaunchLab, and Raydium protocols with Yellowstone gRPC and ShredStream.
Documentation
[package]
name = "sol-parser-sdk"
version = "0.7.2"
edition = "2021"
rust-version = "1.91"
authors = ["William <byteblock6@gmail.com>", "sgxiang <sgxiang@gmail.com>", "wei <1415121722@qq.com>"]
repository = "https://github.com/0xfnzero/sol-parser-sdk"
description = "A lightweight Rust library for real-time event streaming from Solana DEX trading programs. Supports PumpFun, PumpSwap, Raydium LaunchLab, and Raydium protocols with Yellowstone gRPC and ShredStream."
license = "MIT"
keywords = ["solana", "streaming", "events", "grpc", "shredstream"]
readme = "README.md"

[lib]
crate-type = ["rlib"]

[[example]]
name = "shredstream_pump_snipe"
path = "examples/shredstream_pump_snipe.rs"

[[bench]]
name = "zero_latency_optimizations"
harness = false

[[bench]]
name = "transaction_cost"
harness = false

[[bench]]
name = "pumpfun_balance_fill"
harness = false

[[bench]]
name = "log_instr_dedup"
harness = false
required-features = ["perf-stats"]

[[bench]]
name = "instruction_reject"
harness = false

[[bench]]
name = "pumpfun_create_detection"
harness = false

[[bench]]
name = "yellowstone_transaction"
harness = false

[[bench]]
name = "shred_entry_decode"
harness = false

[[bench]]
name = "rpc_transaction"
harness = false

[[bench]]
name = "rpc_pumpfun_transaction"
harness = false

[[bench]]
name = "protocol_transaction_corpus"
harness = false

[[bench]]
name = "micro_batch_buffer"
harness = false

[features]
default = ["parse-borsh"]  # 默认使用 Borsh 解析器(类型安全,易维护)

# 解析器插件选择;同时启用时优先使用 parse-zero-copy,默认仍使用 parse-borsh。
parse-borsh = []      # Borsh 反序列化解析器(推荐):类型安全、代码简洁、易维护
parse-zero-copy = []  # 零拷贝解析器(高性能):最快、零拷贝、适合超高频场景

# 其他功能
perf-stats = []   # 启用性能统计
ultra-perf = []   # 极限性能模式(启用所有 unsafe 优化)

[dependencies]
solana-sdk = "=4.0.1"
solana-client = "=4.2.2"
solana-transaction-status = { version = "=4.2.2", features = ["agave-unstable-api"] }
solana-transaction-error = { version = "=3.3.2", features = ["wincode"] }
solana-entry = { version = "=4.2.2", features = ["agave-unstable-api"] }
borsh = { version = "1.5.3", features = ["derive"] }
serde = { version = "1.0.215", features = ["derive"] }
serde-big-array = "0.5.1"
futures = "0.3.31"
base64 = "0.22.1"
base64-simd = "0.8"
# RPC inner-instruction decoding; keep the portable safe implementation on every target.
base58-turbo = { version = "0.3.0", default-features = false, features = ["std"] }
bs58 = "0.5.1"
memchr = "2.7"
wincode = "=0.5.5"
anyhow = "1.0.90"
yellowstone-grpc-client = "=13.5.0"
yellowstone-grpc-proto = "=12.7.0"
tokio = { version = "1.42.0", features = ["full"] }
tonic = { version = "0.14.5", features = ["transport"] }
tonic-prost = "0.14.5"
rustls = { version = "0.23.23", features = ["ring"], default-features = false }
log = "0.4.22"
chrono = "0.4.39"
once_cell = "1.20.3"
prost = "0.14.3"
crossbeam-queue = "0.3.12"
rayon = "1.10"
wide = "0.7"
spl-token = { version = "9.0.0", default-features = false, features = ["no-entrypoint"] }
spl-token-2022 = { version = "11.0.0", default-features = false, features = ["no-entrypoint"] }
# spl-list-view 0.1.0 does not compile with spl-pod 0.7.3.
spl-pod = "=0.7.2"
libc = "0.2"
smallvec = "1.13"  # 零延迟优化:栈分配小数组

[dev-dependencies]
criterion = { version = "0.7.0", features = ["html_reports"] }
serde_json = "1.0.134"
[profile.release]
opt-level = 3
lto = "thin"          # Thin LTO: 快速编译 + 良好优化(2-3分钟 vs 6分钟)
codegen-units = 16    # 并行编译(默认值,快速)
panic = 'abort'
strip = true
incremental = true    # 启用增量编译(后续编译更快)

[profile.release.package."*"]
opt-level = 3
codegen-units = 1

[profile.bench]
opt-level = 3
lto = "thin"
codegen-units = 1

# 极限性能配置文件(仅在需要榨取最后 5% 性能时使用,编译时间 6+ 分钟)
[profile.ultra-perf]
inherits = "release"
opt-level = 3
lto = "fat"              # 全局 LTO - 非常慢但最优
codegen-units = 1        # 单线程编译 - 最优但最慢
panic = 'abort'
strip = true
incremental = false      # 禁用增量编译
overflow-checks = false  # 禁用溢出检查