IUniswapV3PoolActions

Overview

License: GPL-2.0-or-later

interface IUniswapV3PoolActions

Contains pool methods that can be called by anyone

Functions info

initialize (0xf637731d)

function initialize(uint160 sqrtPriceX96) external

Sets the initial price for the pool

Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value

Parameters:

mint (0x3c8a7d8d)

function mint(
    address recipient,
    int24 tickLower,
    int24 tickUpper,
    uint128 amount,
    bytes calldata data
) external returns (uint256 amount0, uint256 amount1)

Adds liquidity for the given recipient/tickLower/tickUpper position

The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends on tickLower, tickUpper, the amount of liquidity, and the current price.

Parameters:

Return values:

collect (0x4f1eb3d8)

function collect(
    address recipient,
    int24 tickLower,
    int24 tickUpper,
    uint128 amount0Requested,
    uint128 amount1Requested
) external returns (uint128 amount0, uint128 amount1)

Collects tokens owed to a position

Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity. Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.

Parameters:

Return values:

burn (0xa34123a7)

function burn(
    int24 tickLower,
    int24 tickUpper,
    uint128 amount
) external returns (uint256 amount0, uint256 amount1)

Burn liquidity from the sender and account tokens owed for the liquidity to the position

Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0

Parameters:

Return values:

swap (0x128acb08)

function swap(
    address recipient,
    bool zeroForOne,
    int256 amountSpecified,
    uint160 sqrtPriceLimitX96,
    bytes calldata data
) external returns (int256 amount0, int256 amount1)

Swap token0 for token1, or token1 for token0

The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback

Parameters:

Return values:

flash (0x490e6cbc)

function flash(
    address recipient,
    uint256 amount0,
    uint256 amount1,
    bytes calldata data
) external

Receive token0 and/or token1 and pay it back, plus a fee, in the callback

The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback

Parameters:

increaseObservationCardinalityNext (0x32148f67)

function increaseObservationCardinalityNext(
    uint16 observationCardinalityNext
) external

Increase the maximum number of price and liquidity observations that this pool will store

This method is no-op if the pool already has an observationCardinalityNext greater than or equal to the input observationCardinalityNext.

Parameters:

Last updated