IDataStorageOperator

Events

FeeConfiguration

event FeeConfiguration(bool zto, struct AdaptiveFee.Configuration feeConfig)

Functions

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 belonging to a certain timepoint Developer note: There is more convenient function to fetch a timepoint: getTimepoints(). Which requires not an index but seconds

Returns:

initialize

function initialize(uint32 time, int24 tick) external external

Initialize the dataStorage array by writing the first slot. Called once for the lifecycle of the timepoints array

getSingleTimepoint

function getSingleTimepoint(uint32 time, uint32 secondsAgo, int24 tick, uint16 index, uint128 liquidity) external view returns (int56 tickCumulative, uint160 secondsPerLiquidityCumulative, uint112 volatilityCumulative, uint256 volumePerAvgLiquidity) view external

Developer note: Reverts if an timepoint at or before the desired timepoint timestamp does not exist. 0 may be passed as `secondsAgo' to return the current cumulative values. If called with a timestamp falling between two timepoints, returns the counterfactual accumulator values at exactly the timestamp between the two timepoints.

Returns:

getTimepoints

function getTimepoints(uint32 time, uint32[] secondsAgos, int24 tick, uint16 index, uint128 liquidity) external view returns (int56[] tickCumulatives, uint160[] secondsPerLiquidityCumulatives, uint112[] volatilityCumulatives, uint256[] volumePerAvgLiquiditys) view external

Returns the accumulator values as of each time seconds ago from the given time in the array of `secondsAgos` Developer note: Reverts if `secondsAgos` > oldest timepoint

Returns:

getAverages

function getAverages(uint32 time, int24 tick, uint16 index, uint128 liquidity) external view returns (uint112 TWVolatilityAverage, uint256 TWVolumePerLiqAverage) view external

Returns average volatility in the range from time-WINDOW to time

Returns:

write

function write(uint16 index, uint32 blockTimestamp, int24 tick, uint128 liquidity, uint128 volumePerLiquidity) external returns (uint16 indexUpdated) external

Writes an dataStorage timepoint to the array Developer note: Writable at most once per block. Index represents the most recently written element. index must be tracked externally.

Returns:

changeFeeConfiguration

function changeFeeConfiguration(bool zto, struct AdaptiveFee.Configuration feeConfig) external external

Changes fee configuration for the pool

calculateVolumePerLiquidity

function calculateVolumePerLiquidity(uint128 liquidity, int256 amount0, int256 amount1) external pure returns (uint128 volumePerLiquidity) pure external

Calculates gmean(volume/liquidity) for block

Returns:

window

function window() external view returns (uint32 windowLength) view external

Returns:

getFees

function getFees(uint32 time, int24 tick, uint16 index, uint128 liquidity) external view returns (uint16 feeZto, uint16 feeOtz) view external

Calculates fee based on combination of sigmoids

Returns: