Jump to content

xrpcharts api: tps / tps calculation


Recommended Posts

Hey all,

can anybody tell me, how to extract the transactions per second out of the xrpcharts API? Is that value anywhere readable in JSON-Format, or what values (which api requests) do i have to calculate to get the same value as on https://ripple.com/xrp/market-performance/ Website?


Thank you in advance. 

Link to comment
Share on other sites

I doubt it's in the API, on that page they're probably just dividing the number of transactions in each ledger by the latest close interval.  You can get the numbers for this using the ledger subscribe command.  Take the ledger stream responses, subtract the ledger_time from the previous ledger_time (it's in seconds), then divide this by the txn_count.  

Bear in mind the above is just one way to do it (and a guess at what's employed on that page). There is no "definitive" way to calculate TPS, see here for more details.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...