Package Logo
jupiter-dex-substreams
jupiter-dex-substreams@v0.3.3
Total Downloads
18
Published
22 hours ago
Network
solana solana
Publisher
User Avatar PaulieB14

Readme

Jupiter DEX Events Substream

Substreams Solana Jupiter Performance

A high-performance Substreams package for tracking Jupiter DEX aggregator events on Solana blockchain with 75% data reduction via foundational stores.

🌟 Overview

This substream provides complete visibility into Jupiter's DEX aggregation ecosystem, tracking:

  • 🔄 Jupiter Swap Events (v1-v6): Token swap aggregations across multiple DEXs
  • 📋 Jupiter Limit Orders: Advanced order management functionality
  • 💰 Jupiter DCA: Dollar Cost Averaging automation
  • 🧠 Aggregation Events: Cross-DEX routing decisions and arbitrage opportunities

🚀 Key Features

  • ⚡ 75% Data Reduction: Uses solana-common foundational modules to exclude voting transactions
  • 🎯 Block Filtering: Efficient filtering skips irrelevant blocks before processing
  • 📊 Performance Stores: Track swap volumes and unique traders for analytics
  • 🔄 Multi-Version Support: Tracks Jupiter v1-v6 simultaneously
  • 🌐 Cross-DEX Analysis: Understands routing across Raydium, Orca, and other DEXs
  • 📈 Real-time Events: Live tracking of Jupiter's aggregation decisions
  • 💾 Shared Caching: Leverages foundational stores for reduced costs

📈 Performance Characteristics

  • Data Reduction: 75% via vote transaction filtering
  • Query Performance: 3-5x faster through foundational store caching
  • Block Range: Optimized for blocks 31,310,775+
  • Parallel Processing: Enabled for all map modules
  • Infrastructure Cost: Significantly reduced via shared caching

📦 Installation

# Install Substreams CLI
curl -sSL https://substreams.dev/install.sh | bash

# Run Jupiter events (v0.3.2)
substreams run https://github.com/PaulieB14/Jupiter-Dex-Substreams/releases/download/v0.3.2/jupiter-dex-substreams-v0.3.2.spkg \
  map_jupiter_instructions \
  -e mainnet.sol.streamingfast.io:443 \
  -s 325766951 -t +1

🏗️ Module Architecture

jupiter_filtered_transactions (base module with foundational stores)
├── map_spl_initialized_account
├── map_jupiter_trading_data
│   ├── map_token_prices
│   ├── store_swap_volumes
│   └── store_unique_traders
├── map_jupiter_instructions
└── map_jupiter_analytics

🏗️ Development

Prerequisites

  • Rust 1.70+
  • Substreams CLI 1.7.0+
  • Solana CLI (optional)

Build

# Clone the repository
git clone https://github.com/PaulieB14/Jupiter-Dex-Substreams.git
cd Jupiter-Dex-Substreams

# Build the WASM + package
substreams build

# (Optional) compile-check without packaging
cargo check --target wasm32-unknown-unknown

# Run with GUI for visualization
substreams gui substreams.yaml map_jupiter_instructions \
  -e mainnet.sol.streamingfast.io:443 \
  -s 325766951 -t +10

📊 Event Types

Swap Events

  • Route discovery and execution
  • Multi-hop swap tracking
  • Slippage and price impact
  • Cross-DEX routing decisions

Limit Order Events

  • Order placement and management
  • Order execution and fulfillment
  • Order cancellation events

DCA Events

  • Scheduled purchase events
  • DCA execution status
  • Position management

Aggregation Events

  • Cross-DEX arbitrage opportunities
  • Liquidity source selection
  • Route optimization decisions

🔧 Jupiter Program IDs

Program Address Version
Jupiter Swap v6 JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 Latest
Jupiter Swap v4/v3 JUP4Fb2cqiRUcaTHdrPC8h2gNsA2ETXiPDD33WcGuJB v4/v3
Jupiter Swap v2 JUP3c2Uh3WA4Ng34tw6kPd2G4C5BB21Xo36Je1s32Ph v2
Jupiter Swap v1 JUP2jxvXaqu7NQY1GmNF4m1vodw12LVXYxbFL2uJvfo v1
Jupiter Limit Orders jupoNjAxXgZ4rjzxzPMP4oxduvQsQtZzyknqvzYNrNu Orders
Jupiter DCA DCA265Vj8a9CEuX1eb1LWRnDT7uK6q1xMipnNyatn23M DCA

📈 Usage Examples

Basic Usage

# Run with GUI
substreams gui substreams.yaml map_jupiter_analytics

# Run specific block range
substreams run substreams.yaml map_jupiter_instructions \
  -e mainnet.sol.streamingfast.io:443 \
  -s 325766951 -t +10

Advanced Usage

# Access swap volume store
substreams run substreams.yaml store_swap_volumes \
  -e mainnet.sol.streamingfast.io:443 \
  -s 325766951 -t +100

# Run with parallelization
substreams run substreams.yaml map_jupiter_analytics \
  -e mainnet.sol.streamingfast.io:443 \
  -H "X-Substreams-Parallel-Workers: 20" \
  -s 325766951 -t +1000

🏗️ Architecture

This substream is built using:

  • Rust for the core logic
  • Protocol Buffers for data serialization
  • Substreams Solana for blockchain data access
  • Solana Common v0.3.0 for foundational modules
  • Block Filtering for efficient data processing

🆕 What's New in v0.3.2

Performance Improvements

  • ✅ Integrated solana-common v0.3.0 foundational modules
  • ✅ Added block-level filtering for Jupiter programs
  • ✅ 75% data reduction by excluding voting transactions
  • ✅ 3-5x query performance improvement

New Features

  • store_swap_volumes - Track trading volumes by token pair
  • store_unique_traders - Monitor unique wallet addresses
  • ✅ Parameterized program ID filtering
  • ✅ Enhanced module reusability

Technical Improvements

  • ✅ Shared caching via foundational stores
  • ✅ Reduced infrastructure costs
  • ✅ Better error handling
  • ✅ Improved parallel processing

📚 Documentation

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

See CONTRIBUTING.md for detailed guidelines.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🔗 Links

📞 Support

For support, please:


Built with ❤️ for the Jupiter and Solana ecosystem

Documentation

Modules

Maps icon
Maps

map
map_spl_initialized_account

6cd288ca560fc3a85c81c9d388c09933e8c4261a
map map_spl_initialized_account (
blocksf.solana.type.v1.Block
)  -> sf.jupiter.v1.AccountOwnerRecords
substreams gui jupiter-dex-substreams@v0.3.3 map_spl_initialized_account

map
map_jupiter_trading_data

ad3e6c76b6604b899ea7d04bc5e718b1e096f1e4
map map_jupiter_trading_data (
)  -> sf.jupiter.v1.TradingDataList
substreams gui jupiter-dex-substreams@v0.3.3 map_jupiter_trading_data

map
map_token_prices

f604fe4f075e4fad762ddde7e4f5b30ccaf3ae1c
substreams gui jupiter-dex-substreams@v0.3.3 map_token_prices

map
map_jupiter_instructions

34e029f1e98aceda9d4c546a888870b691e89884
substreams gui jupiter-dex-substreams@v0.3.3 map_jupiter_instructions

map
map_jupiter_analytics

b6201013561a7d90a1a0a9f49b86b436fd627ec1
substreams gui jupiter-dex-substreams@v0.3.3 map_jupiter_analytics

map
sol:v020:blocks_without_votes

0be93a73c65aa8ec2de4b1a47209edeea493ff29
map sol:v020:blocks_without_votes (
)  -> sf.solana.type.v1.Block

blocks_without_votes allows you to consume a full Solana Block without Vote instructions (Vote111111111111111111111111111111111111111). If you consume it on HISTORICAL data (+1000 blocks from HEAD), you will be reading from the StreamingFast cache, thus saving costs on the amount of TB read.

substreams gui jupiter-dex-substreams@v0.3.3 sol:v020:blocks_without_votes
Stores icon
Stores

store
store_swap_volumes

3e0086f81802e465fcbce6c284c0e42f86457d01
store <add,bigint> store_swap_volumes (
)
substreams gui jupiter-dex-substreams@v0.3.3 store_swap_volumes

store
store_unique_traders

39313b393bd9f1c6b1b1eec90d4b3cc6a45015a0
store <set_if_not_exists,string> store_unique_traders (
)
substreams gui jupiter-dex-substreams@v0.3.3 store_unique_traders
Block Indexes icon
Block Indexes

blockIndex
sol:program_ids_without_votes

811466d12743a8b02be8ba6649cfa9a24aa1af62
substreams gui jupiter-dex-substreams@v0.3.3 sol:program_ids_without_votes
Protobuf

Protobuf Docs Explorer

sol.instructions.v1
jupiter.events.v1
sf.jupiter.v1
sf.solana.type.v1
sol.transactions.v1