I'm querying the xExchange's GraphQL API, but when I'm requesting the price of an LP token the field price
is 0 (but it shouldn't). Does anyone know how to fetch the price of an LP token through this API?
Here is the query I'm doing:
query {
pairs(firstTokenID: "BUSD-40b57e") {
liquidityPoolToken {
identifier,
price
}
}
}
The response:
{
"data": {
"pairs": [
{
"liquidityPoolToken": {
"identifier": "BUSDWEGLD-c3b2f6",
"price": "0"
}
}
]
}
}
Update: I got the solution from a member of the xExchange's team.
For LP tokens, the field
price
is not used. Instead, we should use theliquidityPoolTokenPriceUSD
field available under thepair
query, like this:And the response: