Nitrous Update: Vote Estimates, Voting Breakdowns, Tag Limit
Voting estimate and voting breakdowns have now been pushed out. Given that many tokens have settings different than linear, having the ability to estimate the vote value becomes very important because it is additionally dependent on the post that is being voted, rather than being a function of just your stake and voting power.
The high level of the changes as follows:
- Compute vote value estimate on the slider (Slider is enabled for everyone).
- Pending payouts are updated on load rather than just whenever the last vote was applied.
- When clicking on the list of voters, it tells you how much each vote contributed to the vote value of the post.
- (Bonus, thanks to @ayogom) Tag limit bumped to 10, from 5. Now applied to this post. However, tag edits may do not seem to work reliably, so beware. Just try it on new ones.
Some screenshots I snagged on mobile. The first is the upvote estimator.
Here's the downvote estimator:
And finally the vote breakdown:
Details that not many care about
In order to compute the vote estimate, I read the current data for the token's pending rshares (sum of pending reward curve post rshares) and author curve exponent.
Fetching this data required wiring up the call so that the fetch happens at the stage where the state is being fetched. Eventually this should probably be bundled together so it can happen in a single call to the Scot API, and these kinds of optimizations may need to happen to scale properly.
The formula for how much a vote with size
rshares will give is given by
R(post_rshares + rshares) - R(post_rshares)
R(r) = r^(reward_exponent) * (reward_pool / pending_rshares)
Pending post rewards is also computed on the fly now with
In order to compute the voter breakdown, I processed the votes in vote order and applied the formula above. Keep a running total of
rshares for all voters processed so far, and compute
R(rshares_so_far + current_vote_rshares) - R(rshares_so_far)
This works for both upvotes and downvotes.
There was a previous issue where every post had been marked with "edited" for some strange reason. That has been fixed but may still behave weirdly in some cases. There are still some things that are not ideal in how fetches are made, and that will be an ongoing improvement.
Anyway that's about it. Let me know if you notice anything weird with the computations or any slowness. Cheers!