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
Name | Type | Description |
---|---|---|
|
| The path of the swap, i.e. each token pair and the pool fee |
|
| The amount of the first token to swap |
Returns
Name | Type | Description |
---|---|---|
|
| The amount of the last token that would be received |
|
| List of the sqrt price after the swap for each v2 pool in the path, 0 for v1 pools |
|
| List of the initialized ticks that the swap crossed for each v2 pool in the path, 0 for v1 pools |
|
| 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
Name | Type | Description |
---|---|---|
|
| The params for the quote, encoded as |
Returns
Name | Type | Description |
---|---|---|
|
| The amount of |
|
| The sqrt price of the pool after the swap |
|
| The number of initialized ticks that the swap crossed |
|
| 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
Name | Type | Description |
---|---|---|
|
| The params for the quote, encoded as |
Returns
Name | Type | Description |
---|---|---|
|
| The amount of |
Structs
QuoteExactInputSingleV2Params
QuoteExactInputSingleV1Params
Last updated