嗨,我开始玩BitQuery图形it,看看它是否能帮助我查询区块链数据。对于大多数的区块链,我喜欢单一API的想法。
我有个问题。我得到的数据非常不准确,我也不知道为什么。
{
ethereum(network: bsc) {
dexTrades(
exchangeAddress: {is: "0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73"}
baseCurrency: {is: "0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82"}
quoteCurrency: {is: "0x55d398326f99059ff775485246999027b3197955"}
) {
baseCurrency {
symbol
}
quoteCurrency {
symbol
}
quotePrice
}
}
}考虑到这个查询,我想得到Cake/USDT的价格。它返回为
{
"ethereum": {
"dexTrades": [
{
"baseCurrency": {
"symbol": "Cake"
},
"quoteCurrency": {
"symbol": "USDT"
},
"quotePrice": 16.96659680611786
}
]
}
}但是,当我直接向PancakeSwap交易所查询时,价格比BitQuery结果低40% .
PancakeSwap Price = 10.70
Coingeko Price = 10.75我做错了什么吗?还是BitQUery坏了?或者是什么情况?有什么想法吗?
发布于 2022-01-23 08:17:00
我们在做同样的事情。我实际上也在玩位查询,因为我正在尝试构建一些东西,我也遇到了这个。我发现,"quotePrice“不是硬币或令牌的实际价格。这只是平均报价,你可以用得到的实际价格。您仍然需要使用中间媒介WETH等来计算价格。
发布于 2022-04-20 02:46:14
从Bitquery返回的数据似乎是正确的,正如我从https://pancakeswap.finance/info/tokens上检查的那样,它的价格大约为8.60美元。
您的GraphQL查询以某种方式返回一个不同的值。我尝试更改您所做的GraphQL查询,您可以从此链接进行检查。
GraphQL查询如下:
{
ethereum(network: bsc) {
dexTrades(
exchangeAddress: {is: "0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73"}
baseCurrency: {is: "0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82"}
quoteCurrency: {is: "0x55d398326f99059ff775485246999027b3197955"}
) {
baseCurrency {
symbol
}
quoteCurrency {
symbol
}
quotePrice(calculate: any)
}
}
}https://stackoverflow.com/questions/70784272
复制相似问题