Events

All Vault events are defined in IVaultEvents.sol in the @bush.fi/v3-interfaces package (contracts/vault/IVaultEvents.sol).

For event based systems the following Vault events can be useful to construct/track pool state:

  • Swap(address indexed pool, IERC20 indexed tokenIn, IERC20 indexed tokenOut, uint256 amountIn, uint256 amountOut, uint256 swapFeePercentage, uint256 swapFeeAmount)

    • A swap has occurred.
  • LiquidityAdded(address indexed pool, address indexed liquidityProvider, AddLiquidityKind indexed kind, uint256 totalSupply, uint256[] amountsAddedRaw, uint256[] swapFeeAmountsRaw)

    • Liquidity has been added to a pool (including initialization).
  • LiquidityRemoved(address indexed pool, address indexed liquidityProvider, RemoveLiquidityKind indexed kind, uint256 totalSupply, uint256[] amountsRemovedRaw, uint256[] swapFeeAmountsRaw)

    • Liquidity has been removed from a pool.
  • AggregateSwapFeePercentageChanged(address indexed pool, uint256 aggregateSwapFeePercentage)

    • A protocol or pool creator fee has changed, causing an update to the aggregate swap fee.
  • SwapFeePercentageChanged(address indexed pool, uint256 swapFeePercentage)

    • Emitted when the static swap fee percentage of a pool is updated.
  • PoolPausedStateChanged(address indexed pool, bool paused)

    • A Pool's pause status has changed.
  • PoolRecoveryModeStateChanged(address indexed pool, bool recoveryMode)

    • A Pool's recovery mode status has changed.
  • LiquidityAddedToBuffer(IERC4626 indexed wrappedToken, uint256 amountUnderlying, uint256 amountWrapped, bytes32 bufferBalances) / LiquidityRemovedFromBuffer(...)

Pool discovery

Each pool factory emits PoolCreated(address indexed pool) when a new pool is deployed. Subscribing to this event on every approved factory (see Deployment Addresses) is the simplest way to learn about new pools and their type.

Pool-type specific events

Some pool types and hooks have their own state that the Vault does not emit for. These are listed per pool type in Pool Maths And Details and Hooks Reference; for example Stable pools emit AmpUpdateStarted / AmpUpdateStopped, and the StableSurge hook emits ThresholdSurgePercentageChanged / MaxSurgeFeePercentageChanged.