The information provided by Aloe Labs, Inc. (โwe,โ โusโ or โourโ) on docs.aloe.capital (the โSiteโ) is for general informational purposes only. All information on the Site is provided in good faith, however we make no representation or warranty of any kind, express or implied, regarding the accuracy, adequacy, validity, reliability, availability or completeness of any information on the Site.
Under no circumstance shall we have any liability to you for any loss or damage of any kind incurred as a result of the use of the site or reliance on any information provided on the site. Your use of the site and your reliance on any information on the site is solely at your own risk.
Actions
cacheMetadataFor
Updates cached metadata for a Uniswap pool.
Must be called at least once in order for volatility to be determined. To maintain volatility accuracy, this should also be called whenever Uniswap's protocol fee changes.
This method gets the age (in seconds) of the oldest observation in the Uniswap pool's circular buffer. When fetching data later on, the Volatility Oracle tries to look back either to the oldest observation or 86400 seconds, whichever is younger. Since block times vary, the exact age of the oldest observation also varies. To minimize reverts, the code stores 0.6 * maxSecondsAgo instead of the raw value. On the off chance that you do get an OLD error, re-caching pool metadata will fix things.
Arguments
pool The Uniswap pool to poke
function cacheMetadataFor(IUniswapV3Pool pool) external;
estimate24H
Estimates 24-hour implied volatility for a Uniswap pool. Must call cacheMetadataFor(pool) before this will work.
Arguments
pool The pool to use for volatility estimate
Return Values
IV The estimated implied volatility, scaled by 1e18. For annualized IV, multiply by 365โ
function estimate24H(IUniswapV3Pool pool) external returns (uint256 IV);
Derived State
lens
Provides multiple estimates of IV using all stored feeGrowthGlobals entries for pool.
This is not meant to be used on-chain because it doesn't contribute to the oracle's knowledge. Please use estimate24H(pool) instead.
Arguments
pool The pool to use for volatility estimate
Return Values
IV The array of volatility estimates, scaled by 1e18.
function lens(IUniswapV3Pool pool) external returns (uint256[25] memory IV);
State
cachedPoolMetadata
Accesses the most recently stored metadata for a given Uniswap pool.
These values may or may not have been initialized and may or may not beup to date. tickSpacing will be non-zero if they've been initialized.
Arguments
pool The Uniswap pool for which metadata should be retrieved
Return Values
maxSecondsAgo The age of the oldest observation in the pool's oracle
gamma0 The pool fee minus the protocol fee on TOKEN0, scaled by 1e6
gamma1 The pool fee minus the protocol fee on TOKEN1, scaled by 1e6