IMaverickV2Quoter
Functions
calculateSwap
Calculates a swap on a MaverickV2Pool and returns the resulting amount and estimated gas. The gas estimate is only a rough estimate and may not match a swap's gas.
Parameters
Name | Type | Description |
---|---|---|
|
| The MaverickV2Pool to swap on. |
|
| The input amount. |
|
| Indicates if token A is the input token. |
|
| Indicates if the amount is the output amount (true) or input amount (false). If the tickLimit is reached, the full value of the exactOutput may not be returned because the pool will stop swapping before the whole order is filled. |
|
| The tick limit for the swap. Once the swap lands in this tick, it will stop and return the output amount swapped up to that tick. |
calculateMultiHopSwap
Calculates a multihop swap and returns the resulting amount and estimated gas. The gas estimate is only a rough estimate and may not match a swap's gas.
Parameters
Name | Type | Description |
---|---|---|
|
| The path of pools to swap through. Path is given by an packed array of (pool, tokenAIn) tuples. So each step in the path is 160 + 8 = 168 bits of data. e.g. path = abi.encodePacked(pool1, true, pool2, false); |
|
| The input amount. |
|
| A boolean indicating if exact output is required. |
calculateAddLiquidity
Computes the token amounts required for a given set of addLiquidity parameters. The gas estimate is only a rough estimate and may not match a add's gas.
poolSqrtPrice
Pool's sqrt price.
Errors
QuoterInvalidSwap
QuoterInvalidAddLiquidity
Last updated