You are viewing a single comment's thread from:

RE: Calculating the USD Vote Value for a Hive account

in HiveDevs2 years ago (edited)

Hmm, your code seems to give some correct information maybe? It's not the same as the one PeakD and Hive.Blog give tho.

I just voted and it was 0.16, and I just requested the info from your code and the console log result was 0.1979

Vote value: 0.1979061971029384

I also had to modify from console.info to console.log

Anyway, I'm unsure why this inaccuracy happens! PeakD's estimate on my vote size is 0.157 | 0.16

image.png

image.png

Sort:  

I think this discrepancy comes from two things:

  1. Please note that my code by default calculates the Vote Value as if you had 100% Voting Power.

    If you want to check your CURRENT vote value, with the Voting Power that you have at the moment, use getUserVoteValue({ username: 'cryptosharon', fullVotingPower: false }).

  2. As far as I understand, most of the services do not follow the formula from the documentation. The formula clearly specifies to provide the base price from the condenser_api.get_current_median_history_price call:

    Last thing we will need is rate of the get_current_median_history_price, returns median price rate bucket with base element.

    If you check the response from that API call, it is currently base: "0.894 HBD". That's what I use to calculate, but I find that if I provide 1.0 as the base value, and not that value, the estimated values will be much closer to the ones given by services such as PeakD or hivestats.io. I don't know why that is, though, that those services do it differently than it is in the documentation.

Loading...