All packages
meteora-comprehensive

meteora-comprehensive

PaulieB14
This is not the latest version — go to v2.2.0
v2.0.0/5 downloads/Repository

Package ref

meteora-comprehensive@v2.0.0

Run package

Start block
245000000, the module's first block

This module reads a store, which starts empty at the module's first block: it runs from there, so its output is from then, not from the chain head. Any later block would first need the store rebuilt up to it.

README

Meteora Substreams

Real-time analytics for Meteora protocol on Solana — covering DLMM (Dynamic Liquidity Market Maker) and Dynamic AMM.

v2.0.0 — Complete rewrite with proper 8-byte Anchor instruction discriminators, state stores, aggregated analytics, and PostgreSQL SQL sink.

What It Tracks

Every Meteora DLMM and Dynamic AMM instruction, classified into four categories:

CategoryDLMM InstructionsDynamic AMM Instructions
Swapsswap, swap_exact_out, swap_with_price_impactswap
Liquidity Addsadd_liquidity, add_liquidity_by_weight, add_liquidity_by_strategy, add_liquidity_by_strategy_one_side, add_liquidity_one_sideadd_balance_liquidity, add_imbalance_liquidity, bootstrap_liquidity
Liquidity Removesremove_liquidity, remove_all_liquidity, remove_liquidity_by_range, remove_liquidity_single_sideremove_balance_liquidity, remove_liquidity_single_side
Fee Claimsclaim_fee, claim_rewardclaim_fee, partner_claim_fee
Pool Creationsinitialize_lb_pair, initialize_position, initialize_position_pdainitialize_permissioned_pool, initialize_permissionless_pool, + 4 more variants

Programs Indexed

ProgramAddressType
DLMMLBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxoConcentrated liquidity with bins
Dynamic AMMEo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaBConstant product + stable swap

Architecture

Layer 1: map_meteora_events
  Anchor discriminator decoding → Swap, LiquidityChange, FeeClaim, PoolCreation

Layer 2: State Stores (8 stores)
  pool swap/add/remove/fee counts, user swap/liquidity/fee counts, first-seen timestamps

Layer 3: Analytics
  map_pool_stats → aggregated pool metrics
  map_user_stats → aggregated user metrics

Layer 4: SQL Sink
  db_out → PostgreSQL (swaps, liquidity_changes, fee_claims, pool_creations, pools, users)

Modules

ModuleKindDescription
map_meteora_eventsMapClassifies all DLMM + Dynamic AMM instructions using Anchor discriminators
store_pool_swap_countStoreSwap count per pool
store_pool_add_countStoreLiquidity add count per pool
store_pool_remove_countStoreLiquidity remove count per pool
store_pool_fee_countStoreFee claim count per pool
store_user_swap_countStoreSwap count per user
store_user_liquidity_countStoreLiquidity op count per user
store_user_fee_countStoreFee claim count per user
store_first_seenStoreFirst-seen timestamp per pool and user
map_pool_statsMapAggregated pool statistics
map_user_statsMapAggregated user statistics
db_outMapPostgreSQL database changes

Quick Start

# Stream Meteora events
substreams run meteora-substreams@v2.0.0 map_meteora_events \
  -e mainnet.sol.streamingfast.io:443 \
  -s 310000000 -t +1000

# GUI mode
substreams gui meteora-substreams@v2.0.0 map_meteora_events \
  -e mainnet.sol.streamingfast.io:443 \
  -s 310000000

# Sink to PostgreSQL
substreams-sink-sql run "psql://localhost/meteora" \
  meteora-substreams-v2.0.0.spkg \
  -e mainnet.sol.streamingfast.io:443

SQL Output

Tables

TableKeyDescription
swapstx_id-instruction_indexEvery swap with pool, user, program, instruction type
liquidity_changestx_id-instruction_indexAdd/remove liquidity with direction flag
fee_claimstx_id-instruction_indexFee and reward claims
pool_creationstx_id-instruction_indexNew pool/position initialization
poolspool_addressAggregated: total swaps, adds, removes, fee claims
usersuser_addressAggregated: total swaps, liquidity ops, fee claims

Views

ViewDescription
top_poolsPools ranked by swap count
top_usersUsers ranked by swap count
daily_statsDaily swap count, active pools, unique users, DLMM vs AMM breakdown
recent_swapsLatest 100 swaps

Sample Output (200 blocks from slot 310M)

InstructionCount
swap56
claim_fee48
add_liquidity_by_strategy33
initialize_position29
remove_liquidity_by_range20
initialize_lb_pair1
Total187

Anchor Discriminators

Instructions are decoded using proper 8-byte Anchor discriminators (SHA256("global:{instruction_name}")[0..8]), verified against the official Meteora IDLs. This replaces the v1 approach of guessing instruction types from single-byte indices.

Build

git clone https://github.com/PaulieB14/Meteroa-Substreams.git
cd Meteroa-Substreams
substreams build
substreams pack substreams.yaml

Network

  • Chain: Solana
  • Start Block: 245,000,000
  • Endpoint: mainnet.sol.streamingfast.io:443

References

Modules

Execution graph

12 modules
map

map_meteora_events

Extracts all Meteora protocol events from DLMM and Dynamic AMM programs using proper 8-byte Anchor instruction discriminators. Classifies into: swaps, liquidity changes, fee claims, pool creations.

from #245000000
store

store_first_seen

Records first-seen timestamp per pool and user.

from #245000000

Store value

int64

Update policy

set_if_not_exists

store

store_pool_add_count

Counts liquidity additions per pool.

from #245000000

Store value

int64

Update policy

add

store

store_pool_fee_count

Counts fee/reward claims per pool.

from #245000000

Store value

int64

Update policy

add

store

store_pool_remove_count

Counts liquidity removals per pool.

from #245000000

Store value

int64

Update policy

add

store

store_pool_swap_count

Counts total swaps per pool address.

from #245000000

Store value

int64

Update policy

add

store

store_user_fee_count

Counts total fee claims per user.

from #245000000

Store value

int64

Update policy

add

store

store_user_liquidity_count

Counts total liquidity ops per user.

from #245000000

Store value

int64

Update policy

add

store

store_user_swap_count

Counts total swaps per user.

from #245000000

Store value

int64

Update policy

add