IUniswapV3PoolEvents

Git Source

Contains all events emitted by the pool

Events

Initialize

Emitted exactly once by a pool when #initialize is first called on the pool

Mint/Burn/Swap cannot be emitted by the pool before Initialize

event Initialize(uint160 sqrtPriceX96, int24 tick);

Parameters

NameTypeDescription
sqrtPriceX96uint160The 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

Emitted when liquidity is minted for a given position

event Mint(
    address sender,
    address indexed owner,
    int24 indexed tickLower,
    int24 indexed tickUpper,
    uint128 amount,
    uint256 amount0,
    uint256 amount1
);

Parameters

NameTypeDescription
senderaddressThe address that minted the liquidity
owneraddressThe owner of the position and recipient of any minted liquidity
tickLowerint24The lower tick of the position
tickUpperint24The upper tick of the position
amountuint128The 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

Emitted when fees are collected by the owner of a position

Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees

event Collect(
    address indexed owner,
    address recipient,
    int24 indexed tickLower,
    int24 indexed tickUpper,
    uint128 amount0,
    uint128 amount1
);

Parameters

NameTypeDescription
owneraddressThe owner of the position for which fees are collected
recipientaddress
tickLowerint24The lower tick of the position
tickUpperint24The upper tick of the position
amount0uint128The amount of token0 fees collected
amount1uint128The amount of token1 fees collected

Burn

Emitted when a position's liquidity is removed

Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect

event Burn(
    address indexed owner,
    int24 indexed tickLower,
    int24 indexed tickUpper,
    uint128 amount,
    uint256 amount0,
    uint256 amount1
);

Parameters

NameTypeDescription
owneraddressThe owner of the position for which liquidity is removed
tickLowerint24The lower tick of the position
tickUpperint24The upper tick of the position
amountuint128The amount of liquidity to remove
amount0uint256The amount of token0 withdrawn
amount1uint256The amount of token1 withdrawn

Swap

Emitted by the pool for any swaps between token0 and token1

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

Parameters

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
sqrtPriceX96uint160The 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

Emitted by the pool for any flashes of token0/token1

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

Parameters

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

IncreaseObservationCardinalityNext

Emitted by the pool for increases to the number of observations that can be stored

observationCardinalityNext is not the observation cardinality until an observation is written at the index just before a mint/swap/burn.

event IncreaseObservationCardinalityNext(uint16 observationCardinalityNextOld, uint16 observationCardinalityNextNew);

Parameters

NameTypeDescription
observationCardinalityNextOlduint16The previous value of the next observation cardinality
observationCardinalityNextNewuint16The updated value of the next observation cardinality

SetFeeProtocol

Emitted when the protocol fee is changed by the pool

event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);

Parameters

NameTypeDescription
feeProtocol0Olduint8The previous value of the token0 protocol fee
feeProtocol1Olduint8The previous value of the token1 protocol fee
feeProtocol0Newuint8The updated value of the token0 protocol fee
feeProtocol1Newuint8The updated value of the token1 protocol fee

CollectProtocol

Emitted when the collected protocol fees are withdrawn by the factory owner

event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);

Parameters

NameTypeDescription
senderaddressThe address that collects the protocol fees
recipientaddressThe address that receives the collected protocol fees
amount0uint128The amount of token0 protocol fees that is withdrawn
amount1uint128