Wrong data of a address balance

There is a inaccurate data of a btc address balance:

query MyQuery {
  bitcoin {
    addressStats(address: {in: ["3NLi7b5o1nuNT3igSXPWhD6UrEYqopAooy"]}) {
      address {
        address
        balance
      }
    }
  }
}

got

{
  "bitcoin": {
    "addressStats": [
      {
        "address": {
          "address": "3NLi7b5o1nuNT3igSXPWhD6UrEYqopAooy",
          "balance": -57.33549519999997
        }
      }
    ]
  }
}

Hi @mars.liu . The accuracy of the balances for a UTXO account can sometimes be unreliable when using the addressStats API. Instead, a more dependable approach involves utilizing the bitcoin input and output API to calculate the balance of a BTC address by subtracting the bitcoin output value from the bitcoin input value.
Reference to the below example query for the same.

Output → value - Input → value = Balance

1 Like