中文 | English | Website | Telegram | Discord
☕ Support This Project
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!
Donation Wallet:
6oW7AXz1yRb57pYSxysuXnMs2aR1ha5rzGzReZ1MjPV8
| Language | Repository |
|---|---|
| Rust | sol-parser-sdk |
| Node.js | sol-parser-sdk-nodejs |
| Python | sol-parser-sdk-python |
| Go | github.com/0xfnzero/sol-parser-sdk-golang |
This repo’s go.mod module path is github.com/0xfnzero/sol-parser-sdk-golang (see go.mod). Examples import github.com/0xfnzero/sol-parser-sdk-golang/solparser.
From source (recommended)
git clone https://github.com/0xfnzero/sol-parser-sdk-golang
cd sol-parser-sdk-golang
go mod tidyUse in another module
go get github.com/0xfnzero/sol-parser-sdk-golang@v0.4.4(Or use replace github.com/0xfnzero/sol-parser-sdk-golang => ../sol-parser-sdk-golang for local development.)
Yellowstone / Geyser gRPC (all examples that subscribe over gRPC use the same two names):
| Variable | Meaning |
|---|---|
GRPC_URL |
Endpoint host or full URL (e.g. https://solana-yellowstone-grpc.publicnode.com:443 or host:443). Parsed to host:port where needed. |
GRPC_TOKEN |
x-token (or empty if the node allows unauthenticated access). |
ShredStream (separate binary / HTTP-style endpoint — not the same as GRPC_URL):
| Variable | Meaning |
|---|---|
SHRED_URL |
e.g. http://127.0.0.1:10800 (plain-text gRPC to ShredStream proxy). |
Optional ShredStream tuning: SHRED_PARSE_DEX, SHRED_MAX_JSON_PER_ENTRY, SHRED_JSON_COMPACT, SHREDSTREAM_QUIET, SHRED_MAX_MSG — see examples/shredstream_entries.go.
RPC utility parse_tx_by_signature.go: TX_SIGNATURE, RPC_URL.
go test ./...Use ParseSubscribeTransaction (Geyser SubscribeUpdateTransactionInfo → RPC-shaped tx + meta) for instruction accounts + Program data logs + merge + Pump fills, aligned with Rust parse_rpc_transaction behavior.
import "github.com/0xfnzero/sol-parser-sdk-golang/solparser" // module path: see go.mod
events, err := solparser.ParseSubscribeTransaction(slot, txInfo, nil, grpcRecvUs)
if err != nil {
// handle
}
for _, ev := range events {
// ev.Type, ev.Data — JSON via json.Marshal(ev)
}Lighter path: ParseLogOptimized / logs-only helpers when you do not have full transaction + meta.
Uses SHRED_URL only (e.g. http://127.0.0.1:10800). This is not GRPC_URL (different service).
export SHRED_URL="http://127.0.0.1:10800"
go run examples/shredstream_entries.goThe example decodes Entry.entries, optionally parses outer instructions to DexEvent JSON via DexEventsFromShredTransactionWire (static account keys only; V0 + ALT may need TS shredstream_pumpfun_json + RPC for full keys).
Run from the repository root after go mod tidy. One row per source file (links point to GitHub main).
| Description | Run command | Source |
|---|---|---|
| PumpFun | ||
PumpFun DexEvent + metrics |
GRPC_URL=… GRPC_TOKEN=… go run examples/pumpfun_with_metrics.go |
pumpfun_with_metrics.go |
| PumpFun trade filter | GRPC_URL=… GRPC_TOKEN=… go run examples/pumpfun_trade_filter.go |
pumpfun_trade_filter.go |
| Quick connection test | GRPC_URL=… GRPC_TOKEN=… go run examples/pumpfun_quick_test.go |
pumpfun_quick_test.go |
| PumpSwap | ||
| PumpSwap + metrics | GRPC_URL=… GRPC_TOKEN=… go run examples/pumpswap_with_metrics.go |
pumpswap_with_metrics.go |
| Ultra-low latency | GRPC_URL=… GRPC_TOKEN=… go run examples/pumpswap_low_latency.go |
pumpswap_low_latency.go |
| Meteora DAMM | ||
| Meteora DAMM V2 | GRPC_URL=… GRPC_TOKEN=… go run examples/meteora_damm_grpc.go |
meteora_damm_grpc.go |
| ShredStream (see step 5 above) | ||
SubscribeEntries + decode + optional DexEvent JSON |
SHRED_URL=http://host:port go run examples/shredstream_entries.go |
shredstream_entries.go |
| Yellowstone | ||
Geyser subscribe + ParseSubscribeTransaction |
GRPC_URL=… GRPC_TOKEN=… go run examples/yellowstone_grpc_parse.go |
yellowstone_grpc_parse.go |
| Multi-protocol | ||
| All supported DEX programs | GRPC_URL=… GRPC_TOKEN=… go run examples/multi_protocol_grpc.go |
multi_protocol_grpc.go |
| Utility | ||
| Parse tx by signature (RPC, not gRPC stream) | TX_SIGNATURE=… RPC_URL=… go run examples/parse_tx_by_signature.go |
parse_tx_by_signature.go |
PumpFun, PumpSwap, Raydium AMM V4 / CLMM / CPMM, Orca Whirlpool, Meteora DAMM V2 / DLMM, Bonk Launchpad (see solparser/).
ParseSubscribeTransaction— Geyser single-tx →[]DexEvent(instructions + logs + merge + Pump account fill).ParseRpcTransaction/ParseTransactionFromRpc— HTTP RPC JSON → events.ParseInstructionUnified/ParseInnerInstructionUnified— outer 8-byte / inner 16-byte discriminators.DexEventsFromShredTransactionWire— wire tx bytes → outerParseInstructionUnified(Shred static keys).DecodeGRPCEntry/DecodeEntriesBincode— ShredStreamEntry.entriesbytes →DecodedTransactionslices.DexEvent—json.Marshalfor{ "PumpSwapBuy": { … } }style output.
go test ./...
go build ./...
go vet ./...