SmartContract Burn and Mint events

Hi!

I want to get add/remove amount from pools. So im running this query but there is a problem with Value number: it returns without any separator - 1.899463739435306552 turns into 1899463739435306552 and 0.095332671688856338 into 95332671688856338 and so on. Example from contract address: 0x0faff2264fcc6b1c9e8b245e37d11eef951fa958 and block height: 9643812 (Binance Transaction Hash (Txhash) Details | BscScan)

I did this query with different contract addresses and checked info with bscscan thats why im sure that i get wrong numbers. Can you help me? Also is there any chances to get this value in USD?

query

query MyQuery {
ethereum(network: bsc) {
smartContractEvents(
smartContractEvent: {is: “Burn”}
date: {is: “2021-08-01”}
) {
block {
height
}
arguments {
value
argument
}
smartContract {
address {
address
}
}
}
}
}

part of the response

{
“ethereum”: {
“smartContractEvents”: [
{
“block”: {
“height”: 9643812
},
“arguments”: [
{
“value”: “0x05ff2b0db69458a0750badebc4f9e13add608c7f”,
“argument”: “sender”
},
{
“value”: “1899463739435306552”,
“argument”: “amount0”
},
{
“value”: “95332671688856338”,
“argument”: “amount1”
},
{
“value”: “0x4c19ef8a2c72e71fffe8d182878294030bd3b441”,
“argument”: “to”
}
],
“smartContract”: {
“address”: {
“address”: “0x0faff2264fcc6b1c9e8b245e37d11eef951fa958”
}
}
}

Hi @procrustes I checked through the query and it seems that the values returned by the GraphQL IDE are the same that you observe on Binance Transaction Hash (Txhash) Details | BscScan. It is just that the values returned in the Binance Transaction Hash (TxHash) Details | BscScan are e-18 times the value returned by Bitquery GraphQL API.

So what i need to do? I see only one solution with two queries: 1 - get all day data with Burn events, 2 - make a list with all contract addresses and put it into second query to get decimals for every token.

Is there a simpler option?

I think yes… you need a decimal amount. However, I think most of them use 18 decimal points.

1 Like