interface IVolatilityOracle {
    /**
     * @notice Accesses the most recently stored metadata for a given Uniswap pool
     * @dev These values may or may not have been initialized and may or may not be
     * up to date. `tickSpacing` will be non-zero if they've been initialized.
     * @param pool The Uniswap pool for which metadata should be retrieved
     * @return maxSecondsAgo The age of the oldest observation in the pool's oracle
     * @return gamma0 The pool fee minus the protocol fee on token0, scaled by 1e6
     * @return gamma1 The pool fee minus the protocol fee on token1, scaled by 1e6
     * @return tickSpacing The pool's tick spacing
     */
    function cachedPoolMetadata(IUniswapV3Pool pool)
        external
        view
        returns (
            uint32 maxSecondsAgo,
            uint24 gamma0,
            uint24 gamma1,
            int24 tickSpacing
        );

    /**
     * @notice Accesses any of the 25 most recently stored fee growth structs
     * @dev The full array (idx=0,1,2...24) has data that spans *at least* 24 hours
     * @param pool The Uniswap pool for which fee growth should be retrieved
     * @param idx The index into the storage array
     * @return feeGrowthGlobal0X128 Total pool revenue in token0, as of timestamp
     * @return feeGrowthGlobal1X128 Total pool revenue in token1, as of timestamp
     * @return timestamp The time at which snapshot was taken and stored
     */
    function feeGrowthGlobals(IUniswapV3Pool pool, uint256 idx)
        external
        view
        returns (
            uint256 feeGrowthGlobal0X128,
            uint256 feeGrowthGlobal1X128,
            uint32 timestamp
        );

    /**
     * @notice Returns indices that the contract will use to access `feeGrowthGlobals`
     * @param pool The Uniswap pool for which array indices should be fetched
     * @return read The index that was closest to 24 hours old last time `estimate24H` was called
     * @return write The index that was written to last time `estimate24H` was called
     */
    function feeGrowthGlobalsIndices(IUniswapV3Pool pool) external view returns (uint8 read, uint8 write);

    /**
     * @notice Updates cached metadata for a Uniswap pool. Must be called at least once
     * in order for volatility to be determined. Should also be called whenever
     * protocol fee changes
     * @param pool The Uniswap pool to poke
     */
    function cacheMetadataFor(IUniswapV3Pool pool) external;

    /**
     * @notice Provides multiple estimates of IV using all stored `feeGrowthGlobals` entries for `pool`
     * @dev This is not meant to be used on-chain, and it doesn't contribute to the oracle's knowledge.
     * Please use `estimate24H` instead.
     * @param pool The pool to use for volatility estimate
     * @return IV The array of volatility estimates, scaled by 1e18
     */
    function lens(IUniswapV3Pool pool) external returns (uint256[25] memory IV);

    /**
     * @notice Estimates 24-hour implied volatility for a Uniswap pool.
     * @param pool The pool to use for volatility estimate
     * @return IV The estimated volatility, scaled by 1e18
     */
    function estimate24H(IUniswapV3Pool pool) external returns (uint256 IV);
}
/* import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol"; */
function feeGrowthGlobals(IUniswapV3Pool pool, uint256 idx)
        external
        view
        returns (
            uint256 feeGrowthGlobal0X128,
            uint256 feeGrowthGlobal1X128,
            uint32 timestamp
        );
/**
 * @notice Accesses any of the 25 most recently stored fee growth structs
 * @dev The full array (idx=0,1,2...24) has data that spans *at least* 24 hours
 * @param pool The Uniswap pool for which fee growth should be retrieved
 * @param idx The index into the storage array
 * @return feeGrowthGlobal0X128 Total pool revenue in token0, as of timestamp
 * @return feeGrowthGlobal1X128 Total pool revenue in token1, as of timestamp
 * @return timestamp The time at which snapshot was taken and stored
 */