Error: Quote Prices for Tokens on BSC

Hey everyone,
I am running the following query to get the prices (median, high, low etc.) for a token on a single day against its trading pair. In the example below the base currency is Safemoon and the trading pair is WBNB.
The stats for the median and mean quote prices seem fine, but the low price can simply not be true. There is definitely an error. I cross checked the Safemoon price for today (2021-08-18) on poocoin app and coinmarket cap.
It has definitely never hit 7.083684002582547e-14 BNB.

The query:

query ($baseAddress: String, $quoteAddress: String, $from: ISO8601DateTime!, $to: ISO8601DateTime!, $interval: Int!) {
ethereum(network: bsc) {
dexTrades(
baseCurrency: {is: $baseAddress}
quoteCurrency: {is: $quoteAddress}
date: {between: [$from, $to]}
priceAsymmetry: {lt: 10.1}
options: {desc: “timeInterval.day”}
exchangeName: {in: [“Pancake”, “Pancake v2”]}
) {
timeInterval {
day(count: $interval)
}
baseCurrency: baseCurrency {
symbol
address
tokenId
}
baseAmount: baseAmount
quoteCurrency: quoteCurrency {
symbol
address
}
volumeQuoteCurrency: quoteAmount
trades: count
high: quotePrice(calculate: maximum)
low: quotePrice(calculate: minimum)
median: quotePrice(calculate: median)
mean: quotePrice(calculate: average)
open: minimum(of: block, get: quote_price)
close: maximum(of: block, get: quote_price)
}
}
}

with params:
{
“from”: “2021-03-01”,
“to”: “2021-08-18”,
“interval”: 1,
“baseAddress”: “0x8076c74c5e3f5852037f31ff0093eeb8c8add8d3”,
“quoteAddress”: “0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c”
}

I also played around and added an additional filter using only the main LP Pools of Safemoon on pancake swap but still getting the same unreasonable figures.

What am I doing wrong? Any suggestions?

Best regards,
Pete

Ok, I think I just solved it. Not sure if this is the correct way to go, but if you add a filter regarding the tradeAmount in USD and set this above a reasonable threshold (say 100 USD) then this unreasonable low price quote vanishes. So, I presume these wrong numbers come from some minor & sketchy Liquidity Pools that somebody just opened.

1 Like

Possibly that can be the case.