Skip to main content

State

Queries the state of a VLP contract.


State

Queries the state of a VLP contract.

query Vlp($contract: String, $pair: PairInput) {
vlp(contract: $contract, pair: $pair) {
state {
pair {
token_1
token_2
}
router
vcoin
fee {
lp_fee_bps
euclid_fee_bps
recipient {
chain_uid
address
}
}
last_updated
total_lp_tokens
pool_config {
token_1_denom
token_2_denom
lp_token_denom
}
admin
}
}
}

Example

curl --request POST \
--header 'content-type: application/json' \
--url 'https://testnet.api.euclidprotocol.com/graphql' \
--data '{"query":"query State($contract: String) {\n vlp(contract: $contract) {\n state {\n pair {\n token_1\n token_2\n }\n router\n vcoin\n fee {\n lp_fee_bps\n euclid_fee_bps\n recipient {\n chain_uid\n address\n }\n }\n last_updated\n total_lp_tokens\n admin\n pool_config {\n stable {\n amp_factor\n }\n constant_product\n }\n }\n }\n}","variables":{"contract":"euclid1y2t7uplrund64g3qc034j7pvfnq7udfqck6k5hxnq7gxtdm30zzsxuk8v9"}}'

Open in Playground

Arguments

ArgumentTypeDescription
contractStringThe contract address of the VLP. Required if pair is not provided.
pairPairInputThe pair of tokens belonging to the VLP. Required if contract is not provided.

Return Fields

ContractStateOfVlp

FieldTypeDescription
adminStringThe admin address of the VLP.
feeFeeInfoThe fee structure of the VLP.
last_updatedIntTimestamp of the last update.
pairPairThe token pair of the VLP.
pool_configPoolConfigPool configuration (token denoms).
routerStringThe router contract address.
total_lp_tokensStringTotal LP tokens issued.
vcoinStringVirtual balance token address.

FeeInfo

FieldTypeDescription
lp_fee_bpsIntFee for liquidity providers (in basis points).
euclid_fee_bpsIntFee for Euclid treasury (in basis points).
recipientCrossChainUserThe fee recipient's cross-chain details.

Pair

FieldTypeDescription
token_1StringThe identifier of the first token.
token_2StringThe identifier of the second token.

PoolConfig

FieldTypeDescription
constant_productJSONConfiguration for constant product pools.
stableStablePoolConfigConfiguration for stable pools.

StablePoolConfig

FieldTypeDescription
amp_factorStringAmplification factor for stable pools.