npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

solana-token-transaction-monitor

v1.0.0

Published

Monitor and parse all transactions for a specific SPL token across all DEXs on Solana

Readme

Solana Token Transaction Monitor

A powerful npm package for monitoring and parsing ALL transactions for a specific SPL token across all DEXs on Solana in real-time.

🚀 Features

  • Universal DEX Support: Monitor transactions on PumpFun, Raydium, Orca, Jupiter, and all other DEXs
  • Real-time Streaming: Uses Triton gRPC for live transaction monitoring
  • Accurate Parsing: Specialized parsers for PumpFun with fallback for other DEXs
  • Transaction Database: Built-in SQLite storage with automatic cleanup
  • Type Detection: Automatically identifies BUY/SELL transactions
  • SOL Amount Calculation: Accurate SOL amounts with fee consideration
  • TypeScript Support: Fully typed for better DX
  • Easy Integration: Simple API for quick integration

📦 Installation

npm install solana-token-transaction-monitor

🛠 Usage

Option 1: Using TransactionParser (with SQLite storage)

import transactionParser from 'solana-token-transaction-monitor/parse_transactions';

// Start tracking a token
const tokenMint = 'your_token_mint_address_here';
await transactionParser.startTracking(
  tokenMint,
  'https://grpc.fra.shyft.to', // optional, can use env vars
  'your_api_token' // optional, can use env vars
);

// Get stored transactions
const transactions = await transactionParser.getTransactions(tokenMint, 50);

// Stop tracking
transactionParser.stopTracking();

Option 2: Using TokenMonitor directly

import { TokenMonitor } from 'solana-token-transaction-monitor';

const monitor = new TokenMonitor({
  grpcUrl: process.env.GRPC_URL || 'https://grpc.fra.shyft.to',
  xToken: process.env.X_TOKEN,
  targetMint: 'your_token_mint_address',
  onTransaction: (txInfo, signature, tx) => {
    console.log(`
      Type: ${txInfo.type} (${txInfo.type === 'BUY' ? '🟢' : '🔴'})
      DEX: ${txInfo.dex}
      User: ${txInfo.user}
      Token Amount: ${txInfo.tokenAmount}
      SOL Amount: ${txInfo.solAmount}
      Signature: ${signature}
      Solscan: https://solscan.io/tx/${signature}
    `);
  },
  onError: (error) => {
    console.error('Monitor error:', error);
  }
});

// Start monitoring
await monitor.start();

// Stop monitoring
monitor.stop();

📊 Transaction Info Object

interface TransactionInfo {
  type: string;         // 'BUY', 'SELL', or 'SWAP'
  dex: string;          // 'PUMP FUN', 'RAYDIUM V4', etc.
  user: string;         // Wallet address
  mint: string;         // Token mint address
  tokenAmount: number;  // Amount of tokens traded
  solAmount: number;    // Amount of SOL traded
  success: boolean;     // Transaction success status
}

🔧 Environment Variables

Create a .env file:

# Triton gRPC URL - get from https://triton.one/
GRPC_URL=your_grpc_url_here

# Triton API Token - get from https://triton.one/
X_TOKEN=your_api_token_here

💾 Database Schema

When using TransactionParser, transactions are stored in SQLite:

CREATE TABLE transactions (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  token_mint TEXT NOT NULL,
  wallet TEXT NOT NULL,
  type TEXT NOT NULL,
  sol_amount REAL NOT NULL,
  tx_hash TEXT NOT NULL,
  timestamp DATETIME DEFAULT CURRENT_TIMESTAMP
)

🏦 Supported DEXs

  • PumpFun (with specialized event parsing)
  • Raydium V4
  • Orca Whirlpool
  • Jupiter V4
  • DFlow
  • And all other SPL token DEXs

📈 Accuracy

  • PumpFun: Uses event parsing for maximum accuracy
  • Other DEXs: Analyzes balance changes with fee consideration
  • Transaction Types: Automatically detects BUY/SELL based on token flow
  • SOL Amounts: Multiple calculation methods with fallbacks

🔗 API Reference

TransactionParser

  • startTracking(mintAddress, grpcUrl?, xToken?): Start monitoring a token
  • stopTracking(): Stop current monitoring
  • getTransactions(tokenMint, limit): Get stored transactions
  • close(): Clean up resources

TokenMonitor

  • constructor(options): Create monitor instance
  • start(): Begin monitoring
  • stop(): Stop monitoring

📝 License

MIT

🔗 Links