cp-amm program emits Anchor events through event CPI. Use this page when building indexers, analytics pipelines, charting systems, or low-level clients that need to map transactions back to DAMM v2 pool activity.
Event CPI
Low-level builders should pass the event authority account and the
cp-amm program account when the IDL requires them. The program signs the self-CPI with the event authority PDA internally.
Pool And Config Events
EvtInitializePool is the primary pool-creation event. Indexers should treat it as the source of pool metadata at creation time, then reconcile current mutable state from the pool account.
Position Events
New indexers should use
EvtSplitPosition3. The current split handler emits EvtSplitPosition2 for backward compatibility, but EvtSplitPosition3 carries the current payload shape.
Liquidity And Lock Events
EvtLiquidityChange.change_type is 0 for add liquidity and 1 for remove liquidity.
Swap Events
EvtSwap2 is the canonical swap event for charting and analytics. Prefer it over SPL token transfer logs because DAMM v2 swaps can include Token-2022 transfer fees, protocol fees, compounding fees, and referral fees.
Fee And Reward Events
Reward indexes are limited to the two DAMM v2 reward slots,
0 and 1.
Operator Events
EvtUpdatePoolFees.params.cliff_fee_numerator is optional. EvtUpdatePoolFees.params.dynamic_fee is also optional; None skips dynamic-fee updates, while a default dynamic-fee value disables dynamic fees.
Fee Parameter Decoding
EvtInitializePool.pool_fees.base_fee.data uses the Borsh event format. Pool account state uses the Pod-aligned account format.
Choose the decoder from the pool fee mode. Do not decode an event payload with a pool-state decoder, or pool account data with an event decoder.
Indexing Notes
Most events include
pool and can be joined directly to pool state. Config and token-badge events do not necessarily include a pool, so index them by config address or token mint.
