# MaverickV2PoolLens

**Inherits:** [IMaverickV2PoolLens](https://docs.mav.xyz/technical-reference/maverick-v2/v2-contracts/maverick-v2-supplemental-contracts/interfaces/imaverickv2poollens)

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

### Functions <a href="#functions" id="functions"></a>

#### getAddLiquidityParams <a href="#getaddliquidityparams" id="getaddliquidityparams"></a>

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.

```solidity
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 <a href="#getaddliquidityparamsforboostedposition" id="getaddliquidityparamsforboostedposition"></a>

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.

```solidity
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 <a href="#getcreateboostedpositionparams" id="getcreateboostedpositionparams"></a>

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.

```solidity
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 <a href="#getcreatepoolatpriceandaddliquidityparams" id="getcreatepoolatpriceandaddliquidityparams"></a>

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

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

#### getTicksAroundActive <a href="#getticksaroundactive" id="getticksaroundactive"></a>

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

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

#### getTicks <a href="#getticks" id="getticks"></a>

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

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

#### getFullPoolState <a href="#getfullpoolstate" id="getfullpoolstate"></a>

View function that provides pool state information.

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

#### getTickSqrtPriceAndL <a href="#getticksqrtpriceandl" id="getticksqrtpriceandl"></a>

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

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

#### getPoolSqrtPrice <a href="#getpoolsqrtprice" id="getpoolsqrtprice"></a>

Pool sqrt price.

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

#### getPoolPrice <a href="#getpoolprice" id="getpoolprice"></a>

Pool price.

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

#### tokenScales <a href="#tokenscales" id="tokenscales"></a>

Token scale of two tokens in a pool.

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

<br>
