Returns the synthetic time-weighted average tick as of secondsAgo, as well as the current tick, for the given path. Returned synthetic ticks always represent tokenOut/tokenIn prices, meaning lower ticks are worse.
Cast a int256 to a int24, revert on overflow or underflow
getSyntheticTicks
For each passed path, fetches the synthetic time-weighted average tick as of secondsAgo, as well as the current tick. Then, synthetic ticks from all paths are subjected to a weighted average, where the weights are the fraction of the total input amount allocated to each path. Returned synthetic ticks always represent tokenOut/tokenIn prices, meaning lower ticks are worse. Paths must all start and end in the same token.
checkOracleSlippage
Ensures that the current (synthetic) tick over the path is no worse than maximumTickDivergence ticks away from the average as of secondsAgo
Parameters
Name
Type
Description
path
bytes
The path to fetch prices over
maximumTickDivergence
uint24
The maximum number of ticks that the price can degrade by
secondsAgo
uint32
The number of seconds ago to compute oracle prices against
checkOracleSlippage
Ensures that the current (synthetic) tick over the path is no worse than maximumTickDivergence ticks away from the average as of secondsAgo
Parameters
Name
Type
Description
paths
bytes[]
amounts
uint128[]
maximumTickDivergence
uint24
The maximum number of ticks that the price can degrade by
secondsAgo
uint32
The number of seconds ago to compute oracle prices against