lyes  
                
               
                 
                 
              
                  
                    June 11, 2023, 11:31pm
                   
                   
              1 
               
             
            
              Hello,
I have a serious problem with the data returned with ETH and BSC transfers, the amount number (tokens transfered) is rounded and sometimes not even accurate with big decimals (float) when it should never be rounded for accuracy reasons.
Here is an example with BSC:
  
  
     
  Binance (BNB) detailed transaction info for txhash 0x458f062cdcc2e410c98cb5371f7bc6df94be0d1afb3b87bd38c914412bb5eb0d. The transaction status, block confirmation, gas fee, BNB, and token transfer are shown.
   
  
    
    
  
  
 
Expected transfer value : 
5049.28034264  
Returned by Bitquery : 
5049.2803426400005 
Which is innacurate and probably a floating point problem caused by the programming language ( see website: floating-point-gui [dot] de/basic/ ).
Another example with ETH:
  
  
    
  Ethereum (ETH) detailed transaction info for txhash 0x02cbdf74994c7912aa39cfe1629f22df322e736ca2f0382aca5202f40f444168. The transaction status, block confirmation, gas fee, Ether (ETH), and token transfer are shown.
   
  
    
    
  
  
 
Many transfers amounts are not returned correctly with this one.
Expected: 
19.110343473122736641  swETH 
Returned by bitquery : 
19.11034347312274  swETH
As you can see, it’s rounded.
Here is the graphql query used:
query ($network: EthereumNetwork!, $hash: String!, $limit: Int!, $offset: Int!) {
  ethereum(network: $network) {
    transfers(
      options: {limit: $limit, offset: $offset}
      amount: {gteq: 0}
      txHash: {is: $hash}
    ) {
      sender {
        address
      }
      receiver {
        address
      }
      amount
      currency {
        symbol
        address
        tokenType
        name
      }
      gasValue
      }
    }
  }
}
 
the params:
{
  "limit": 25,
  "offset": 0,
  "network": "ethereum",
  "hash": "0x02cbdf74994c7912aa39cfe1629f22df322e736ca2f0382aca5202f40f444168"
}
 
This is a huge issue and I would appreciate if it can be fixed.
Thanks for your help. 
Regards
             
            
               
               
               
            
            
           
          
            
              
                Divya  
                
               
              
                  
                    June 12, 2023,  7:10am
                   
                   
              2 
               
             
            
              Thanks for raising this issue. I have created a ticket to bring it to the notice of the dev team. Will get back to you with the fix/response.
             
            
               
               
              1 Like 
            
            
           
          
            
              
                Divya  
                
               
              
                  
                    June 14, 2023,  9:41am
                   
                   
              3 
               
             
            
              @lyes  For correct floating point values use the new dataset https://ide.bitquery.io/streaming_transaction-floating-point 
This is recorded as a known issue in the dataset that you are using.
             
            
               
               
              1 Like 
            
            
           
          
            
              
                lyes  
                
               
              
                  
                    June 19, 2023,  1:29am
                   
                   
              4 
               
             
            
              Thank’s for your response.
The new dataset works fine and the data returned is much more accurate.
However I’m facing a new issue:
I can’t find a way to return the transfer amount in USD with this new dataset like I used to do before:
{
  ethereum(network: ethereum) {
    transfers(
      options: {limit: 10}
    ) {
      amount 
      amountInUSD: amount(in: USD)
    }
  }
}
 
Can you help me? is there any documentation online regarding this new dataset that can help?
Thank’s again!
             
            
               
               
               
            
            
           
          
            
              
                Divya  
                
               
              
                  
                    June 19, 2023,  6:14am
                   
                   
              5 
               
             
            
              You can find the documentation here https://docs.bitquery.io/ 
I will check if we can get transfers in USD in the new dataset.
             
            
               
               
              1 Like 
            
            
           
          
            
              
                lyes  
                
               
              
                  
                    June 23, 2023, 12:00am
                   
                   
              6 
               
             
            
              Thanks for the docs, I can’t find anything related to what I’m searching for inside.
I would really appreciate if you can get back to me for a solution to get transfers in USD in the new dataset.