MCDEX
Search…
Liquidity Pool

Pool Basic Info

This sections shows how to get liquidity volume from LiquidityPool entity

Entity: LiquidityPool

Field
Value Type
Description
id
ID
liquidityPool address
poolName
string
name of liquidity pool
factory
Factory!
factory of this pool
collateralName
string
collateral name of this pool
collateralAmount
BigDecimal
collateral amount of this pool
collateralUSD
BigDecimal
collateral in USD of this pool
collateralAddress
string
collateral address of this pool
voteAddress
string
vote address of this pool
shareAddress
string
share token address of this pool
operatorAddress
string
operator address of this pool
operatorExpiration
BigInt
operator expiration timestamp of this pool
collateralDecimals
BigInt
collateral decimal of this pool
perpetuals
array of Perpetual
perpetuals of this pool
perpetualIDs
array of string
perpetuals ids of this pool
governor
Governor
governor of this pool
liquidityHisCount
BigInt
liquidity history count of this pool
liquidityAccounts
array of LiquidityAccount
liquidity accounts of this pool
poolMargin
BigDecimal
total pool margin(liquidity + insurance + trader's margin)
poolMarginUSD
BigDecimal
total pool margin(liquidity + insurance + trader's margin) in USD
liquidityProviderCount
BigInt
liquidity provider count
shareToken
ShareToken
share token of this pool
createdAtTimestamp
BigInt
created timestamp
createdAtBlockNumber
BigInt
created block number
isRun
Boolean
true if running
lpExcessInsuranceFund
BigDecimal
insurance fund

Query Example

Query BUSD Pool's information bsc: getPoolInfo
1
{
2
liquidityPools(where: {id: "0xdb282bbace4e375ff2901b84aceb33016d0d663d"}) {
3
id
4
collateralName
5
collateralAmount
6
collateralUSD
7
operatorAddress
8
}
9
}
Copied!

Pool Net Asset Value

This section shows how to get net asset value from PoolDayData & PoolHourData entities.

Entity: PoolDayData & PoolHourData

Field
Value Type
Description
id
ID
pool address + "-" + timeindex (timestamp / 3600 for hour, 3600*24 for day)
liquidityPool
string
address of liquidity pool
poolMargin
BigDecimal
margin of this pool
poolMarginUSD
BigDecimal
margin in usd of this pool
netAssetValue
BigDecimal
net asset value of this pool
timestamp
BigInt
timestamp

Query Example

Query BUSD Pool's net asset value history bsc: getPoolNAV
1
{
2
poolDayDatas(first: 10 orderBy:timestamp orderDirection:desc,
3
where: {liquidityPool: "0xdb282bbace4e375ff2901b84aceb33016d0d663d"}) {
4
liquidityPool
5
netAssetValue
6
timestamp
7
}
8
}
Copied!

Pool Governor

This sections shows how to get liquidity pool governor information from Governor entity

Entity: Governor

Field
Value Type
Description
id
ID
governor contract address
liquidityPool
LiquidityPool
liquidity pool of governor
totalVotes
BigDecimal!
total vote counts of this pool
totalReward
BigDecimal!
total reward for liquidity mining
rewardRate
BigDecimal!
reward rate of each block for liquidity mining
preRewardRate
BigDecimal!
pre-reward rate of each block for liquidity mining
changeRewardBlock
BigInt!
reward rate/reward changed at blocknumber
proposalCount
BigInt!
total proposal count
periodFinish
BigInt!
the blocknumber that liquidity mining finish
proposals
Proposal!
proposals in this pool
voteAccounts
voteAccount!
voteAccounts in this pool

Query Example

Query BUSD Pool's governor information bsc: getGovernorInfo
1
{
2
governors(where: {liquidityPool: "0xdb282bbace4e375ff2901b84aceb33016d0d663d"}) {
3
id
4
liquidityPool {
5
id
6
}
7
totalVotes
8
totalReward
9
rewardRate
10
preRewardRate
11
changeRewardBlock
12
proposalCount
13
periodFinish
14
proposals {
15
id
16
}
17
voteAccounts {
18
id
19
}
20
}
21
}
Copied!

Proposal

Entity: Proposal

Field
Value Type
Description
id
ID
governor contract address + "-" + proposal index
index
BigInt
proposal index in this pool
governor
Governor!
governor of this proposal
proposer
User!
proposer of this proposal
signatures
[String!]
signatures of this proposal
description
String!
description of this proposal
calldatas
[Bytes!]
calldatas of this proposal
startBlock
BigInt
startBlock of this proposal
endBlock
BigInt
endBlock of this proposal
quorumVotes
BigInt
quorumVotes of this proposal
for
BigDecimal
for of this proposal
against
BigDecimal
against of this proposal
isExecuted
Boolean
isExeucted for this proposal
executedBlockNumber
BigInt
executedBlockNumber
timestamp
Boolean
create timestamp for this proposal
votes
[Vote]
vote info for this proposal

Query Example

Query proposals information bsc: getProposals
1
{
2
proposals(where:{governor:"0x0b89c6cd4b726425f26d46ea32f1473f95ad7fb7"}) {
3
id
4
governor {
5
id
6
}
7
proposer {
8
id
9
}
10
signatures
11
description
12
startBlock
13
endBlock
14
quorumVotes
15
for
16
against
17
isExecuted
18
executedBlockNumber
19
timestamp
20
votes {
21
id
22
}
23
}
24
}
Copied!
Last modified 13d ago