API reference v1.0
Introduction
periphery
tokenomics
IAlgebraPoolState

IAlgebraPoolState

IAlgebraPoolState

Functions

globalState

globalState() 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:

NameTypeDescription
priceuint160
tickint24
feeuint16
timepointIndexuint16
communityFeeToken0uint8
communityFeeToken1uint8
unlockedbool

totalFeeGrowth0Token

totalFeeGrowth0Token() view external

The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool

Returns:

NameTypeDescription
[0]uint256

totalFeeGrowth1Token

totalFeeGrowth1Token() view external

The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool

Returns:

NameTypeDescription
[0]uint256

liquidity

liquidity() view external

The currently in range liquidity available to the pool

Returns:

NameTypeDescription
[0]uint128

ticks

ticks(int24) view external

Look up information about a specific tick in the pool

NameTypeDescription
tickint24The tick to look up

Returns:

NameTypeDescription
liquidityTotaluint128
liquidityDeltaint128
outerFeeGrowth0Tokenuint256
outerFeeGrowth1Tokenuint256
outerTickCumulativeint56
outerSecondsPerLiquidityuint160
outerSecondsSpentuint32
initializedbool

tickTable

tickTable(int16) view external

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

NameTypeDescription
wordPositionint16

Returns:

NameTypeDescription
[0]uint256

positions

positions(bytes32) view external

Returns the information about a position by the position's key

NameTypeDescription
keybytes32The position's key is a hash of a preimage composed by the owner, bottomTick and topTick

Returns:

NameTypeDescription
liquidityAmountuint128
lastLiquidityAddTimestampuint32
innerFeeGrowth0Tokenuint256
innerFeeGrowth1Tokenuint256
fees0uint128
fees1uint128

timepoints

timepoints(uint256) view external

Returns data about a specific timepoint index

NameTypeDescription
indexuint256The element of the timepoints array to fetch

Returns:

NameTypeDescription
initializedbool
blockTimestampuint32
tickCumulativeint56
secondsPerLiquidityCumulativeuint160
volatilityCumulativeuint88
averageTickint24
volumePerLiquidityCumulativeuint144

activeIncentive

activeIncentive() view external

Returns the information about active incentive

Returns:

NameTypeDescription
virtualPooladdress

liquidityCooldown

liquidityCooldown() view external

Returns the lock time for added liquidity

Returns:

NameTypeDescription
cooldownInSecondsuint32