Skip to main content

IMarketLens.sol

IMarketLens

The interface for liquidity information retrieval in a market.

getBinLiquidity

function getBinLiquidity(int16 tradingFeeRate) external view returns (uint256 amount)

Retrieves the total liquidity amount for a specific trading fee rate in the liquidity pool.

  • Parameters:

    NameTypeDescription
    tradingFeeRateint16The trading fee rate for which to retrieve the liquidity amount.
  • Return Values:

    NameTypeDescription
    amountuint256The total liquidity amount for the specified trading fee rate.

getBinFreeLiquidity

function getBinFreeLiquidity(int16 tradingFeeRate) external view returns (uint256 amount)

Retrieves the available (free) liquidity amount for a specific trading fee rate in the liquidity pool.

  • Parameters:

    NameTypeDescription
    tradingFeeRateint16The trading fee rate for which to retrieve the available liquidity amount.
  • Return Values:

    NameTypeDescription
    amountuint256The available (free) liquidity amount for the specified trading fee rate.

getBinValues

function getBinValues(int16[] tradingFeeRates) external view returns (uint256[] values)

Retrieves the values of a specific trading fee rate's bins in the liquidity pool. The value of a bin represents the total valuation of the liquidity in the bin.

  • Parameters:

    NameTypeDescription
    tradingFeeRatesint16[]The list of trading fee rate for which to retrieve the bin value.
  • Return Values:

    NameTypeDescription
    valuesuint256[]The value list of the bins for the specified trading fee rates.

getLpReceipt

function getLpReceipt(uint256 receiptId) external view returns (struct LpReceipt)

Retrieves the liquidity receipt with the given receipt ID. It throws NotExistLpReceipt if the specified receipt ID does not exist.

  • Parameters:

    NameTypeDescription
    receiptIduint256The ID of the liquidity receipt to retrieve.
  • Return Values:

    NameTypeDescription
    [0]struct LpReceiptreceipt The liquidity receipt with the specified ID.

getLpReceipts

function getLpReceipts(uint256[] receiptIds) external view returns (struct LpReceipt[])

Retrieves the liquidity receipts with the given receipt IDs. It throws NotExistLpReceipt if the specified receipt ID does not exist.

  • Parameters:

    NameTypeDescription
    receiptIdsuint256[]The ID list of the liquidity receipt to retrieve.
  • Return Values:

    NameTypeDescription
    [0]struct LpReceipt[]receipts The liquidity receipt list with the specified IDs.

pendingLiquidity

function pendingLiquidity(int16 tradingFeeRate) external view returns (struct PendingLiquidity)

Retrieves the pending liquidity information for a specific trading fee rate from the associated LiquidityPool.

  • Parameters:

    NameTypeDescription
    tradingFeeRateint16The trading fee rate for which to retrieve the pending liquidity.
  • Return Values:

    NameTypeDescription
    [0]struct PendingLiquiditypendingLiquidity An instance of PendingLiquidity representing the pending liquidity information.

pendingLiquidityBatch

function pendingLiquidityBatch(int16[] tradingFeeRates) external view returns (struct PendingLiquidity[])

Retrieves the pending liquidity information for multiple trading fee rates from the associated LiquidityPool.

  • Parameters:

    NameTypeDescription
    tradingFeeRatesint16[]The list of trading fee rates for which to retrieve the pending liquidity.
  • Return Values:

    NameTypeDescription
    [0]struct PendingLiquidity[]pendingLiquidityBatch An array of PendingLiquidity instances representing the pending liquidity information for each trading fee rate.

claimableLiquidity

function claimableLiquidity(int16 tradingFeeRate, uint256 oracleVersion) external view returns (struct ClaimableLiquidity)

Retrieves the claimable liquidity information for a specific trading fee rate and oracle version from the associated LiquidityPool.

  • Parameters:

    NameTypeDescription
    tradingFeeRateint16The trading fee rate for which to retrieve the claimable liquidity.
    oracleVersionuint256The oracle version for which to retrieve the claimable liquidity.
  • Return Values:

    NameTypeDescription
    [0]struct ClaimableLiquidityclaimableLiquidity An instance of ClaimableLiquidity representing the claimable liquidity information.

claimableLiquidityBatch

function claimableLiquidityBatch(int16[] tradingFeeRates, uint256 oracleVersion) external view returns (struct ClaimableLiquidity[])

Retrieves the claimable liquidity information for multiple trading fee rates and a specific oracle version from the associated LiquidityPool.

  • Parameters:

    NameTypeDescription
    tradingFeeRatesint16[]The list of trading fee rates for which to retrieve the claimable liquidity.
    oracleVersionuint256The oracle version for which to retrieve the claimable liquidity.
  • Return Values:

    NameTypeDescription
    [0]struct ClaimableLiquidity[]claimableLiquidityBatch An array of ClaimableLiquidity instances representing the claimable liquidity information for each trading fee rate.

liquidityBinStatuses

function liquidityBinStatuses() external view returns (struct LiquidityBinStatus[])

Retrieves the liquidity bin statuses for the caller's liquidity pool.

  • Return Values:

    NameTypeDescription
    [0]struct LiquidityBinStatus[]statuses An array of LiquidityBinStatus representing the liquidity bin statuses.

getPosition

function getPosition(uint256 positionId) external view returns (struct Position)

Retrieves the position with the given position ID. It throws NotExistPosition if the specified position ID does not exist.

  • Parameters:

    NameTypeDescription
    positionIduint256The ID of the position to retrieve.
  • Return Values:

    NameTypeDescription
    [0]struct Positionposition The position with the specified ID.

getPositions

function getPositions(uint256[] positionIds) external view returns (struct Position[] positions)

Retrieves multiple positions by their IDs.

  • Parameters:

    NameTypeDescription
    positionIdsuint256[]The IDs of the positions to retrieve.
  • Return Values:

    NameTypeDescription
    positionsstruct Position[]An array of retrieved positions.

pendingPosition

function pendingPosition(int16 tradingFeeRate) external view returns (struct PendingPosition)

Retrieves the pending position information for a specific trading fee rate from the associated LiquidityPool.

  • Parameters:

    NameTypeDescription
    tradingFeeRateint16The trading fee rate for which to retrieve the pending position.
  • Return Values:

    NameTypeDescription
    [0]struct PendingPositionpendingPosition An instance of PendingPosition representing the pending position information.

pendingPositionBatch

function pendingPositionBatch(int16[] tradingFeeRates) external view returns (struct PendingPosition[])

Retrieves the pending position information for multiple trading fee rates from the associated LiquidityPool.

  • Parameters:

    NameTypeDescription
    tradingFeeRatesint16[]The list of trading fee rates for which to retrieve the pending position.
  • Return Values:

    NameTypeDescription
    [0]struct PendingPosition[]pendingPositionBatch An array of PendingPosition instances representing the pending position information for each trading fee rate.

closingPosition

function closingPosition(int16 tradingFeeRate) external view returns (struct ClosingPosition)

Retrieves the closing position information for a specific trading fee rate from the associated LiquidityPool.

  • Parameters:

    NameTypeDescription
    tradingFeeRateint16The trading fee rate for which to retrieve the closing position.
  • Return Values:

    NameTypeDescription
    [0]struct ClosingPositionclosingPosition An instance of PendingPosition representing the closing position information.

closingPositionBatch

function closingPositionBatch(int16[] tradingFeeRates) external view returns (struct ClosingPosition[])

Retrieves the closing position information for multiple trading fee rates from the associated LiquidityPool.

  • Parameters:

    NameTypeDescription
    tradingFeeRatesint16[]The list of trading fee rates for which to retrieve the closing position.
  • Return Values:

    NameTypeDescription
    [0]struct ClosingPosition[]pendingPositionBatch An array of PendingPosition instances representing the closing position information for each trading fee rate.