Skip to main content
The swap program emits an Anchor event from each instruction that changes state. Events appear in the transaction logs as Program data: lines, encoded with the event’s discriminator. To read swaps, use client.parseSwapEventsFromTransaction(signature) or client.parseSwapEventsFromLogs(logs), which decode SwapExecuted. The IDL defines every event for other decoders.

Swaps

SwapExecuted

Emitted by swap.

Pairs and liquidity

In PairClosed, each returned amount is zero when another pair still uses that vault. In LiquidityAdded, treasury_deposit_amount is zero when nothing went to Treasury. In LiquidityRemoved, amount is the argument as passed and amount_transferred is what the capital provider received.

Administration

GlobalConfigUpdated carries every field after the change, including those left unchanged.

What to monitor

  • Pauses: GlobalConfigUpdated, AssetPauseChanged, PairUpdated, and LpStableConfigPauseChanged with paused changing.
  • Prices and fees: AssetConfigUpdated for new price sources, and PairUpdated and LpProtocolFeeConfigUpdated for new fees.
  • Admin changes: NewAdminProposed and AdminChanged.