API reference v1.0
Introduction
periphery
tokenomics
IAlgebraPoolActions

IAlgebraPoolActions

IAlgebraPoolActions

Functions

initialize

initialize(uint160) external

Sets the initial price for the pool

NameTypeDescription
priceuint160the initial sqrt price of the pool as a Q64.96

mint

mint(address,address,int24,int24,uint128,bytes) external

Adds liquidity for the given recipient/bottomTick/topTick position

NameTypeDescription
senderaddressThe address which will receive potential surplus of paid tokens
recipientaddressThe address for which the liquidity will be created
bottomTickint24The lower tick of the position in which to add liquidity
topTickint24The upper tick of the position in which to add liquidity
amountuint128The desired amount of liquidity to mint
databytesAny data that should be passed through to the callback

Returns:

NameTypeDescription
amount0uint256
amount1uint256
liquidityActualuint128

collect

collect(address,int24,int24,uint128,uint128) external

Collects tokens owed to a position

NameTypeDescription
recipientaddressThe address which should receive the fees collected
bottomTickint24The lower tick of the position for which to collect fees
topTickint24The upper tick of the position for which to collect fees
amount0Requesteduint128How much token0 should be withdrawn from the fees owed
amount1Requesteduint128How much token1 should be withdrawn from the fees owed

Returns:

NameTypeDescription
amount0uint128
amount1uint128

burn

burn(int24,int24,uint128) external

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

NameTypeDescription
bottomTickint24The lower tick of the position for which to burn liquidity
topTickint24The upper tick of the position for which to burn liquidity
amountuint128How much liquidity to burn

Returns:

NameTypeDescription
amount0uint256
amount1uint256

swap

swap(address,bool,int256,uint160,bytes) external

Swap token0 for token1, or token1 for token0

NameTypeDescription
recipientaddressThe address to receive the output of the swap
zeroToOneboolThe direction of the swap, true for token0 to token1, false for token1 to token0
amountSpecifiedint256The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)
limitSqrtPriceuint160The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this value after the swap. If one for zero, the price cannot be greater than this value after the swap
databytesAny data to be passed through to the callback. If using the Router it should contain SwapRouter#SwapCallbackData

Returns:

NameTypeDescription
amount0int256
amount1int256

swapSupportingFeeOnInputTokens

swapSupportingFeeOnInputTokens(address,address,bool,int256,uint160,bytes) external

Swap token0 for token1, or token1 for token0 (tokens that have fee on transfer)

NameTypeDescription
senderaddressThe address called this function (Comes from the Router)
recipientaddressThe address to receive the output of the swap
zeroToOneboolThe direction of the swap, true for token0 to token1, false for token1 to token0
amountSpecifiedint256The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)
limitSqrtPriceuint160The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this value after the swap. If one for zero, the price cannot be greater than this value after the swap
databytesAny data to be passed through to the callback. If using the Router it should contain SwapRouter#SwapCallbackData

Returns:

NameTypeDescription
amount0int256
amount1int256

flash

flash(address,uint256,uint256,bytes) external

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

NameTypeDescription
recipientaddressThe address which will receive the token0 and token1 amounts
amount0uint256The amount of token0 to send
amount1uint256The amount of token1 to send
databytesAny data to be passed through to the callback

IAlgebraPoolActions

Functions

initialize

initialize(uint160) external

Sets the initial price for the pool

NameTypeDescription
priceuint160the initial sqrt price of the pool as a Q64.96

mint

mint(address,address,int24,int24,uint128,bytes) external

Adds liquidity for the given recipient/bottomTick/topTick position

NameTypeDescription
senderaddressThe address which will receive potential surplus of paid tokens
recipientaddressThe address for which the liquidity will be created
bottomTickint24The lower tick of the position in which to add liquidity
topTickint24The upper tick of the position in which to add liquidity
amountuint128The desired amount of liquidity to mint
databytesAny data that should be passed through to the callback

Returns:

NameTypeDescription
amount0uint256
amount1uint256
liquidityActualuint128

collect

collect(address,int24,int24,uint128,uint128) external

Collects tokens owed to a position

NameTypeDescription
recipientaddressThe address which should receive the fees collected
bottomTickint24The lower tick of the position for which to collect fees
topTickint24The upper tick of the position for which to collect fees
amount0Requesteduint128How much token0 should be withdrawn from the fees owed
amount1Requesteduint128How much token1 should be withdrawn from the fees owed

Returns:

NameTypeDescription
amount0uint128
amount1uint128

burn

burn(int24,int24,uint128) external

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

NameTypeDescription
bottomTickint24The lower tick of the position for which to burn liquidity
topTickint24The upper tick of the position for which to burn liquidity
amountuint128How much liquidity to burn

Returns:

NameTypeDescription
amount0uint256
amount1uint256

swap

swap(address,bool,int256,uint160,bytes) external

Swap token0 for token1, or token1 for token0

NameTypeDescription
recipientaddressThe address to receive the output of the swap
zeroToOneboolThe direction of the swap, true for token0 to token1, false for token1 to token0
amountSpecifiedint256The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)
limitSqrtPriceuint160The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this value after the swap. If one for zero, the price cannot be greater than this value after the swap
databytesAny data to be passed through to the callback. If using the Router it should contain SwapRouter#SwapCallbackData

Returns:

NameTypeDescription
amount0int256
amount1int256

swapSupportingFeeOnInputTokens

swapSupportingFeeOnInputTokens(address,address,bool,int256,uint160,bytes) external

Swap token0 for token1, or token1 for token0 (tokens that have fee on transfer)

NameTypeDescription
senderaddressThe address called this function (Comes from the Router)
recipientaddressThe address to receive the output of the swap
zeroToOneboolThe direction of the swap, true for token0 to token1, false for token1 to token0
amountSpecifiedint256The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)
limitSqrtPriceuint160The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this value after the swap. If one for zero, the price cannot be greater than this value after the swap
databytesAny data to be passed through to the callback. If using the Router it should contain SwapRouter#SwapCallbackData

Returns:

NameTypeDescription
amount0int256
amount1int256

flash

flash(address,uint256,uint256,bytes) external

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

NameTypeDescription
recipientaddressThe address which will receive the token0 and token1 amounts
amount0uint256The amount of token0 to send
amount1uint256The amount of token1 to send
databytesAny data to be passed through to the callback

IAlgebraPoolActions

Functions

initialize

initialize(uint160) external

Sets the initial price for the pool

NameTypeDescription
priceuint160the initial sqrt price of the pool as a Q64.96

mint

mint(address,address,int24,int24,uint128,bytes) external

Adds liquidity for the given recipient/bottomTick/topTick position

NameTypeDescription
senderaddressThe address which will receive potential surplus of paid tokens
recipientaddressThe address for which the liquidity will be created
bottomTickint24The lower tick of the position in which to add liquidity
topTickint24The upper tick of the position in which to add liquidity
amountuint128The desired amount of liquidity to mint
databytesAny data that should be passed through to the callback

Returns:

NameTypeDescription
amount0uint256
amount1uint256
liquidityActualuint128

collect

collect(address,int24,int24,uint128,uint128) external

Collects tokens owed to a position

NameTypeDescription
recipientaddressThe address which should receive the fees collected
bottomTickint24The lower tick of the position for which to collect fees
topTickint24The upper tick of the position for which to collect fees
amount0Requesteduint128How much token0 should be withdrawn from the fees owed
amount1Requesteduint128How much token1 should be withdrawn from the fees owed

Returns:

NameTypeDescription
amount0uint128
amount1uint128

burn

burn(int24,int24,uint128) external

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

NameTypeDescription
bottomTickint24The lower tick of the position for which to burn liquidity
topTickint24The upper tick of the position for which to burn liquidity
amountuint128How much liquidity to burn

Returns:

NameTypeDescription
amount0uint256
amount1uint256

swap

swap(address,bool,int256,uint160,bytes) external

Swap token0 for token1, or token1 for token0

NameTypeDescription
recipientaddressThe address to receive the output of the swap
zeroToOneboolThe direction of the swap, true for token0 to token1, false for token1 to token0
amountSpecifiedint256The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)
limitSqrtPriceuint160The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this value after the swap. If one for zero, the price cannot be greater than this value after the swap
databytesAny data to be passed through to the callback. If using the Router it should contain SwapRouter#SwapCallbackData

Returns:

NameTypeDescription
amount0int256
amount1int256

swapSupportingFeeOnInputTokens

swapSupportingFeeOnInputTokens(address,address,bool,int256,uint160,bytes) external

Swap token0 for token1, or token1 for token0 (tokens that have fee on transfer)

NameTypeDescription
senderaddressThe address called this function (Comes from the Router)
recipientaddressThe address to receive the output of the swap
zeroToOneboolThe direction of the swap, true for token0 to token1, false for token1 to token0
amountSpecifiedint256The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)
limitSqrtPriceuint160The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this value after the swap. If one for zero, the price cannot be greater than this value after the swap
databytesAny data to be passed through to the callback. If using the Router it should contain SwapRouter#SwapCallbackData

Returns:

NameTypeDescription
amount0int256
amount1int256

flash

flash(address,uint256,uint256,bytes) external

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

NameTypeDescription
recipientaddressThe address which will receive the token0 and token1 amounts
amount0uint256The amount of token0 to send
amount1uint256The amount of token1 to send
databytesAny data to be passed through to the callback

IAlgebraPoolActions

Functions

initialize

initialize(uint160) external

Sets the initial price for the pool

NameTypeDescription
priceuint160the initial sqrt price of the pool as a Q64.96

mint

mint(address,address,int24,int24,uint128,bytes) external

Adds liquidity for the given recipient/bottomTick/topTick position

NameTypeDescription
senderaddressThe address which will receive potential surplus of paid tokens
recipientaddressThe address for which the liquidity will be created
bottomTickint24The lower tick of the position in which to add liquidity
topTickint24The upper tick of the position in which to add liquidity
amountuint128The desired amount of liquidity to mint
databytesAny data that should be passed through to the callback

Returns:

NameTypeDescription
amount0uint256
amount1uint256
liquidityActualuint128

collect

collect(address,int24,int24,uint128,uint128) external

Collects tokens owed to a position

NameTypeDescription
recipientaddressThe address which should receive the fees collected
bottomTickint24The lower tick of the position for which to collect fees
topTickint24The upper tick of the position for which to collect fees
amount0Requesteduint128How much token0 should be withdrawn from the fees owed
amount1Requesteduint128How much token1 should be withdrawn from the fees owed

Returns:

NameTypeDescription
amount0uint128
amount1uint128

burn

burn(int24,int24,uint128) external

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

NameTypeDescription
bottomTickint24The lower tick of the position for which to burn liquidity
topTickint24The upper tick of the position for which to burn liquidity
amountuint128How much liquidity to burn

Returns:

NameTypeDescription
amount0uint256
amount1uint256

swap

swap(address,bool,int256,uint160,bytes) external

Swap token0 for token1, or token1 for token0

NameTypeDescription
recipientaddressThe address to receive the output of the swap
zeroToOneboolThe direction of the swap, true for token0 to token1, false for token1 to token0
amountSpecifiedint256The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)
limitSqrtPriceuint160The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this value after the swap. If one for zero, the price cannot be greater than this value after the swap
databytesAny data to be passed through to the callback. If using the Router it should contain SwapRouter#SwapCallbackData

Returns:

NameTypeDescription
amount0int256
amount1int256

swapSupportingFeeOnInputTokens

swapSupportingFeeOnInputTokens(address,address,bool,int256,uint160,bytes) external

Swap token0 for token1, or token1 for token0 (tokens that have fee on transfer)

NameTypeDescription
senderaddressThe address called this function (Comes from the Router)
recipientaddressThe address to receive the output of the swap
zeroToOneboolThe direction of the swap, true for token0 to token1, false for token1 to token0
amountSpecifiedint256The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)
limitSqrtPriceuint160The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this value after the swap. If one for zero, the price cannot be greater than this value after the swap
databytesAny data to be passed through to the callback. If using the Router it should contain SwapRouter#SwapCallbackData

Returns:

NameTypeDescription
amount0int256
amount1int256

flash

flash(address,uint256,uint256,bytes) external

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

NameTypeDescription
recipientaddressThe address which will receive the token0 and token1 amounts
amount0uint256The amount of token0 to send
amount1uint256The amount of token1 to send
databytesAny data to be passed through to the callback