krp
krp

Reputation: 11

Using BigQuery XRP transactions table to query XRP balance of an account at specific block number

I would like to get the top N addresses + balances on the XRP Network at a specific point in time (will usually be some time in the last 24 hrs). N can be quite large (50,000).

The approach can be reduced down to reliably finding the XRP balance of an account at a specific block number. I figure most APIs would rate limit quite hard if you tried to make ~50,000 Point-in-time balance queries.

I found a Google BigQuery table of all XRP transactions ever that can help with this, but I wanted to sanity check that my understanding of Ripple dynamics is correct.

Is the correct approach to

  1. Filter transactions before this block number
  2. Add up all "Payment" successful transactions that were sent to this account
  3. Subtract all "Payment" successful transactions that were sent from this account
  4. Subtract all transaction fees by transactions initiated by this account

Is there another way in which an account's XRP Balance can be altered?

I have tried reading the XRP documentation, but would like an expert to check my understanding, because it's important that this approach be fully 100% accurate.

Thank you in advance!

Sidenote: I would also be interested in any API recs for querying top N XRP addresses (in 'real-time' with negligible staleness is okay too)

Upvotes: 1

Views: 142

Answers (0)

Related Questions