# 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)

Regards,

Khaled

• This question makes no real sense - acceleration and velocity have no meaning when talking about Bitcoin. What are you trying to achieve? Dec 17, 2019 at 6:51
• I'm trying to extract features from bitcoin dataset, I have linked between the addresses, transactions, and users with their relative values and times. I.ve aggregated the total of transaction value belong to a single user and extracted total amount, average in_amount, average out_amount, max and min, and in_degree and out_degree. So, now I want to calculate the acceleration and velocity of bitcoins flow to a user. I found this solution but I am not sure: Transaction velocity can be calculated by dividing the number of bitcoin transaction volume by the number of bitcoin in circulating. Tq Dec 17, 2019 at 7:11

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:

``````>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.

• I appreciate your help. Actually I have the timestamp of each transaction, and I already grouped all transactions by week. May I know what do you mean by takes two consecutive velocities and is it possible to divide all weely grouped transactions by week means by 7 Thank you so much Dec 17, 2019 at 13:03
• It depends on what units you want to use. If you have your velocities in [BTC/week] you can have your acceleration in [BTC/week^2] and for that you just need to subtract one velocity by the preceding velocity to get the acceleration, buf if you want your acceleration in [BTC/day^2] you should divide the velocity difference in [BTC/day] per 7 days. It's more like a physics question than a bitcoin one. Dec 17, 2019 at 13:17