HeyStack progress! - 24th February
I've mainly been testing this week. And bug-hunting. So dull! Test in production!
Hive Account Balance Testing
I've mainly been trying to get the account balance roll-up to work as accurately as possible. The account balance roll-up takes all the financial transactions for an account and accumulates them over time. The final rolled-up results for Hive, HBD, and Vests/HP should be equal to the current balances for the account obtained through the API. The idea being that if this test works then the data is good and most of everything else (on the Hive side) will work as well.
It's a two stage process. The first calculation accumulates of all the pre HF23 "Steem" financial transactions for an account to give the Hive airdrop amounts. The second stage accumulates the post HF23 Hive financial transactions, starting with the airdrops.
There's the same test for Steem accounts. Just with the post HF23 Steem and pre HF23 "Steem" financial transactions all aggregated together. And no airdrop.
Since I can only test a limited number of accounts I added a balance check option on the JOURNEY page. This shows a table with the roll up results. So once you've loaded your transactions you'll be able to check how accurate your numbers are. And then let me know when it doesn't work!
Here's some examples:
@hiveio - one that works perfectly.
@tiger-zaps - good
@keychain - perfect again
I tested 15 accounts in total. After correcting some bugs they were all perfect on liquid and dollars, with some small differences on vests.
The difference in vests arises due to the power-up transactions only having one side of the transaction. All Hive no Vests. Like this:
So I have to estimate the amount of vests powered-up. To do this I search the blockchain every millions blocks or so and capture large power down transactions which I then use to generate the ratio of Hive/Vests. And then interpolate for blocks in-between and apply to power ups. I may be able to improve this through better interpolation. But it works fairly well as it is.
One of the things I did this week was to adapt/recreate/rerun this process for Steem, since the Steem/Vests ratio is not the same as the Hive/Vests ratio (post HF23). Because nothing is ever easy!
Steem Account Balance Testing
I ran the same tests for accounts loaded directly from Steem (i.e. data loading through the Steem API). It doesn't work as well because the account history transaction number ids jump around occasionally. It doesn't seem to be a problem for any of the Steem balances on the Hive accounts I tested above - which have post HF23 Steem data loaded through the Steem API.
I'll work on it in any case.
A few bugs ironed out - none of which are particularly interesting:
- Airdrop transactions were being overwritten if more than one account loaded.
- Hive / Steem account pairs weren't always matching up so transactions were going into the wrong storage.
- Duplicate transactions were arising and being discarded on trades. This happens because a fill_order virtual transaction needs both a transaction number and virtual transaction number for unique identification.
The aim is to get something preliminary out in the next couple of weeks. This will require work on:
- Tying it all together. Currently everything works well individually but it's not fully integrated. For example if you load new trades or include a new blockchain wallet it doesn't recalculate the portfolio until you relaunch. I've started this and I'll aim to finish it this week.
- Refactoring and tidying. Lots of this!
- Testing. Mainly done. The Steem side needs some work still but I think I know how to fix this.
Some areas will then be done in a future release:
- Income / gains. Harder than it looks!
- Chart improvements.
- Trade analyses.
Support my projects!
That's it for today! My project is free and open-source (FOSS). It will be on github (once I've tidied it because embarrassing). If you like my project upvote to support it!
What is HeyStack?
For those who haven't seen one of these posts before, HeyStack is a Hive-orientated crypto portfolio tracker project. It was my entry to the STEMGeeks Hackathon that took place back in the spring. I am still working on it! Still!
Posted Using LeoFinance Beta