
Real-time analytics for Meteora protocol on Solana — covering DLMM (Dynamic Liquidity Market Maker) and Dynamic AMM.
v2.1.0 — Complete rewrite with proper 8-byte Anchor instruction discriminators, inner instruction (CPI) parsing for Jupiter/aggregator swaps, state stores, aggregated analytics, and PostgreSQL SQL sink.
Every Meteora DLMM and Dynamic AMM instruction, classified into four categories:
| Category | DLMM Instructions | Dynamic AMM Instructions |
|---|---|---|
| Swaps | swap, swap_exact_out, swap_with_price_impact |
swap |
| Liquidity Adds | add_liquidity, add_liquidity_by_weight, add_liquidity_by_strategy, add_liquidity_by_strategy_one_side, add_liquidity_one_side |
add_balance_liquidity, add_imbalance_liquidity, bootstrap_liquidity |
| Liquidity Removes | remove_liquidity, remove_all_liquidity, remove_liquidity_by_range, remove_liquidity_single_side |
remove_balance_liquidity, remove_liquidity_single_side |
| Fee Claims | claim_fee, claim_reward |
claim_fee, partner_claim_fee |
| Pool Creations | initialize_lb_pair, initialize_position, initialize_position_pda |
initialize_permissioned_pool, initialize_permissionless_pool, + 4 more variants |
| Program | Address | Type |
|---|---|---|
| DLMM | LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo |
Concentrated liquidity with bins |
| Dynamic AMM | Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB |
Constant product + stable swap |
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)
| Module | Kind | Description |
|---|---|---|
map_meteora_events |
Map | Classifies all DLMM + Dynamic AMM instructions using Anchor discriminators |
store_pool_swap_count |
Store | Swap count per pool |
store_pool_add_count |
Store | Liquidity add count per pool |
store_pool_remove_count |
Store | Liquidity remove count per pool |
store_pool_fee_count |
Store | Fee claim count per pool |
store_user_swap_count |
Store | Swap count per user |
store_user_liquidity_count |
Store | Liquidity op count per user |
store_user_fee_count |
Store | Fee claim count per user |
store_first_seen |
Store | First-seen timestamp per pool and user |
map_pool_stats |
Map | Aggregated pool statistics |
map_user_stats |
Map | Aggregated user statistics |
db_out |
Map | PostgreSQL database changes |
# Stream Meteora events
substreams run meteora-substreams@v2.1.0 map_meteora_events \
-e mainnet.sol.streamingfast.io:443 \
-s 310000000 -t +1000
# GUI mode
substreams gui meteora-substreams@v2.1.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.1.0.spkg \
-e mainnet.sol.streamingfast.io:443
| Table | Key | Description |
|---|---|---|
swaps |
tx_id-instruction_index |
Every swap with pool, user, program, instruction type |
liquidity_changes |
tx_id-instruction_index |
Add/remove liquidity with direction flag |
fee_claims |
tx_id-instruction_index |
Fee and reward claims |
pool_creations |
tx_id-instruction_index |
New pool/position initialization |
pools |
pool_address |
Aggregated: total swaps, adds, removes, fee claims |
users |
user_address |
Aggregated: total swaps, liquidity ops, fee claims |
| View | Description |
|---|---|
top_pools |
Pools ranked by swap count |
top_users |
Users ranked by swap count |
daily_stats |
Daily swap count, active pools, unique users, DLMM vs AMM breakdown |
recent_swaps |
Latest 100 swaps |
| Instruction | Count |
|---|---|
| swap | 995 |
| claim_fee | 53 |
| swap_exact_out | 47 |
| add_liquidity_by_strategy | 35 |
| initialize_position | 31 |
| remove_liquidity_by_range | 21 |
| add_liquidity_by_weight | 1 |
| initialize_lb_pair | 1 |
| Total | 1,184 |
Most Meteora swap volume goes through aggregators like Jupiter via CPI (Cross-Program Invocation). This Substreams parses both top-level and inner instructions, capturing 6.3x more events than top-level only. Without CPI parsing, ~84% of swap volume is missed.
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.
git clone https://github.com/PaulieB14/Meteroa-Substreams.git
cd Meteroa-Substreams
substreams build
substreams pack substreams.yaml
mainnet.sol.streamingfast.io:443Extracts 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.
substreams gui meteora-comprehensive@v2.1.0 map_meteora_eventsComputes aggregated pool statistics.
substreams gui meteora-comprehensive@v2.1.0 map_pool_statsComputes aggregated user statistics.
substreams gui meteora-comprehensive@v2.1.0 map_user_statsOutputs database changes for PostgreSQL sink.
substreams gui meteora-comprehensive@v2.1.0 db_outCounts total swaps per pool address.
substreams gui meteora-comprehensive@v2.1.0 store_pool_swap_countCounts liquidity additions per pool.
substreams gui meteora-comprehensive@v2.1.0 store_pool_add_countCounts liquidity removals per pool.
substreams gui meteora-comprehensive@v2.1.0 store_pool_remove_countCounts fee/reward claims per pool.
substreams gui meteora-comprehensive@v2.1.0 store_pool_fee_countCounts total swaps per user.
substreams gui meteora-comprehensive@v2.1.0 store_user_swap_countCounts total liquidity ops per user.
substreams gui meteora-comprehensive@v2.1.0 store_user_liquidity_countCounts total fee claims per user.
substreams gui meteora-comprehensive@v2.1.0 store_user_fee_countRecords first-seen timestamp per pool and user.
substreams gui meteora-comprehensive@v2.1.0 store_first_seen