Hi there,
Let’s say I’ve run the following query to get a quote (in WBNB) for a token;
{
ethereum(network: bsc) {
dexTrades(
options: {desc: ["block.height", "tradeIndex"], limit: 1}
exchangeName: {in: ["Pancake v2"]}
baseCurrency: {is: "0x2eba09fb8063aedba27424de9bf0dcb41567a943"}
quoteCurrency: {is: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"}
height: {is: 9942312}
) {
transaction {
hash
}
tradeIndex
smartContract {
address {
address
}
contractType
currency {
name
}
}
tradeIndex
block {
timestamp {
time(format: "%Y-%m-%d %H:%M:%S")
unixtime
}
height
}
baseCurrency {
symbol
address
}
quoteCurrency {
symbol
address
}
quotePrice
}
}
}
The quote result is "quotePrice": 4.726269578406308e-16
How would I go about formatting this response to display properly when charting?
eg.
Bonus question: How can I convert that result into a BigNumber to work with in web3 or ethers given it would throw an underflow error?
Many thanks