WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

A modular and extensible blockchain indexer for Solana, built for production use with multiple subscription modes, real-time processing, and database persistence.

License

Notifications You must be signed in to change notification settings

praptisharma28/Solana-Real-time-Transaction-Indexer

Repository files navigation

Solana Real-time Transaction Indexer ⚡

Star this repo TypeScript Solana PostgreSQL License: MIT

A high-performance, real-time Solana blockchain indexer that streams live transaction data and stores it in PostgreSQL for analytics and monitoring.

For a full guide on indexer, read my blog here: Indexing on Solana: A Complete Guide to Deposits, Withdrawals, Memos, and Security

What It Does

Stream live Solana blockchain data → Filter & Process → Store in Database → Real-time Analytics

  • Real-time Data: Live blockchain updates via Yellowstone gRPC
  • Smart Filtering: Large transfers, DeFi activity, memos, failed transactions
  • Analytics Ready: Structured PostgreSQL storage for insights
  • Production Scale: Handles Solana's 2000+ TPS throughput

Demo Screenshots

gRPC Connection Success

Real-time slot streaming - indexer connected to Solana mainnet

Database Connection & Slot Processing

Database connected, processing live blockchain data

PostgreSQL Database Schema

Clean database schema for blockchain analytics

Quick Start

git clone https://github.com/praptisharma28/Solana-Real-time-Transaction-Indexer
cd Solana-Real-time-Transaction-Indexer
npm install

cp .env.example .env

npx prisma db push --schema=src/database/schema.prisma

npm run test:connection  # Test gRPC
npm run test:db         # Test database

npm run dev

Subscription Modes

Switch between different data streams in src/index.ts:

const subscription = createSlotSubscription();

// Track whale movements (>100 SOL transfers)
const subscription = createLargeTransferSubscription();

// Monitor DeFi protocols (Raydium, Jupiter, Orca)
const subscription = createDeFiSubscription();

// Capture memo-based payments
const subscription = createMemoSubscription();

const subscription = createFailedTxSubscription();

Live Output Examples

Slot Updates (Network Health)

[SLOT] 2025-08-24T07:51:26.161Z - Slot: 362152525 (Parent: 362152524)

Whale Transfers

[TRANSFER] 2025-08-24T07:51:26.161Z
  From: 7xKXtg2C...QoQ9HD8i
  To:   9WzDXwBb...i4qRvKn3
  Amount: 150.5 SOL

Payment Memos

[MEMO] 2025-08-24T07:51:26.161Z - Payment ID: TXN_12345

Tech Stack

  • Runtime: Node.js + TypeScript
  • Streaming: Yellowstone gRPC (Solana's data pipeline)
  • Database: PostgreSQL + Prisma ORM
  • Development: Hot reload, Docker support

Use Cases

  • DeFi Analytics: Track protocol volumes, arbitrage opportunities
  • Whale Watching: Monitor large SOL movements in real-time
  • Payment Processing: Memo-based payment confirmations
  • Compliance: Suspicious activity detection and reporting
  • Research: Network health monitoring and usage patterns

Environment Setup

GRPC_ENDPOINT="your-yellowstone-endpoint"
DATABASE_URL="postgresql://user:pass@localhost:5432/solana_indexer"

LOG_LEVEL="info"
MAX_RECONNECT_ATTEMPTS=5

Docker Deployment

docker-compose up -d

docker-compose logs -f indexer

Database Schema

5 optimized tables for blockchain analytics:

  • Transaction: Core transaction data, fees, status
  • LargeTransfer: SOL transfers above threshold
  • Memo: Payment references and notes
  • Account: Account state updates
  • FailedTransaction: Error analysis and debugging

Production Ready

  • Automatic reconnection handling
  • Error logging and monitoring
  • Configurable data retention
  • Connection pooling support
  • Docker health checks

License

MIT License - feel free to use for commercial projects!

Star This Repo

If this helped you build something cool, give it a star!✨


Built with ❤️ by Prapti for the Solana ecosystem

About

A modular and extensible blockchain indexer for Solana, built for production use with multiple subscription modes, real-time processing, and database persistence.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •