solana-swap-parser
Parse any Solana swap transaction
Give it a signature and it tells you who traded, what was sold and bought, the price, the fee and the exchange. Works for any DEX because it reads balance changes, not instructions. Zero dependencies.
Try it
npx github:blixvip/solana-swap-parser <signature>
What it does
- pump.fun, PumpSwap, Raydium, Jupiter, Meteora, Orca and any other program
- A wallet's latest buys and sells
- Versioned transactions and lookup tables
- Handles bots whose fee payer is not the trader
Use it in your code
npm install github:blixvip/solana-swap-parser
import { fetchSwap, walletSwaps } from "solana-swap-parser";
const swap = await fetchSwap("<signature>");
console.log(swap.type, swap.sold, swap.bought, swap.dex);
Full documentation, the API and the FAQ are in the README. It is MIT licensed and has no dependencies.
Guide
How to parse a Solana swap transaction for any DEX
From the team behind Blix
solana-swap-parser is a small, open piece of what runs behind Blix, the AI-powered Solana memecoin terminal with 0% fees: every pump.fun launch live, AI coin ratings, narratives, wallet and X tracking, and one-click trading. If you want the result rather than the plumbing, use Blix. There is also a public API and an MCP server for AI agents.
Contribute
Pull requests are welcome and there are good first issues with step-by-step instructions. Setup is git clone and npm test. Ask anything in the Discord.