MCDEX
Search…
Get Pool Info
This guide shows how to get pool by using the ILiquidityPoolFull interface and get related information from pool object.

Get Pool Object

Function

function getLiquidityPoolInfo()
Return information from pool object
returns
type
description
isRunning
bool
true if the liquidity pool is running
isFastCreationEnabled
bool
true if the operator of the liquidity pool is allowed to create new perpetual when the liquidity pool is running
addresses
array of address
  • [0]: creator: address of creator
  • [1]: operator: address of operator
  • [2]: transferringOperator: address of transfer operator
  • [3]: governor: address of governor
  • [4]: shareToken: address of share token
  • [5]: collateral: address of collateral
  • [6]: vault: address of vault
intNums
array of int256
  • [0]: vaultFeeRate: vault fee rate
  • [1]: poolCash: the amount of cash
  • [2]: insuranceFundCap: the amount of insurance fund cap
  • [3]: insuranceFund: the amount of insurance fund
  • [4]: donatedInsuranceFund: the amount of donated insurance fund
uintNums
array of uint256
  • [0]: collateralDecimals: collateral decimal
  • [1]: perpetualCount: perpetual count
  • [2]: fundingTime: funding time
  • [3]: operatorExpiration: expiration of operator
  • [4]: liquidityCap: liquidity cap
  • [5]: shareTransferDelay: share transfer delay

Example

WARN: before calling getLiquidityPoolInfo(), need to sync the state by using the forceToSyncState function.
1
ILiquidityPoolFull liquidityPool = ILiquidityPoolFull(liquidityPoolAddress)
2
liquidityPool.forceToSyncState()
3
(isRunning, isFastCreationEnabled, addresses, intNums, uintNums) = liquidityPool.getLiquidityPoolInfo()
Copied!

Sample Code

Github
Last modified 14d ago