How to calculate the Average velocity and the Average acceleration of Bitcoin transactions I am working on a Bitcoin project and I would like to extract the following features

1- Average velocity: represents the speed with which bitcoins flow to a user

2- Average acceleration: represents the acceleration of bitcoin flow to a user

I have the following attributes:


user ID ( represents the user)
the total number of transaction (e.g 100 transactions)
the total value of Bitcoin transferred (e.g 10000 BTC)
the date of each transaction (represents the date of each
transaction)


Can you please help me how to calculate the velocity and acceleration?

Thank you for any help you can provide

Regards, 

Khaled
You can calculate an average velocity/flow of bitcoin to an address/user by summing all bitcoin received that address/user in a given time period and dividing it by the time period. I think your issue is that you don't have the time each transaction was made. The easiest way to get a rough time (+/- 2 hours) a transaction was made is to look at the timestamp field in the header of the block that transaction was included. So, for example, with if you have the transaction 58513acbb340fd24d2b27d8680961196f0363b79f90ee34a974d6593bf64559b, you can get the time of this transaction in bitcoin core by running this command:

&gt;bitcoin-cli getrawtransaction 58513acbb340fd24d2b27d8680961196f0363b79f90ee34a974d6593bf64559b true | jq ".blocktime"
1576581288


This timestamp is the UNIX epoch timestamp that the miner chose for the block. Bear in mind that miners can choose a timestamp that is off by about up to 2 hours and the block would still be valid, so don't take this the last two/three digits of this timestamp very seriously - this value is mainly used to calculate difficulty adjustments in bitcoin which occurs only about every two weeks. Another way to assign a time to a transaction would be to know when that transaction entered the mempool but that information can be extremely hard or impossible to get a posteriori and can have less practical meaning than the block timestamp.

With an approximate instant when each transaction was made, you can group all transactions done in a day or week, for example, and divide the total bitcoin amount by the time period. To calculate the acceleration takes two consecutive velocities and divide them by the time period again.

Be careful not to confuse the velocity of money, which is an economic concept, with the velocity that you are trying to calculate which is specific to your data set.