IAlgebraPoolEvents

Events emitted by a pool

Developer note: Credit to Uniswap Labs under GPL-2.0-or-later license: https://github.com/Uniswap/v3-core/tree/main/contracts/interfaces

Events

Initialize

event Initialize(uint160 price, int24 tick)

Emitted exactly once by a pool when #initialize is first called on the pool Developer note: Mint/Burn/Swap cannot be emitted by the pool before Initialize

NameTypeDescription
priceuint160The initial sqrt price of the pool, as a Q64.96
tickint24The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool

Mint

event Mint(address sender, address owner, int24 bottomTick, int24 topTick, uint128 liquidityAmount, uint256 amount0, uint256 amount1)

Emitted when liquidity is minted for a given position

NameTypeDescription
senderaddressThe address that minted the liquidity
owneraddressThe owner of the position and recipient of any minted liquidity
bottomTickint24The lower tick of the position
topTickint24The upper tick of the position
liquidityAmountuint128The amount of liquidity minted to the position range
amount0uint256How much token0 was required for the minted liquidity
amount1uint256How much token1 was required for the minted liquidity

Collect

event Collect(address owner, address recipient, int24 bottomTick, int24 topTick, uint128 amount0, uint128 amount1)

Emitted when fees are collected by the owner of a position Developer note: Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees

NameTypeDescription
owneraddressThe owner of the position for which fees are collected
recipientaddressThe address that received fees
bottomTickint24The lower tick of the position
topTickint24The upper tick of the position
amount0uint128The amount of token0 fees collected
amount1uint128The amount of token1 fees collected

Burn

event Burn(address owner, int24 bottomTick, int24 topTick, uint128 liquidityAmount, uint256 amount0, uint256 amount1)

Emitted when a position's liquidity is removed Developer note: Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect

NameTypeDescription
owneraddressThe owner of the position for which liquidity is removed
bottomTickint24The lower tick of the position
topTickint24The upper tick of the position
liquidityAmountuint128The amount of liquidity to remove
amount0uint256The amount of token0 withdrawn
amount1uint256The amount of token1 withdrawn

Swap

event Swap(address sender, address recipient, int256 amount0, int256 amount1, uint160 price, uint128 liquidity, int24 tick)

Emitted by the pool for any swaps between token0 and token1

NameTypeDescription
senderaddressThe address that initiated the swap call, and that received the callback
recipientaddressThe address that received the output of the swap
amount0int256The delta of the token0 balance of the pool
amount1int256The delta of the token1 balance of the pool
priceuint160The sqrt(price) of the pool after the swap, as a Q64.96
liquidityuint128The liquidity of the pool after the swap
tickint24The log base 1.0001 of price of the pool after the swap

Flash

event Flash(address sender, address recipient, uint256 amount0, uint256 amount1, uint256 paid0, uint256 paid1)

Emitted by the pool for any flashes of token0/token1

NameTypeDescription
senderaddressThe address that initiated the swap call, and that received the callback
recipientaddressThe address that received the tokens from flash
amount0uint256The amount of token0 that was flashed
amount1uint256The amount of token1 that was flashed
paid0uint256The amount of token0 paid for the flash, which can exceed the amount0 plus the fee
paid1uint256The amount of token1 paid for the flash, which can exceed the amount1 plus the fee

CommunityFee

event CommunityFee(uint8 communityFee0New, uint8 communityFee1New)

Emitted when the community fee is changed by the pool

NameTypeDescription
communityFee0Newuint8The updated value of the token0 community fee percent
communityFee1Newuint8The updated value of the token1 community fee percent

TickSpacing

event TickSpacing(int24 newTickSpacing)

Emitted when the tick spacing changes

NameTypeDescription
newTickSpacingint24The updated value of the new tick spacing

Incentive

event Incentive(address virtualPoolAddress)

Emitted when new activeIncentive is set

NameTypeDescription
virtualPoolAddressaddressThe address of a virtual pool associated with the current active incentive

Fee

event Fee(uint16 feeZto, uint16 feeOtz)

Emitted when the fee changes

NameTypeDescription
feeZtouint16The value of the token fee for zto swaps
feeOtzuint16The value of the token fee for otz swaps

LiquidityCooldown

event LiquidityCooldown(uint32 liquidityCooldown)

Emitted when the LiquidityCooldown changes

NameTypeDescription
liquidityCooldownuint32The value of locktime for added liquidity