Hi, I would like to get an example of a query where we provide the transaction hash and get back the trade amount in USD (at the time of transaction) somewhat like the bscscan.com shows. Eg: if 0.75 bnb was used query should get price of 0.75bnb during the transaction time
Use Transfer APIs for this.
For example check following example
{
ethereum(network: bsc) {
transfers(amount: {gt: 0}, txHash: {is: "0xebc8d212b4c861e13b30b344ef7c7068b0e1ee2a1b5d0090fc7ea1dc8e577be4"}) {
sender {
address
annotation
}
receiver {
address
annotation
}
amount
amountInUSD: amount(in: USD)
currency {
symbol
address
}
external
}
}
}
1 Like
Check this query to get USD price of token