IAlgebraPoolState

Pool state that can change

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

Functions

globalState

function globalState() external view returns (uint160 price, int24 tick, uint16 fee, uint16 timepointIndex, uint8 communityFeeToken0, uint8 communityFeeToken1, bool unlocked) view external

The globalState structure in the pool stores many values but requires only one slot and is exposed as a single method to save gas when accessed externally.

Returns:

totalFeeGrowth0Token

function totalFeeGrowth0Token() external view returns (uint256) view external

The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool Developer note: This value can overflow the uint256

Returns:

totalFeeGrowth1Token

function totalFeeGrowth1Token() external view returns (uint256) view external

The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool Developer note: This value can overflow the uint256

Returns:

liquidity

function liquidity() external view returns (uint128) view external

The currently in range liquidity available to the pool Developer note: This value has no relationship to the total liquidity across all ticks. Returned value cannot exceed type(uint128).max

Returns:

ticks

function ticks(int24 tick) external view returns (uint128 liquidityTotal, int128 liquidityDelta, uint256 outerFeeGrowth0Token, uint256 outerFeeGrowth1Token, int56 outerTickCumulative, uint160 outerSecondsPerLiquidity, uint32 outerSecondsSpent, bool initialized) view external

Look up information about a specific tick in the pool Developer note: This is a public structure, so the `return` natspec tags are omitted.

Returns:

tickTable

function tickTable(int16 wordPosition) external view returns (uint256) view external

Returns 256 packed tick initialized boolean values. See TickTable for more information

Returns:

positions

function positions(bytes32 key) external view returns (uint128 liquidityAmount, uint32 lastLiquidityAddTimestamp, uint256 innerFeeGrowth0Token, uint256 innerFeeGrowth1Token, uint128 fees0, uint128 fees1) view external

Returns the information about a position by the position's key Developer note: This is a public mapping of structures, so the `return` natspec tags are omitted.

Returns:

timepoints

function timepoints(uint256 index) external view returns (bool initialized, uint32 blockTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulative, uint88 volatilityCumulative, int24 averageTick, uint144 volumePerLiquidityCumulative) view external

Returns data about a specific timepoint index Developer note: You most likely want to use #getTimepoints() instead of this method to get an timepoint as of some amount of time ago, rather than at a specific index in the array. This is a public mapping of structures, so the `return` natspec tags are omitted.

Returns:

activeIncentive

function activeIncentive() external view returns (address virtualPool) view external

Returns the information about active incentive Developer note: if there is no active incentive at the moment, virtualPool,endTimestamp,startTimestamp would be equal to 0

Returns:

liquidityCooldown

function liquidityCooldown() external view returns (uint32 cooldownInSeconds) view external

Returns the lock time for added liquidity

Returns:

tickSpacing

function tickSpacing() external view returns (int24) view external

The pool tick spacing Developer note: Ticks can only be used at multiples of this value e.g.: a tickSpacing of 60 means ticks can be initialized every 60th tick, i.e., ..., -120, -60, 0, 60, 120, ... This value is an int24 to avoid casting even though it is always positive.

Returns: