IMaverickV2PoolLens
Functions
getAddLiquidityParams
Converts add parameter slippage specification into add parameters. The return values are given in both raw format and as packed values that can be used in the LiquidityManager contract.
getAddLiquidityParamsForBoostedPosition
Converts add parameter slippage specification for a boosted position into add parameters. The return values are given in both raw format and as packed values that can be used in the LiquidityManager contract.
getCreateBoostedPositionParams
Converts add parameter slippage specification and boosted position specification into add parameters. The return values are given in both raw format and as packed values that can be used in the LiquidityManager contract.
getCreatePoolAtPriceAndAddLiquidityParams
Converts add parameter slippage specification and new pool specification into CreateAndAddParamsInputs parameters that can be used in the LiquidityManager contract.
getTicksAroundActive
View function that provides information about pool ticks within a tick radius from the activeTick.
getTicks
View function that provides information about pool ticks within a range.
getFullPoolState
View function that provides pool state information.
getTickSqrtPriceAndL
View function that provides price and liquidity of a given tick.
getPoolSqrtPrice
Pool sqrt price.
getPoolPrice
Pool price.
tokenScales
Token scale of two tokens in a pool.
Errors
LensTargetPriceOutOfBounds
LensTooLittleLiquidity
LensTargetingTokenWithNoDelta
Structs
AddParamsViewInputs
Add liquidity slippage parameters for a distribution of liquidity.
Properties
Name | Type | Description |
---|---|---|
|
| Pool where liquidity is being added. |
|
| Bin kind; all bins must have the same kind in a given call to addLiquidity. |
|
| Array of tick values to add liquidity to. |
|
| Relative liquidity amounts for the specified ticks. Liquidity in this case is not bin LP balance, it is the bin liquidity as defined by liquidity = deltaA / (sqrt(upper) - sqrt(lower)) or deltaB = liquidity / sqrt(lower) - liquidity / sqrt(upper). |
|
| Slippage specification. |
AddParamsSpecification
Multi-price add param specification.
Properties
Name | Type | Description |
---|---|---|
|
| Max slippage allowed as a percent in D18 scale. e.g. 1% slippage is 0.01e18 |
|
| Number of price break values on either side of current price. |
|
| Target token contribution amount in tokenA if targetIsA is true, otherwise this is the target amount for tokenB. |
|
| Indicates if the target amount is for tokenA or tokenB |
CreateBoostedPositionInputs
Boosted position creation specification and add parameters.
Properties
Name | Type | Description |
---|---|---|
|
| Boosted position kind/binId/ratio information. |
|
| Array of sqrt price breaks packed into bytes. These breaks act as a lookup table for the packedArgs array to indicate to the Liquidity manager what add liquidity parameters from packedArgs to use depending on the price of the pool at add time. |
|
| Array of bytes arguments. Each array element is a packed version of addLiquidity paramters. |
CreateAndAddParamsViewInputs
Specification for deriving create pool parameters. Creating a pool in the liquidity manager has several steps:
Deploy pool
Donate a small amount of initial liquidity in the activeTick
Execute a small swap to set the pool price to the desired value
Add liquidity In order to execute these steps, the caller must specify the parameters of each step. The PoolLens has helper function to derive the values used by the LiquidityManager, but this struct is the input to that helper function and represents the core intent of the pool creator.
Properties
Name | Type | Description |
---|---|---|
|
| |
|
| |
|
| Tick spacing of pool where 1.0001^tickSpacing is the bin width. |
|
| Pool lookback in second in D2 scale. |
|
| Address of tokenA. |
|
| Address of tokenB. |
|
| Tick position that contains the active bins. |
|
| 1-15 number to represent the active kinds 0b0001 = static; 0b0010 = right; 0b0100 = left; 0b1000 = both. e.g. a pool with all 4 modes will have kinds = b1111 = 15 |
|
| Amount of B to be donated to the pool after pool create. This amount needs to be big enough to meet the minimum bin liquidity. |
|
| Target sqrt price of the pool. |
|
| Bin kind; all bins must have the same kind in a given call to addLiquidity. |
|
| Array of tick values to add liquidity to. |
|
| Relative liquidity amounts for the specified ticks. Liquidity in this case is not bin LP balance, it is the bin liquidity as defined by liquidity = deltaA / (sqrt(upper) - sqrt(lower)) or deltaB = liquidity / sqrt(lower) - liquidity / sqrt(upper). |
|
| Target token contribution amount in tokenA if targetIsA is true, otherwise this is the target amount for tokenB. |
|
| Indicates if the target amount is for tokenA or tokenB |
Output
Reserves
BinPositionKinds
PoolState
BoostedPositionSpecification
CreateAndAddParamsInputs
TickDeltas
Last updated