OracleLibrary
Provides functions to integrate with V3 pool oracle
Functions
consult
Calculates time-weighted means of tick and liquidity for a given Uniswap V3 pool
Parameters:
Name | Type | Description |
---|---|---|
| address | Address of Uniswap V3 pool that we want to observe |
| uint32 | Number of seconds in the past to start calculating time-weighted average |
Return Values:
Name | Type | Description |
---|---|---|
| int24 | The arithmetic mean tick from (block.timestamp - secondsAgo) to block.timestamp |
| uint128 | The harmonic mean liquidity from (block.timestamp - secondsAgo) to block.timestamp |
getQuoteAtTick
Given a tick and a token amount, calculates the amount of token received in exchange
Parameters:
Name | Type | Description |
---|---|---|
| int24 | Tick value used to calculate the quote |
| uint128 | Amount of token to be converted |
| address | Address of an ERC20 token contract used as the baseAmount denomination |
| address | Address of an ERC20 token contract used as the quoteAmount denomination |
Return Values:
Name | Type | Description |
---|---|---|
| uint256 | Amount of quoteToken received for baseAmount of baseToken |
Last updated