Skip to main content

MarketLensFacet.sol

MarketLensFacet

Contract 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 receipt)

Throws a NotExistLpReceipt error if the liquidity receipt does not exist.

  • Parameters:

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

    NameTypeDescription
    receiptstruct LpReceiptreceipt The liquidity receipt with the specified ID.

getLpReceipts

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

Throws a NotExistLpReceipt error if the liquidity receipt does not exist.

  • Parameters:

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

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

pendingLiquidity

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

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
    liquiditystruct PendingLiquiditypendingLiquidity An instance of PendingLiquidity representing the pending liquidity information.

pendingLiquidityBatch

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

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
    liquiditiesstruct 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 liquidity)

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
    liquiditystruct ClaimableLiquidityclaimableLiquidity An instance of ClaimableLiquidity representing the claimable liquidity information.

claimableLiquidityBatch

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

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
    liquiditiesstruct 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[] statuses)

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

  • Return Values:

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

getPosition

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

Throws a NotExistPosition error if the position does not exist.

  • Parameters:

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

    NameTypeDescription
    positionstruct 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 position)

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
    positionstruct PendingPositionpendingPosition An instance of PendingPosition representing the pending position information.

pendingPositionBatch

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

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
    positionsstruct 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 position)

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
    positionstruct ClosingPositionclosingPosition An instance of PendingPosition representing the closing position information.

closingPositionBatch

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

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
    positionsstruct ClosingPosition[]pendingPositionBatch An array of PendingPosition instances representing the closing position information for each trading fee rate.