All packages
raydium_clmm_events

raydium_clmm_events

billettc
v0.1.0/2 downloads

Package ref

raydium-clmm-events@v0.1.0

Run package

CLI

Run map_events from the command line.

substreams run raydium-clmm-events@v0.1.0 map_events -e solana --start-block -1
Authenticate by running substreams auth or directly on thegraph.market (see docs).

README

Raydium CLMM Substreams

Solana mainnet Substreams package that decodes all Raydium CLMM instructions into structured protobuf tables for a ClickHouse sink (StreamingFast hosted SQL / from-proto).

ItemValue
Networksolana (mainnet)
ProgramCAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK
Layout sourceAnchor IDL (idl/raydium_clmm.json)
Outputmap_eventsraydium.clmm.v1.Events
SinkClickHouse via from-proto (SQL annotations on proto)
initialBlock432400000 (~1 day before head as of scaffold)

Modules & tables

map_events walks successful transactions with walk_instructions() (includes CPI/inner instructions) and emits:

Proto fieldClickHouse tableInstructions
swapsraydium_clmm_swapsswap, swap_v2, swap_router_base_in
positionsraydium_clmm_positionsopen / increase / decrease / close position variants
poolsraydium_clmm_poolscreate_pool, create_customizable_pool
configsraydium_clmm_configsamm/dynamic fee/operation/support mint updates
feesraydium_clmm_feescollect_fund_fee, collect_protocol_fee
rewardsraydium_clmm_rewardsreward lifecycle instructions
limit_ordersraydium_clmm_limit_orderslimit order open/increase/decrease/settle/close

Every row includes id (signature + ordinal), slot, signature, ordinal, is_inner, instruction, named accounts from the IDL, and typed instruction args (u128 as decimal strings).

Prerequisites

  • Rust with wasm32-unknown-unknown (rustup target add wasm32-unknown-unknown)
  • substreams CLI
  • buf (used by substreams build)
  • Auth for streaming: substreams auth (thegraph.market)

Without auth, substreams run fails with Unauthenticated / missing JWT or API key.

Build

substreams build

Run (verify before deploying sink)

# ~100 slots near initialBlock
substreams run -s 432400000 -t +100 map_events -o jsonl

# GUI
substreams gui -s 432400000 -t +100 map_events

ClickHouse (from-proto)

Schema is generated from schema.table / schema.field annotations in proto/events.proto.

Self-managed:

substreams-sink-sql from-proto "clickhouse://default:@localhost:9000/default" ./substreams.yaml

StreamingFast hosted sink: publish/pack the .spkg, then create a hosted SQL deployment against ClickHouse pointing at module map_events (Portal). The sink type is already declared in substreams.yaml.

Query tip: filter reorg-deleted rows with _deleted_ = 0 when using the sink’s ReplacingMergeTree layout.

Layout / IDL

Discriminators and account indexes come from raydium-idl. Nested args (CreateCustomizableParams, InitializeRewardParam) are flattened into typed fields.

Modules

Execution graph

1 modules
mapMain

map_events

Decode all Raydium CLMM instructions (program CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK) using walk_instructions (CPI-safe). Structured fields from the official Anchor IDL.

from #432400000