You are viewing a single comment's thread from:

RE: Calculating the USD Vote Value for a Hive account

in HiveDevs2 years ago (edited)

It's actually a very dumb reason hahahahah

image.png

As you can see, base is the price, and the other one, for some reason, is always 1. So in my head, x/1 = x, and I needed x, but didn't want to just leave the other one without using it when it might be important? So I justified it as "ahhh that's probably what you divide it by!". But I now realize that doesn't make much sense hahah.

I don't honestly know what base and quote mean. :) I just know it works, whether by coincidence or intention. Maybe one day it will not be 1 anymore and the script won't work anymore!

Sort:  

Lol that's too convoluted as for my taste XD I'll just leave it as base, let's hope nothing breaks :D

BTW what kind of an app are you building there?! I am interested! Given you can share some details, of course!

just a react frontend for hive :) but very slowly cuz I have work and this is unpaid labor!

I wanna make a static, simple, open source frontend, cuz we don't have one yet on hive

Hey, I think I got it XD If you multiply by base you will get the vote value in USD, and if you multiply by quote you'll get the vote value in HIVE. So:

rshares / recent_claims * reward_balance * base

gives the USD value. However, the one below gives you the HIVE values:

rshares / recent_claims * reward_balance * quote

The quote is always 1.000 so in theory you could just omit that, but who knows if it will or will not change in the future...