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:
Name Type Description tradingFeeRate int16 The trading fee rate for which to retrieve the liquidity amount. Return Values:
Name Type Description amount uint256 The 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:
Name Type Description tradingFeeRate int16 The trading fee rate for which to retrieve the available liquidity amount. Return Values:
Name Type Description amount uint256 The 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:
Name Type Description tradingFeeRates int16[] The list of trading fee rate for which to retrieve the bin value. Return Values:
Name Type Description values uint256[] 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:
Name Type Description receiptId uint256 The ID of the liquidity receipt to retrieve. Return Values:
Name Type Description [0] struct LpReceipt receipt 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:
Name Type Description receiptIds uint256[] The ID list of the liquidity receipt to retrieve. Return Values:
Name Type Description [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:
Name Type Description tradingFeeRate int16 The trading fee rate for which to retrieve the pending liquidity. Return Values:
Name Type Description [0] struct PendingLiquidity pendingLiquidity 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:
Name Type Description tradingFeeRates int16[] The list of trading fee rates for which to retrieve the pending liquidity. Return Values:
Name Type Description [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:
Name Type Description tradingFeeRate int16 The trading fee rate for which to retrieve the claimable liquidity. oracleVersion uint256 The oracle version for which to retrieve the claimable liquidity. Return Values:
Name Type Description [0] struct ClaimableLiquidity claimableLiquidity 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:
Name Type Description tradingFeeRates int16[] The list of trading fee rates for which to retrieve the claimable liquidity. oracleVersion uint256 The oracle version for which to retrieve the claimable liquidity. Return Values:
Name Type Description [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:
Name Type Description [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:
Name Type Description positionId uint256 The ID of the position to retrieve. Return Values:
Name Type Description [0] struct Position position The position with the specified ID.
getPositions
function getPositions(uint256[] positionIds) external view returns (struct Position[] positions)
Retrieves multiple positions by their IDs.
Parameters:
Name Type Description positionIds uint256[] The IDs of the positions to retrieve. Return Values:
Name Type Description positions struct 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:
Name Type Description tradingFeeRate int16 The trading fee rate for which to retrieve the pending position. Return Values:
Name Type Description [0] struct PendingPosition pendingPosition 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:
Name Type Description tradingFeeRates int16[] The list of trading fee rates for which to retrieve the pending position. Return Values:
Name Type Description [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:
Name Type Description tradingFeeRate int16 The trading fee rate for which to retrieve the closing position. Return Values:
Name Type Description [0] struct ClosingPosition closingPosition 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:
Name Type Description tradingFeeRates int16[] The list of trading fee rates for which to retrieve the closing position. Return Values:
Name Type Description [0] struct ClosingPosition[] pendingPositionBatch An array of PendingPosition instances representing the closing position information for each trading fee rate.