feat: add jetstreamer-dex-trades plugin — decode swaps from 30 Solana…#42
feat: add jetstreamer-dex-trades plugin — decode swaps from 30 Solana…#42whitewalker007 wants to merge 2 commits intoanza-xyz:mainfrom
Conversation
… DEX programs Adds a new `jetstreamer-dex-trades` workspace crate that decodes swap transactions from 30 Solana DEX programs into a unified protobuf SwapRecord format. Supported DEXes: Pump Fun, Pump AMM, Raydium (AMM V4, CPMM, CLMM, LaunchLab), Orca (V2, Whirlpool), Meteora (DAMM V2, DBC, DLMM, Pools), Manifest, Aquifer, Lifinity V1/V2, PancakeSwap CLMM, Byreal CLMM, Futarchy AMM, Obric V2, SolFi V1/V2, AlphaQ, BisonFi, ZeroFi, GoonFi, HumidiFi, Tessera, Stabble Stable/Weighted. Usage: cargo run --release -- --with-plugin dex-trades <slot-range> Contributed by Top Ledger (https://topledger.xyz/) Made-with: Cursor
|
this is very cool, what will maintaining this look like? I imagine there will be frequent changes if any of these DEXes change their on-chain data. Also that could be problematic because jetstreamer is typically run on old/historical slots so wouldn't this plugin fail on those and/or need to be designed in such a way that it handles swap format changes based on the slots in which those changes are introduced? |
Maintenance: We (Top Ledger) have been running these exact decoders on our private fork for months and are committed to maintaining them long-term. When a project ships a new version, we typically add a new decoder module (e.g., raydium_cpmm alongside raydium_amm_v4) rather than modifying existing ones. We're happy to own ongoing maintenance of this plugin. Historical compatibility: This is actually well-handled by how Solana DEX upgrades work in practice — most programs deploy a new program ID when they ship a major format change (e.g., Raydium AMM V4 vs CLMM vs CPMM, Orca V2 vs Whirlpool, Meteora Pools vs DLMM vs DAMM V2). Since the registry dispatches by program ID, old slots naturally match the correct decoder. We've backfilled all DEX trades from 2025 to present using this decoder without any errors, so historical compatibility is battle-tested. For the rare cases where a program changes its event/log format under the same program ID, we can add slot-based versioning within individual decoders (check slot < MIGRATION_SLOT and branch accordingly). We haven't hit this in production yet, but the architecture supports it cleanly. In short: old decoders stay stable, new formats get new modules, and we handle the maintenance. |
- Add crate-level clippy allows for field_reassign_with_default, too_many_arguments, large_enum_variant, type_complexity - Fix unnecessary_unwrap in token_transfers with match on refs - Suppress dead_code on IDL structs with fields used only for deserialization completeness - Rename unused `truncated` fields to `_truncated` - Apply cargo fmt across all files Made-with: Cursor
… DEX programs
Adds a new
jetstreamer-dex-tradesworkspace crate that decodes swap transactions from 30 Solana DEX programs into a unified protobuf SwapRecord format.Supported DEXes: Pump Fun, Pump AMM, Raydium (AMM V4, CPMM, CLMM, LaunchLab), Orca (V2, Whirlpool), Meteora (DAMM V2, DBC, DLMM, Pools), Manifest, Aquifer, Lifinity V1/V2, PancakeSwap CLMM, Byreal CLMM, Futarchy AMM, Obric V2, SolFi V1/V2, AlphaQ, BisonFi, ZeroFi, GoonFi, HumidiFi, Tessera, Stabble Stable/Weighted.
Usage: cargo run --release -- --with-plugin dex-trades
Contributed by Top Ledger (https://topledger.xyz/)
Made-with: Cursor