IMixedRouteQuoterV1
Supports quoting the calculated amounts for exact input swaps. Is specialized for routes containing a mix of V1 and V2 liquidity.
For each pool also tells you the number of initialized ticks crossed and the sqrt price of the pool after the swap.
These functions are not marked view because they rely on calling non-view functions and reverting to compute the result. They are also not gas efficient and should not be called on-chain.
Functions
quoteExactInput
Returns the amount out received for a given exact input swap without executing the swap
Parameters
path
bytes
The path of the swap, i.e. each token pair and the pool fee
amountIn
uint256
The amount of the first token to swap
Returns
amountOut
uint256
The amount of the last token that would be received
v2SqrtPriceX96AfterList
uint160[]
List of the sqrt price after the swap for each v2 pool in the path, 0 for v1 pools
v2InitializedTicksCrossedList
uint32[]
List of the initialized ticks that the swap crossed for each v2 pool in the path, 0 for v1 pools
v2SwapGasEstimate
uint256
The estimate of the gas that the v2 swaps in the path consume
quoteExactInputSingleV2
Returns the amount out received for a given exact input but for a swap of a single pool
Parameters
params
QuoteExactInputSingleV2Params
The params for the quote, encoded as QuoteExactInputSingleParams
tokenIn The token being swapped in tokenOut The token being swapped out fee The fee of the token pool to consider for the pair amountIn The desired input amount sqrtPriceLimitX96 The price limit of the pool that cannot be exceeded by the swap
Returns
amountOut
uint256
The amount of tokenOut
that would be received
sqrtPriceX96After
uint160
The sqrt price of the pool after the swap
initializedTicksCrossed
uint32
The number of initialized ticks that the swap crossed
gasEstimate
uint256
The estimate of the gas that the swap consumes
quoteExactInputSingleV1
Returns the amount out received for a given exact input but for a swap of a single V1 pool
Parameters
params
QuoteExactInputSingleV1Params
The params for the quote, encoded as QuoteExactInputSingleV1Params
tokenIn The token being swapped in tokenOut The token being swapped out amountIn The desired input amount
Returns
amountOut
uint256
The amount of tokenOut
that would be received
Structs
QuoteExactInputSingleV2Params
QuoteExactInputSingleV1Params
Last updated