Sorry, it seems like this question gets asked all the time but I’m struggling with it. I’m trying to get the absolute latest trade between two pairs but it’s not working for me. In my test code I’m getting trades between WBNB and BUSD but the timestamp on the latest trade it comes up with is about 14 hours old, and if I set the limit to more than 1 then the next trade is about an hour and a half earlier. On dextools I can see that there’s a trade between these pairs every few seconds but I’m not getting them.
Here’s my code:
{
ethereum(network: bsc) {
dexTrades(
any: [{baseCurrency: {is: “0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c”}, quoteCurrency: {is: “0xe9e7cea3dedca5984780bafc599bd69add087d56”}}]
date: {since: “2023-06-19T22:01:00.000Z”}
options: {desc: [“tradeIndex”, “block.timestamp.time”], limit: 1}
) {
baseCurrency {
symbol
address
}
block {
timestamp {
time(format: “%Y-%m-%d %H:%M:%S”)
}
height
}
tradeIndex
buyAmount: baseAmount
buyAmountInUsd: baseAmount
quoteCurrency {
symbol
address
}
sellAmountInUsd: quoteAmount
quotePrice
}
}
}
Thanks.