Skip to main content
The dynamic-bonding-curve program emits most 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 DBC pool activity.

Event CPI

ItemValue
Event authority seed__event_authority
SDK helperderiveDbcEventAuthority()
Primary standard swap eventEvtSwap2
Primary transfer-hook swap eventEvtSwap2WithTransferHook
Deprecated compatibility eventEvtCreateConfig is deprecated; prefer EvtCreateConfigV2.
Log-event exceptionEvtClaimProtocolFee2 is emitted with emit!, not event CPI.

Config And Metadata Events

EventEmitted byImportant fieldsUse
EvtCreateConfigcreate_configconfig, quote_mint, fee_claimer, fee and curve fieldsDeprecated config payload kept for compatibility.
EvtCreateConfigV2create_configconfig, quote_mint, fee_claimer, leftover_receiver, config_parametersPreferred config creation payload.
EvtCreateConfigV2WithTransferHookcreate_config_with_transfer_hookconfig, quote_mint, fee_claimer, leftover_receiver, config_parameters, transfer_hook_programIndex transfer-hook configs.
EvtPartnerMetadatacreate_partner_metadatapartner_metadata, fee_claimerLink partner metadata to a fee claimer.
EvtVirtualPoolMetadatacreate_virtual_pool_metadatavirtual_pool_metadata, virtual_poolLink pool metadata to a virtual pool.
EvtInitializePoolinitialize_virtual_pool_with_spl_token, initialize_virtual_pool_with_token2022pool, config, creator, base_mint, pool_type, activation_pointIndex new DBC pools.
EvtInitializePoolWithTransferHookinitialize_virtual_pool_with_token2022_transfer_hookpool, config, creator, base_mint, pool_type, activation_pointIndex new transfer-hook DBC pools.
EvtUpdatePoolCreatortransfer_pool_creatorpool, creator, new_creatorTrack creator authority transfer.

Swap Events

EventEmitted byImportant fieldsUse
EvtSwapswap, swap2pool, config, trade_direction, has_referral, params, swap_result, amount_in, current_timestampLegacy/simple swap payload.
EvtSwap2swap, swap2pool, config, trade_direction, has_referral, swap_parameters, swap_result, quote_reserve_amount, migration_threshold, current_timestampPreferred swap payload for charting, progress, fees, and exact-out or partial-fill support.
EvtCurveCompleteswap, swap2 when the threshold is reachedpool, config, base_reserve, quote_reserveMark bonding curve completion and migration readiness.
EvtSwap2WithTransferHookswap2_with_transfer_hookpool, config, trade_direction, has_referral, swap_parameters, swap_result, quote_reserve_amount, migration_threshold, current_timestampPreferred transfer-hook swap payload.
EvtCurveCompleteWithTransferHookswap2_with_transfer_hook when the threshold is reachedpool, config, base_reserve, quote_reserveMark transfer-hook bonding curve completion and hook revocation.

EvtSwap2 Payload

FieldMeaning
trade_direction0 base to quote, 1 quote to base.
has_referralWhether referral fee was included in the fee split.
swap_parameters.amount_0Input for exact-in and partial-fill, or requested output for exact-out.
swap_parameters.amount_1Minimum output for exact-in and partial-fill, or maximum input for exact-out.
swap_parameters.swap_mode0 exact in, 1 partial fill, 2 exact out.
swap_result.included_fee_input_amountInput amount before excluded-fee adjustment.
swap_result.excluded_fee_input_amountAmount that moved the curve after fee handling.
swap_result.amount_leftUnused amount in partial-fill mode.
swap_result.output_amountOutput token amount.
swap_result.next_sqrt_pricePost-swap sqrt price.
swap_result.trading_fee, protocol_fee, referral_feeFee split for the swap.
quote_reserve_amountQuote reserve after the swap. Use this for progress charts.
migration_thresholdConfigured quote threshold for migration readiness.
Do not reconstruct DBC price from token transfer logs. Use EvtSwap2, quote helpers, and account state so fee-adjusted amounts, partial fills, and next_sqrt_price are handled correctly.

Fee And Claim Events

EventEmitted byImportant fieldsUse
EvtClaimTradingFeeclaim_trading_fee, claim_trading_fee2pool, token_base_amount, token_quote_amountPartner trading fee claim.
EvtClaimCreatorTradingFeeclaim_creator_trading_fee, claim_creator_trading_fee2pool, token_base_amount, token_quote_amountCreator trading fee claim.
EvtClaimProtocolFeeclaim_protocol_feepool, token_base_amount, token_quote_amountDeprecated protocol trading fee claim.
EvtClaimProtocolFee2claim_protocol_fee2pool, receiver_token_account, token_mint, amountProtocol fee claim through the newer single-mint claim path.
EvtClaimPoolCreationFeeclaim_protocol_pool_creation_feepool, receiver, creation_feeProtocol share of pool creation fee.
EvtPartnerClaimPoolCreationFeeclaim_partner_pool_creation_feepool, partner, creation_fee, fee_receiverPartner share of pool creation fee.

Migration And Withdrawal Events

EventEmitted byImportant fieldsUse
EvtCreateMeteoraMigrationMetadatamigration_meteora_damm_create_metadatavirtual_poolDAMM v1 migration metadata creation.
EvtPartnerWithdrawSurpluspartner_withdraw_surpluspool, surplus_amountPartner surplus withdrawal.
EvtCreatorWithdrawSurpluscreator_withdraw_surpluspool, surplus_amountCreator surplus withdrawal.
EvtWithdrawLeftoverwithdraw_leftoverpool, leftover_receiver, leftover_amountLeftover base-token withdrawal.
EvtWithdrawMigrationFeewithdraw_migration_feepool, fee, flagMigration fee withdrawal with role flag.

Operator Events

EventEmitted byImportant fieldsUse
EvtCloseClaimFeeOperatorclose_claim_protocol_fee_operatorclaim_fee_operator, operatorTrack protocol fee operator closure.

Indexing Notes

  1. Treat EvtSwap2.quote_reserve_amount / EvtSwap2.migration_threshold as the event-side progress signal.
  2. Reconcile event-derived progress with VirtualPool.quote_reserve from account state.
  3. Index both EvtInitializePool and EvtInitializePoolWithTransferHook, plus pool accounts, so pools created before your indexer starts are still discoverable.
  4. Store raw swap_result values for analytics; rounded UI values can lose fee and partial-fill detail.
  5. For migrated pools, use DBC events to identify completion and destination AMM state to track post-migration trading.