MaverickV2PoolLens

Inherits: IMaverickV2PoolLens

Contract that provides both views into a pool's state as well as helpfer functions to compute paramters used by MaverickV2LiquidityManager.

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.

function getAddLiquidityParams(AddParamsViewInputs memory params)
    public
    view
    returns (
        bytes memory packedSqrtPriceBreaks,
        bytes[] memory packedArgs,
        uint88[] memory sqrtPriceBreaks,
        IMaverickV2Pool.AddLiquidityParams[] memory addParams,
        IMaverickV2PoolLens.TickDeltas[] memory tickDeltas
    );

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.

function getAddLiquidityParamsForBoostedPosition(
    IMaverickV2BoostedPosition boostedPosition,
    AddParamsSpecification memory addSpec
)
    public
    view
    returns (
        bytes memory packedSqrtPriceBreaks,
        bytes[] memory packedArgs,
        uint88[] memory sqrtPriceBreaks,
        IMaverickV2Pool.AddLiquidityParams[] memory addParams,
        IMaverickV2PoolLens.TickDeltas[] memory tickDeltas
    );

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.

function getCreateBoostedPositionParams(
    BoostedPositionSpecification memory bpSpec,
    AddParamsSpecification memory addSpec
)
    public
    view
    returns (
        bytes memory packedSqrtPriceBreaks,
        bytes[] memory packedArgs,
        uint88[] memory sqrtPriceBreaks,
        IMaverickV2Pool.AddLiquidityParams[] memory addParams,
        IMaverickV2PoolLens.TickDeltas[] memory tickDeltas
    );

getCreatePoolAtPriceAndAddLiquidityParams

Converts add parameter slippage specification and new pool specification into CreateAndAddParamsInputs parameters that can be used in the LiquidityManager contract.

function getCreatePoolAtPriceAndAddLiquidityParams(
    CreateAndAddParamsViewInputs memory params,
    IMaverickV2Factory factory
) public view returns (CreateAndAddParamsInputs memory output);

getTicksAroundActive

View function that provides information about pool ticks within a tick radius from the activeTick.

function getTicksAroundActive(IMaverickV2Pool pool, int32 tickRadius)
    public
    view
    returns (int32[] memory ticks, IMaverickV2Pool.TickState[] memory tickStates);

getTicks

View function that provides information about pool ticks within a range.

function getTicks(IMaverickV2Pool pool, int32 tickStart, int32 tickEnd)
    public
    view
    returns (int32[] memory ticks, IMaverickV2Pool.TickState[] memory tickStates);

getFullPoolState

View function that provides pool state information.

function getFullPoolState(IMaverickV2Pool pool, uint32 binStart, uint32 binEnd)
    public
    view
    returns (PoolState memory poolState);

getTickSqrtPriceAndL

View function that provides price and liquidity of a given tick.

function getTickSqrtPriceAndL(IMaverickV2Pool pool, int32 tick)
    public
    view
    returns (uint256 sqrtPrice, uint256 liquidity);

getPoolSqrtPrice

Pool sqrt price.

function getPoolSqrtPrice(IMaverickV2Pool pool) public view returns (uint256 sqrtPrice);

getPoolPrice

Pool price.

function getPoolPrice(IMaverickV2Pool pool) public view returns (uint256 price);

tokenScales

Token scale of two tokens in a pool.

function tokenScales(IMaverickV2Pool pool) public view returns (uint256 tokenAScale, uint256 tokenBScale);

Last updated