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
pool
IMaverickV2Pool
Pool where liquidity is being added.
kind
uint8
Bin kind; all bins must have the same kind in a given call to addLiquidity.
ticks
int32[]
Array of tick values to add liquidity to.
relativeLiquidityAmounts
uint128[]
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).
addSpec
AddParamsSpecification
Slippage specification.
AddParamsSpecification
Multi-price add param specification.
Properties
slippageFactorD18
uint256
Max slippage allowed as a percent in D18 scale. e.g. 1% slippage is 0.01e18
numberOfPriceBreaksPerSide
uint256
Number of price break values on either side of current price.
targetAmount
uint256
Target token contribution amount in tokenA if targetIsA is true, otherwise this is the target amount for tokenB.
targetIsA
bool
Indicates if the target amount is for tokenA or tokenB
CreateBoostedPositionInputs
Boosted position creation specification and add parameters.
Properties
bpSpec
BoostedPositionSpecification
Boosted position kind/binId/ratio information.
packedSqrtPriceBreaks
bytes
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.
packedArgs
bytes[]
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
feeAIn
uint64
feeBIn
uint64
tickSpacing
uint16
Tick spacing of pool where 1.0001^tickSpacing is the bin width.
lookback
uint32
Pool lookback in second in D2 scale.
tokenA
IERC20
Address of tokenA.
tokenB
IERC20
Address of tokenB.
activeTick
int32
Tick position that contains the active bins.
kinds
uint8
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
initialTargetB
uint256
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.
sqrtPrice
uint256
Target sqrt price of the pool.
kind
uint8
Bin kind; all bins must have the same kind in a given call to addLiquidity.
ticks
int32[]
Array of tick values to add liquidity to.
relativeLiquidityAmounts
uint128[]
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).
targetAmount
uint256
Target token contribution amount in tokenA if targetIsA is true, otherwise this is the target amount for tokenB.
targetIsA
bool
Indicates if the target amount is for tokenA or tokenB
Output
Reserves
BinPositionKinds
PoolState
BoostedPositionSpecification
CreateAndAddParamsInputs
TickDeltas
Last updated