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

Config And Metadata Events

Swap Events

EvtSwap2 Payload

Do not reconstruct DBC price from token transfer logs. Use EvtSwap2 or EvtSwap3, quote helpers, and account state so trading fees, transfer fees, partial fills, and next_sqrt_price are handled correctly.
included_transfer_fee_amount_in is the amount the user pays. excluded_transfer_fee_amount_in is what the pool receives after the input mint’s transfer fee, and it matches swap_result.included_fee_input_amount. included_transfer_fee_amount_out matches swap_result.output_amount. excluded_transfer_fee_amount_out is what the user receives after the output mint’s transfer fee. EvtSwap.params.amount_in equals included_transfer_fee_amount_in in every swap mode. EvtSwap.params.minimum_amount_out equals excluded_transfer_fee_amount_out for exact-out and partial-fill. For exact-in it is the user’s minimum_amount_out, not the amount received.

Fee And Claim Events

Migration And Withdrawal Events

Operator Events

Indexing Notes

  1. Treat EvtSwap2.quote_reserve_amount / EvtSwap2.migration_threshold as the event-side progress signal. Read user-facing amounts from EvtSwap3.included_transfer_fee_amount_in and EvtSwap3.excluded_transfer_fee_amount_out. EvtSwap.params.amount_in includes the transfer fee.
  2. Consume EvtCreateConfig3 for configs from create_config and create_config2. EvtCreateConfig is no longer emitted. create_config_with_transfer_hook still emits only EvtCreateConfigV2WithTransferHook.
  3. Reconcile event-derived progress with VirtualPool.quote_reserve from account state.
  4. Index both EvtInitializePool and EvtInitializePoolWithTransferHook, plus pool accounts, so pools created before your indexer starts are still discoverable.
  5. Store raw swap_result values for analytics; rounded UI values can lose fee and partial-fill detail.
  6. For migrated pools, use DBC events to identify completion and destination AMM state to track post-migration trading.