Script to create a CSV file with all financial transactions (i.e. for tax purposes)

in HiveDevs3 months ago

My accountant asked me for a list of transactions on Hive. I searched a bit, but didn't find anything that could help with that, so I wrote a script to create a CSV file.

https://github.com/pharesim/hive_tx_to_csv/


data aggregation

Thanks to @mahdiyari's HAFSQL it's possible to convert VESTS to HP using the ratio at the time, which was the biggest issue in this project. It's all simple and straight forward, all you need is python with beem and pandas.

Download the file, edit the parameters on top with the account you want to get the data for and the start and end date. Be aware that it can take a long time to run, as it has to iterate through all transactions in the specified timeframe. The preset is hbdstabilizer with about 1700 transactions in one day, which takes a little over 2 minutes on my system. Getting a year's worth of data for my own account took about 4 hours. If you're not a witness it'll probably be a lot quicker.

First I thought about creating a paid service, but free is better ;) Please open a ticket or comment here if you encounter any issues.

Enjoy, and if you consider my work useful please drop me a witness vote!

Sort:  

Thank you very much. It works great.

Fantastic! There is an option on the wavio UI that lets you download a bunch of transactions as well but it requires some editing to work with something like... Koinly or whatever that tax service is.

Very interesting, thanks for sharing. I didn't check out Koinly yet, but will soon probably. I assume that platform works better with all individual transactions like waivio outputs it. My script aggregates the data into fewer rows so my accountant doesn't get a heart attack. Unfortunately it's missing the producer rewards there, which are of course very important for me.

Good to have different tools available to fit different needs!
To save those interested some googling work, here's a link:
https://www.waivio.com/@hbdstabilizer/transfers/table

Thanks for adding the link! I meant to but it's difficult with a 4 week old napping on me 😂

This seems incredibly useful, thanks a ton for sharing! !BEER

we should consider to go temporarily to tax crypto heavens like Vanuatu or El salvador

Niceee i would like do the same in javascript

Oh, it's a very useful tool! Need it, I added in the bookmarks.

Congratulations @pharesim! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

<table><tr><td><img src="https://images.hive.blog/60x70/https://hivebuzz.me/@pharesim/replies.png?202408230304" /><td>You got more than 7000 replies.<br />Your next target is to reach 7250 replies. <p dir="auto"><sub><em>You can view your badges on <a href="https://hivebuzz.me/@pharesim" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">your board and compare yourself to others in the <a href="https://hivebuzz.me/ranking" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Ranking<br /> <sub><em>If you no longer want to receive notifications, reply to this comment with the word <code>STOP

I have not tried to do any work on calculating my earnings in hive, because, in actual, unless I convert them and take to my bank account, it's not earned, isn't that right ?

Depends on where you live, but most countries tax crypos same as stocks or other assets by now.

Ya, even my country does impose a 30% tax, but unless you convert to fiat, its not our earnings, isn't it ?

Usually it doesn't matter what you earn, as long as it has a value it's taxable. Even if you're paid in potatoes.
In practice it's not possible for them to find out as long as you didn't cash out at least once (and created a connection to your identity), but once they know they'll want their share, and might even fine you for not reporting in time.

Best advice I can give you is to ask a local accountant/tax advisor. There are some exceptions to what I said, Portugal for example only taxes crypto when you cash out - but all other (western) European countries I know about do tax it the moment it hits your wallet.

Great thank you. Will test it after my vacation. Good that people invest their time and effort to help the community.

Nice one. People seem to be responding to this really well. I'm jelly compared to how hard it is to get eyes and project supporting upvotes on the things I am building and posting updates about. :P

Are you going to publish this on public facing tools site anywhere? My public free hive tools server is just a little vps with some php apps on it and my big server for hivestreams.live is very purpose built for laravel, react and node, and is all tied up in being the rtmp streaming server so its not good for a tools site loading up the ram with big chain pulls either.

But this seems like something you could slap keychain on, ask for a username and spit out pretty PDFs for people without too much effort, and I am sure the community would love it if you did. Github, python and beem and APIs and RPCs and web services, are sort of an advanced class for the typical account holder around here after all, I bet the crowd would love an easy button for this.

Granted it, as you said, is load heavy, but it seems feasible to productize it. People who have big money tax concerns would probably pay a few hive for a pretty printing report too. maybe paywall it to cover the ram and cpu.

Just up from a day sleep after coding on my own projects for like 24 hours straight to solve and rush features out, and drinking coffee and spitballing here about ideas for this very useful tool you made.

Nice one. People seem to be responding to this really well. I'm jelly compared to how hard it is to get eyes and project supporting upvotes on the things I am building and posting updates about. :P

I'm a little surprised too, but even more that nobody did it before. How's everyone been keeping their books?

Your suggestion with the webinterface and pay to download was what I meant saying I thought about a paid service. But for now I got a long enough backlog with some missing wiki functions, and hiveinvite really needs a complete overhaul.
Selling stuff also comes with further complications like VAT and possible liabilities. Maybe at a later stage, if the community starts growing again at some point it might be worth it.
I wouldn't mind someone else sets that up in the meantime though.

I don't know python well and I am starting to immerse in my own pile of to-dos and user requests for what I am building already but I should know python, I started making money in the industy with Perl in 1990 or so, and did PHP for a couple decades now, and a couple other stacks I am at least basically literate in enough to get an app up, but never picked up Python for some reason. Probably because coming from PHP it didn't really offer me much more that I needed. I am not a data scientist and that's where python seems really strong, industry wise.

But I hear you on selling stuff. I have no idea how I am going to "sell" anything for HiveStreams.Live, or how I will fund it's operations. I am taking the "Uber" approach. Build a thing, figure out how to make money with it later, maybe, hopefully, somehow. Cause SirCork gets soo hungry when he's broke. :)

I'm coming from PHP too, imo it's harder to learn a new framework there than getting familiar with Python. At least for the basics. I would still opt for PHP for a bigger CRUD app, but for smaller projects not centered around an SQL database I really cherish the simplicity of Python.

As the script may need to run for hours it wouldn't be a problem to serve a frontend with another language and just call the script. Or migrate it, it's only a little more than 100 lines. I didn't intend to push you into doing it though :D

Oh I hear you, I didn't feel pushed, heck I was even a little shy to ask! If I can get some other priorities under control, I might look into hosting this though, with full credit back to you of course for it's existence. But don't hold your breath. There's whole lot of "luggage" to carry for me to "get other priorities under control" but I KNOW you get that, being 10X or more deeper into this place's code and app building than I've even begun to get to.

Thank you for your witness vote!
Have a !BEER on me!
To Opt-Out of my witness beer program just comment STOP below

Thank you for your witness vote!
Have a !BEER on me!
To Opt-Out of my witness beer program just comment STOP below

Thank you for your witness vote!
Have a !BEER on me!
To Opt-Out of my witness beer program just comment STOP below

Thank you for your witness vote!
Have a !BEER on me!
To Opt-Out of my witness beer program just comment STOP below

Thank you for your witness vote!
Have a !BEER on me!
To Opt-Out of my witness beer program just comment STOP below

Congratulations @pharesim! You received a personal badge!

HiveFest 9 Attendee

You can view your badges on your board and compare yourself to others in the Ranking