Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.meteora.ag/llms.txt

Use this file to discover all available pages before exploring further.

The lb_clmm 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 DLMM pool activity.

Event CPI

ItemValue
Program IDLBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo
Event authority PDA seed__event_authority
Event sourceAnchor event CPI inner instructions
Client account planningEvent-emitting instructions include event_authority and the program account. SDK builders and generated clients derive these accounts.
Low-level builders should keep the generated event_authority and program accounts in the exact account order expected by the IDL. If either account is missing or moved, Anchor account deserialization can fail before the handler reaches the intended operation.

Pool Events

EventEmitted byPayload
LbPairCreateinitialize_lb_pair, initialize_lb_pair2, initialize_permission_lb_pair, initialize_customizable_permissionless_lb_pair, initialize_customizable_permissionless_lb_pair2LB pair address, bin step, token X mint, and token Y mint.
LbPairCreate is the primary pool-discovery event. It identifies the pool and token pair, while mutable pool state such as active bin, fees, reserves, rewards, oracle, and status should be read from the LbPair account.

Position Events

EventEmitted byPayload
PositionCreateinitialize_position, initialize_position2, initialize_position_pda, initialize_position_by_operatorLB pair, position account, and owner.
PositionCloseclose_position, close_position2, close_position_if_emptyPosition account and owner.
IncreasePositionLengthincrease_position_length, increase_position_length2LB pair, position, owner, length added, and resize side.
DecreasePositionLengthdecrease_position_lengthLB pair, position, owner, length removed, and resize side.
UpdatePositionOperatorupdate_position_operatorPosition, old operator, and new operator.
SetPositionPermissionlessOperationBitsEvtset_permissionless_operation_bitsPosition, owner, previous permission bits, and new permission bits.
IncreasePositionLength.side and DecreasePositionLength.side are encoded resize-side values from the program IDL.

Liquidity Events

EventEmitted byPayload
AddLiquidityadd_liquidity*, add_liquidity*2LB pair, sender, position, deposited token X/Y amounts, and active bin during deposit.
RemoveLiquidityremove_liquidity*, remove_liquidity*2, remove_all_liquidityLB pair, sender, position, withdrawn token X/Y amounts, and active bin during withdrawal.
CompositionFeeAdd-liquidity and rebalance flows when a composition fee is chargedSender, bin id, token X/Y composition fee amounts, and protocol fee portions.
Rebalancingrebalance_liquidityLB pair, position, owner, active bin, withdrawn amounts, added amounts, claimed fees, old and new position ranges, and claimed rewards.
CompositionFee can be emitted along with an add-liquidity or rebalance event. Indexers that calculate LP cost basis should process both event types for the same transaction.

Swap Events

EventEmitted byPayload
Swapswap, swap2LB pair, user, start and end bin ids, input amount, output amount, direction, total fee, protocol fee, fee bps, and host fee.
Swap2Evtswap, swap2LB pair, user, start and end bin ids, direction, fee bps, input amount, amount left, output amount, market-maker fee, protocol fee, limit-order fee, host fee, and fee-side flags.
Swap2Evt is the richer swap event for charting and analytics. New indexers should prefer it because it separates market-maker, protocol, limit-order, and host fee components.
FieldMeaning
swap_for_ytrue means token X is swapped for token Y. false means token Y is swapped for token X.
start_bin_idActive bin before swap execution.
end_bin_idActive bin after swap execution.
fee_bpsFee rate used for the swap path.
amount_inTotal amount paid by the user.
amount_leftUnused input amount after execution.
amount_outTotal amount transferred to the user.
mm_feeMarket-maker fee component.
protocol_feeProtocol fee component.
limit_order_feeLimit-order fee component.
host_feeHost or referral fee component.
fees_on_inputWhether fees were collected on the input side.
fees_on_token_xWhether the charged fee token is token X.

Fee And Reward Events

EventEmitted byPayload
ClaimFeeclaim_fee, claim_fee2LB pair, position, owner, claimed token X fee, and claimed token Y fee.
ClaimFee2claim_fee, claim_fee2ClaimFee payload plus active bin id.
InitializeRewardinitialize_rewardLB pair, reward mint, funder, reward index, and reward duration.
FundRewardfund_rewardLB pair, funder, reward index, and funded amount.
ClaimRewardclaim_reward, claim_reward2LB pair, position, owner, reward index, and claimed reward amount.
ClaimReward2claim_reward, claim_reward2ClaimReward payload plus active bin id.
UpdateRewardDurationupdate_reward_durationLB pair, reward index, old duration, and new duration.
UpdateRewardFunderupdate_reward_funderLB pair, reward index, old funder, and new funder.
WithdrawIneligibleRewardwithdraw_ineligible_rewardLB pair, reward mint, and withdrawn amount.
Reward indexes are limited to the two DLMM reward slots, 0 and 1. New indexers should prefer ClaimFee2 and ClaimReward2 when active-bin context is useful. The program still emits the original ClaimFee and ClaimReward compatibility events.

Operator And Oracle Events

EventEmitted byPayload
FeeParameterUpdateupdate_base_feeLB pair, protocol share, base factor, and base fee power factor.
DynamicFeeParameterUpdateupdate_dynamic_feeLB pair, filter period, decay period, reduction factor, variable fee control, and max volatility accumulator.
IncreaseObservationincrease_oracle_lengthOracle account and new observation length.
GoToABingo_to_a_binLB pair, previous bin id, and target bin id.
Some operator and admin instructions update accounts without emitting a dedicated event. For those flows, use account-state indexing in addition to event indexing.

Limit Order Events

EventEmitted byPayload
PlaceLimitOrderEvtplace_limit_orderLB pair, sender, owner, limit order account, active bin id, and place-order parameters.
CancelLimitOrderEvtcancel_limit_orderLB pair, sender, limit order account, withdrawn token X/Y amounts, active bin id, and removed bin ids.
CloseLimitOrderEvtclose_limit_order_if_emptyLB pair, owner, and limit order account.
PlaceLimitOrderEvt.params includes the side, optional relative-bin settings, and bin amount list supplied to the instruction.

Declared Event Note

UpdatePositionLockReleasePoint is defined in src/events.rs, but no current lb_clmm handler emits it. Treat it as a declared compatibility type, not an emitted event source, unless a future program version adds an emit_cpi! call for it.

Indexing Notes

Use caseEvent to index
Pool discoveryLbPairCreate
Position lifecyclePositionCreate, PositionClose, IncreasePositionLength, DecreasePositionLength, UpdatePositionOperator, SetPositionPermissionlessOperationBitsEvt
LP accountingAddLiquidity, RemoveLiquidity, CompositionFee, Rebalancing
Swap history and candlesSwap2Evt
FeesClaimFee2, FeeParameterUpdate, DynamicFeeParameterUpdate
RewardsInitializeReward, FundReward, ClaimReward2, UpdateRewardDuration, UpdateRewardFunder, WithdrawIneligibleReward
Oracle and bin movementIncreaseObservation, GoToABin
Limit ordersPlaceLimitOrderEvt, CancelLimitOrderEvt, CloseLimitOrderEvt