PoolInspection

Functions

poolSqrtPrice

Calculates the square root price of a given Maverick V2 pool.

function poolSqrtPrice(IMaverickV2Pool pool) internal view returns (uint256 sqrtPrice);

Parameters

NameTypeDescription

pool

IMaverickV2Pool

The Maverick V2 pool to inspect.

Returns

NameTypeDescription

sqrtPrice

uint256

The square root price of the pool.

userSubaccountBinReserves

Retrieves the reserves of a user's subaccount for a specific bin.

function userSubaccountBinReserves(IMaverickV2Pool pool, address user, uint256 subaccount, uint32 binId)
    internal
    view
    returns (uint256 amountA, uint256 amountB, int32 tick, uint256 liquidity);

subaccountPositionInformation

Retrieves the reserves of a token for all bins associated with it.

function subaccountPositionInformation(IMaverickV2Pool pool, address user, uint256 subaccount, uint32[] memory binIds)
    internal
    view
    returns (
        uint256 amountA,
        uint256 amountB,
        uint256[] memory binAAmounts,
        uint256[] memory binBAmounts,
        int32[] memory ticks,
        uint256[] memory liquidities
    );

binLpBalances

function binLpBalances(IMaverickV2Pool pool, uint32[] memory binIds, uint256 subaccount)
    internal
    view
    returns (uint128[] memory amounts);

lpBalanceForTargetReserveAmounts

function lpBalanceForTargetReserveAmounts(
    IMaverickV2Pool pool,
    uint32 binId,
    uint256 amountA,
    uint256 amountB,
    uint256 scaleA,
    uint256 scaleB
) internal view returns (IMaverickV2Pool.AddLiquidityParams memory addParams);

maxRemoveParams

function maxRemoveParams(IMaverickV2Pool pool, uint32 binId, address user, uint256 subaccount)
    internal
    view
    returns (IMaverickV2Pool.RemoveLiquidityParams memory params);

Last updated