user10559: I'd like to calculate the total amount of bitcoin sent to anyone from a known wallet address.
My initial idea was to page through everything returned by the listtransactions RPC, get the transaction details through gettransaction and calculate the sum of all transaction details of category "send". But somehow the result appears to be by far too high.

user85: The result you are getting is correct. The error is that you think it's too high when it's correct.
Say I buy a book for $5, but I pay with a $100 bill. The amount "sent to anyone" from my wallet is $100, not $5. So the total of the amounts sent will be greater than the net amounts paid.
The total of the amounts "sent to anyone from a known wallet address" will include the change that was sent from the wallet even though it remained the property of the owner of the wallet.
If you want to get a different answer, you'll have to ask a different question.

10559: <p>I'd like to calculate the total amount of bitcoin sent to anyone from a known wallet address.</p>
<p>My initial idea was to page through everything returned by the <code>listtransactions</code> RPC, get the transaction details through <code>gettransaction</code> and calculate the sum of all transaction details of category &quot;send&quot;. But somehow the result appears to be by far too high.</p>
 85: <p>The result you are getting is correct. The error is that you think it's too high when it's correct.</p>
<p>Say I buy a book for $5, but I pay with a $100 bill. The amount &quot;sent to anyone&quot; from my wallet is $100, not $5. So the total of the amounts <em>sent</em> will be greater than the <em>net</em> amounts paid.</p>
<p>The total of the amounts &quot;sent to anyone from a known wallet address&quot; will include the change that was sent from the wallet even though it remained the property of the owner of the wallet.</p>
<p>If you want to get a different answer, you'll have to ask a different question.</p>
