Skip to content

TopTrenDev/solana-dex-data-indexer-substream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Solana Substreams

⚑ Solana DEX Data Indexer (Substream)

High-performance Solana DEX transaction indexer built with Substreams. Stream and parse swap transactions across multiple DEX protocols in real timeβ€”for analytics, MEV research, trading bots, and on-chain data pipelines.


πŸ“‘ Table of Contents


✨ Features

Real-time Stream Solana DEX swaps as they land on-chain
Substreams Built on StreamingFast Substreams for scalable, deterministic indexing
Program filtering Only processes transactions that touch supported DEX Program IDs
Multi-protocol Single pipeline for multiple DEX protocols
Use-case ready Analytics, MEV, trading signals, and data pipelines

🏦 Supported DEX Protocols

Protocol Status
Raydium βœ…
Orca βœ…
Meteora βœ…
Pump.fun βœ…
PumpSwap βœ…
Bonk.fun βœ…

πŸ— Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Solana Blocks  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Substreams Engine      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  map_filtered_transactions      β”‚  ← Filter by Program IDs, exclude voting
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  DEX Swap Parser                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Structured Trade Events         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  JSON / Your Data Pipeline      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Module: map_filtered_transactions

  • Input: Solana blocks from the Substreams engine
  • Logic: Keeps only transactions that interact with supported DEX Program IDs; voting transactions are excluded.
  • Output: Filtered transactions ready for the DEX swap parser.

πŸš€ Quick Start

  1. Install the Substreams CLI

    Download & install β†’

  2. Build the project

    substreams build
  3. Authenticate (see Authentication)

  4. Run (see Running the Indexer)


πŸ” Authentication

Log in to the StreamingFast endpoint before running the indexer:

substreams auth

β–Ά Running the Indexer

Stream filtered DEX transactions and write them to a file:

substreams run \
  -e mainnet.sol.streamingfast.io:443 \
  substreams.yaml \
  map_filtered_transactions \
  -s 355325435 \
  -t +1 \
  > trades.jsonl
  • -s β€” start slot
  • -t +1 β€” stream one block (adjust for continuous streaming)

πŸ“€ Example Output

Each emitted event is a structured trade record (e.g. one line per trade in trades.jsonl):

{
  "dex": "Raydium",
  "token_in": "SOL",
  "token_out": "USDC",
  "amount_in": 1.5,
  "amount_out": 150.2,
  "wallet": "abc123",
  "slot": 355325435
}

Use this stream for dashboards, research, or downstream pipelines.


🎯 Use Cases

  • DEX analytics dashboards β€” volume, pairs, and flow in real time
  • MEV research β€” detect and analyze sandwich and arbitrage patterns
  • Trading bots β€” use on-chain swap flow as signals
  • On-chain data pipelines β€” feed data warehouses or ML models
  • Market monitoring β€” track liquidity and large trades across DEXes

πŸ“¦ Publishing

Publish this Substream to the Substreams registry:

substreams registry login
substreams registry publish

πŸ”— Connect

Twitter Telegram


Built with Substreams for the Solana ecosystem.

About

🧠 Solana DEX Swap Data Indexer Substream-powered swap indexer for Solana β€” supports Pump.fun, PumpSwap, BonkFun, Meteora, Raydium, Orca & more. βš‘πŸ“ŠπŸ”₯ Designed for real-time trade analytics, MEV research, and on-chain data pipelines. πŸ“‘

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors