Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accurate staking and masternode ROI #2929

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

techy2
Copy link

@techy2 techy2 commented May 14, 2024

accurate CLI function for staking and masternode ROI
getroi
{
"3 hour avg ROI": "23.9%",
"30 min stk ROI": "29.5%",
"network stake": "8,564,072",
"--------------": "--------------",
"masternode ROI": "16.0%",
"tot collateral": "19,150,000",
"enabled nodes": "1915",
"blocks per day": "1401.1"
}

Copy link

@panleone panleone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution, before doing a real review there is one thing that I don't understand in your logic:

arith_uint256 workDiff = csra.pb->nChainWork - csra.pb0->nChainWork;
...
int64_t networkHashPS = (int64_t)(workDiff.getdouble() / timeDiff);

Why are you assuming that nChainWork is a good measure of the number of hashes in the chain?

It should be true in a PoW chain, but It's not clear to me why the same happens in a PoS chain.

Also please rebase the PR on master (so that the first 11 commits are removed)

@techy2
Copy link
Author

techy2 commented Jul 27, 2024

With respect to the chainwork question, when PIVX implemented fixed slots, the amount of work done is discreet to each slot and directly proportional the the hash rate expressed as blocks per day since there is one slot per block. This is easily extracted by formula. I will redo the PR, I have to look at what I submitted to PIVX as I recently made a slight revision and don't remember if that was included in my PIVX submission.

I will redo the PR shortly as you request. have to finish a current project and then update my local PIVX repo.

techy2 added a commit to techupgrades/PIVX that referenced this pull request Jul 30, 2024
@techy2
Copy link
Author

techy2 commented Jul 30, 2024

updated to PR #2933, built against current master branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants