create account

Novel Voting Mechanism - SPK Network Team Meeting by spknetwork

View this thread on: hive.blogpeakd.comecency.com
· @spknetwork ·
$45.40
Novel Voting Mechanism - SPK Network Team Meeting
<center>

[![](https://ipfs-3speak.b-cdn.net/ipfs/bafybeicqfe7aqknbznfpgwye4b5zpmfoisleum46ga7p7hbsvqxlmc53lq/)](https://3speak.tv/watch?v=spknetwork/pzblscua)

▶️ [Watch on 3Speak](https://3speak.tv/watch?v=spknetwork/pzblscua)

</center>

---

<center>

![coinvotingc.png](https://files.peakd.com/file/peakd-hive/spknetwork/23tvcDoYEhV5T1hvznG7UmLJcv4GZ1qCBRdSPmn6xpvvkCXvufcLCSLAHXbE5pgQVAZJH.png)

</center>


---

<div class="text-justify">


We're buttoning up the next iteration of the SPK Network. Before we get there, we're discussing our new voting mechanism and hoping to get your feedback. This meeting is approaching an hour long, and below is all the code referenced directly in the video... with some additional //comments.

```
exports.spk_vote = (json, from, active, pc) => { //the contract json:payload, from:@hiveaccount, active: active key used, pc:promise chain(for contract ordering)
  var ops = [] //holds raw memory instructions
  if (active) { //ensures active key
// memory reads
    var powp = getPathNum(["spow", from]), // @from's powered spk
      tpowp = getPathNum(["spow", "t"]), // the total powered spk
      dpowp = getPathObj(["spowd", from]), // @from's downpower operations pointer
      votebp = getPathObj(['spkVote', from]), // @from's last vote information
      pstats = getPathNum(['stats']) // current network parameters
  Promise.all([powp, tpowp, dpowp, votebp, pstats]).then((mem) => {
    var stats = mem[4]
    const DAOString = mem[3].substring(mem[3].indexOf(",")),
      lastVote = Base64.toNumber(mem[3].split(",")[0])
        ? Base64.toNumber(mem[3].split(",")[0])
        : json.block_num - parseInt(stats.spk_cycle_length),
      thisVote =
        Base64.fromNumber(json.block_num) + "," + (DAOString ? DAOString : ""), //decoding terse memory
      ago = json.block_num - lastVote
      total = mem[1],
      power = mem[0]
      downs = Object.keys(mem[2])
      var effective_power = power, effective_total, aValidator = false
      if(stats.validators?.[from]){ //determine if @from is a validator
        aValidator = true
        var powerVoted = 0
        for (block of stats.power_voted){
          powerVoted += stats.power_voted[block]
        }
        power = (total - powerVoted)/20 //or number of validators
      }
      if (!power){
        ops.push({
          type: "put",
          path: ["feed", `${json.block_num}:${json.transaction_id}`],
          data: `@${from}| Attempted SPK vote with no voting power`,
        });
        store.batch(ops, pc);
      } else if(downs.length && !aValidator){
        getPathObj(['chrono', downs[0]]).then(down =>{ // additional step to recover downpower information from pointer
          finish(down)
        })
      } else {
        finish()
      }
      function finish(down_obj) {
        if(down_obj?.amount){
          effective_power = power - down_obj.amount
        }
        if (ago < parseFloat(stats.spk_cycle_length))effective_power = parseInt(effective_power * (ago / stats.spk_cycle_length))
        else if (ago > parseFloat(stats.spk_cycle_length) && ago < stats.spk_cycle_length * 2)effective_power = effective_power* parseInt(
          effective_power *
            (1 - ((ago - stats.spk_cycle_length) / stats.spk_cycle_length) / 2)
        )
        else if (ago >= stats.spk_cycle_length * 2)effective_power = parseInt(effective_power/2)
        effective_total = effective_total - effective_power
        const voteWeight = parseFloat(effective_power/effective_total).toFixed(8)
        const decayWeight = parseFloat(
          (effective_total - effective_power) / effective_total
        ).toFixed(8);
        //verify inputs, adjust constants
        if(json.spk_cycle_length < 28800)json.spk_cycle_length = 28800
        if(json.spk_cycle_length > 3000000)json.spk_cycle_length = 3000000
        if(json.dex_fee < 0)json.dex_fee = 0
        if(json.dex_fee > 0.1)json.dex_fee = "0.1"
        if(json.dex_max < 0)json.dex_max = 0
        if(json.dex_max > 100)json.dex_max = 100
        if(json.dex_slope < 0)json.dex_slope = 0
        if(json.dex_slope > 100)json.dex_slope = 100
        if(json.spk_rate_lpow < 0)json.spk_rate_lpow = 0
        if(json.spk_rate_lpow > stats.spk_rate_ldel)json.spk_rate_lpow = stats.spk_rate_ldel
        if(json.spk_rate_ldel > stats.spk_rate_lgov)json.spk_rate_lpow = stats.spk_rate_lgov
        if(json.spk_rate_ldel < stats.spk_rate_lpow)json.spk_rate_ldel = stats.spk_rate_lpow
        if(json.spk_rate_lgov > 0.1)json.spk_rate_lgov = "0.1"
        if(json.spk_rate_lgov < stats.spk_rate_ldel)json.spk_rate_lpow = stats.spk_rate_ldel
        if(json.max_coll_members > 100)json.max_coll_members = 100
        if(json.max_coll_members < 15)json.max_coll_members = 15
        json.max_coll_members = parseInt(json.max_coll_members)
        //stats.item = (json.vote * voteWeight) + (decayWeight * stats.item)
        stats.spk_cycle_length = (json.spk_cycle_length * voteWeight) + (decayWeight * parseFloat(stats.spk_cycle_length)) > 28800 ? parseFloat((json.spk_cycle_length * voteWeight) + (decayWeight * stats.spk_cycle_length).toFixed(6)) : 28800
        stats.dex_fee = parseFloat((json.dex_fee * voteWeight) + (decayWeight * parseFloat(stats.dex_fee))).toFixed(6)
        stats.dex_max = parseFloat((json.dex_max * voteWeight) + (decayWeight * parseFloat(stats.dex_max))).toFixed(2)
        stats.dex_slope = parseFloat((json.dex_slope * voteWeight) + (decayWeight * parseFloat(stats.dex_slope))).toFixed(2)
        stats.spk_rate_ldel = parseFloat((json.spk_rate_ldel * voteWeight) + (decayWeight * parseFloat(stats.spk_rate_ldel))).toFixed(6)
        stats.spk_rate_lgov = parseFloat((json.spk_rate_lgov * voteWeight) + (decayWeight * parseFloat(stats.spk_rate_lgov))).toFixed(6)
        stats.spk_rate_lpow = parseFloat((json.spk_rate_lpow * voteWeight) + (decayWeight * parseFloat(stats.spk_rate_lpow))).toFixed(6)
        stats.max_coll_members = (json.max_coll_members * voteWeight) + (decayWeight * parseFloat(stats.max_coll_members)) < 25 ? 25 : ((json.max_coll_members * voteWeight) + (decayWeight * stats.max_coll_members) > 79 ? 79 : parseFloat((json.max_coll_members * voteWeight) + (decayWeight * stats.max_coll_members)).toFixed(6))
        //useful-votes-calc
        if(!aValidator)stats.power_voted[stats.lastIBlock] = effective_power + (typeof stats.power_voted[stats.lastIBlock] == "number" ? stats.power_voted[stats.lastIBlock] : 0)
        ops.push({
          type: "put",
          path: ["stats"],
          data: stats,
        });
        ops.push({
          type: "put",
          path: ["spkVote", from],
          data: thisVote,
        });
        ops.push({
          type: "put",
          path: ["feed", `${json.block_num}:${json.transaction_id}`],
          data: `@${from}| Has updated their votes.`,
        });
        store.batch(ops, pc);
      }
  });
  } else {
    ops.push({
      type: "put",
      path: ["feed", `${json.block_num}:${json.transaction_id}`],
      data: `@${from}| Attempted SPK vote with posting key`,
    });
    store.batch(ops, pc);
  }
}

```

---

Thank you for participating in our development process and participating in these early stages.

---

#### Vote for our Witness:

- https://vote.hive.uno/@threespeak

- https://vote.hive.uno/@diregardfiat

</div>

---

<center>

![image.png](https://files.peakd.com/file/peakd-hive/spknetwork/23tkpCz5fuuTPRBFcbQz9ihncoGt7qVFEhxiWB6AYesGjBzkPfaZcDNxerj4vbq575nZe.png)

</center>

---

<div class="text-justify">

#### About the SPK Network:

>The SPK Network is a decentralized Web 3.0 protocol that rewards value creators and infrastructure providers appropriately and autonomously by distributing reward tokens so that every user, creator, and platform, will be able to earn rewards on a level playing field.

- Check out the SPK Network Light Paper: https://peakd.com/hive/@spknetwork/spk-network-light-paper

- Our Website: https://spk.network/

- Telegram Group: https://t.me/spknetwork

- Discord Server: https://discord.gg/JbhQ7dREsP

- SPK Network Linktree: https://linktr.ee/spknetwork

</div>

---

▶️ [3Speak](https://3speak.tv/watch?v=spknetwork/pzblscua)
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 225 others
👎  , ,
properties (23)
authorspknetwork
permlinkpzblscua
categoryhive-112019
json_metadata"{"tags":["spknetwork","video","spk","voting","blockchain","leofinance","ctp","web3","dpos"],"app":"3speak/0.3.0","type":"3speak/video","image":["https://ipfs-3speak.b-cdn.net/ipfs/bafybeicqfe7aqknbznfpgwye4b5zpmfoisleum46ga7p7hbsvqxlmc53lq"],"video":{"info":{"platform":"3speak","title":"Novel Voting Mechanism - SPK Network Team Meeting","author":"spknetwork","permlink":"pzblscua","duration":2937.366667,"filesize":179867829,"file":"dlHLZHfWorPERCNNSpyCSbWMljFKBxXxIPKdufUxbMoaocWbduUBJMIcnoRshKcs.mp4","lang":"en","firstUpload":false,"ipfs":null,"ipfsThumbnail":null,"sourceMap":[{"type":"thumbnail","url":"ipfs://bafybeicqfe7aqknbznfpgwye4b5zpmfoisleum46ga7p7hbsvqxlmc53lq"}]},"content":{"description":"<center>\r\n\r\n![coinvotingc.png](https://files.peakd.com/file/peakd-hive/spknetwork/23tvcDoYEhV5T1hvznG7UmLJcv4GZ1qCBRdSPmn6xpvvkCXvufcLCSLAHXbE5pgQVAZJH.png)\r\n\r\n</center>\r\n\r\n\r\n---\r\n\r\n<div class=\"text-justify\">\r\n\r\n\r\nWe're buttoning up the next iteration of the SPK Network. Before we get there, we're discussing our new voting mechanism and hoping to get your feedback. This meeting is approaching an hour long, and below is all the code referenced directly in the video... with some additional //comments.\r\n\r\n```\r\nexports.spk_vote = (json, from, active, pc) => { //the contract json:payload, from:@hiveaccount, active: active key used, pc:promise chain(for contract ordering)\r\n var ops = [] //holds raw memory instructions\r\n if (active) { //ensures active key\r\n// memory reads\r\n var powp = getPathNum([\"spow\", from]), // @from's powered spk\r\n tpowp = getPathNum([\"spow\", \"t\"]), // the total powered spk\r\n dpowp = getPathObj([\"spowd\", from]), // @from's downpower operations pointer\r\n votebp = getPathObj(['spkVote', from]), // @from's last vote information\r\n pstats = getPathNum(['stats']) // current network parameters\r\n Promise.all([powp, tpowp, dpowp, votebp, pstats]).then((mem) => {\r\n var stats = mem[4]\r\n const DAOString = mem[3].substring(mem[3].indexOf(\",\")),\r\n lastVote = Base64.toNumber(mem[3].split(\",\")[0])\r\n ? Base64.toNumber(mem[3].split(\",\")[0])\r\n : json.block_num - parseInt(stats.spk_cycle_length),\r\n thisVote =\r\n Base64.fromNumber(json.block_num) + \",\" + (DAOString ? DAOString : \"\"), //decoding terse memory\r\n ago = json.block_num - lastVote\r\n total = mem[1],\r\n power = mem[0]\r\n downs = Object.keys(mem[2])\r\n var effective_power = power, effective_total, aValidator = false\r\n if(stats.validators?.[from]){ //determine if @from is a validator\r\n aValidator = true\r\n var powerVoted = 0\r\n for (block of stats.power_voted){\r\n powerVoted += stats.power_voted[block]\r\n }\r\n power = (total - powerVoted)/20 //or number of validators\r\n }\r\n if (!power){\r\n ops.push({\r\n type: \"put\",\r\n path: [\"feed\", `${json.block_num}:${json.transaction_id}`],\r\n data: `@${from}| Attempted SPK vote with no voting power`,\r\n });\r\n store.batch(ops, pc);\r\n } else if(downs.length && !aValidator){\r\n getPathObj(['chrono', downs[0]]).then(down =>{ // additional step to recover downpower information from pointer\r\n finish(down)\r\n })\r\n } else {\r\n finish()\r\n }\r\n function finish(down_obj) {\r\n if(down_obj?.amount){\r\n effective_power = power - down_obj.amount\r\n }\r\n if (ago < parseFloat(stats.spk_cycle_length))effective_power = parseInt(effective_power * (ago / stats.spk_cycle_length))\r\n else if (ago > parseFloat(stats.spk_cycle_length) && ago < stats.spk_cycle_length * 2)effective_power = effective_power* parseInt(\r\n effective_power *\r\n (1 - ((ago - stats.spk_cycle_length) / stats.spk_cycle_length) / 2)\r\n )\r\n else if (ago >= stats.spk_cycle_length * 2)effective_power = parseInt(effective_power/2)\r\n effective_total = effective_total - effective_power\r\n const voteWeight = parseFloat(effective_power/effective_total).toFixed(8)\r\n const decayWeight = parseFloat(\r\n (effective_total - effective_power) / effective_total\r\n ).toFixed(8);\r\n //verify inputs, adjust constants\r\n if(json.spk_cycle_length < 28800)json.spk_cycle_length = 28800\r\n if(json.spk_cycle_length > 3000000)json.spk_cycle_length = 3000000\r\n if(json.dex_fee < 0)json.dex_fee = 0\r\n if(json.dex_fee > 0.1)json.dex_fee = \"0.1\"\r\n if(json.dex_max < 0)json.dex_max = 0\r\n if(json.dex_max > 100)json.dex_max = 100\r\n if(json.dex_slope < 0)json.dex_slope = 0\r\n if(json.dex_slope > 100)json.dex_slope = 100\r\n if(json.spk_rate_lpow < 0)json.spk_rate_lpow = 0\r\n if(json.spk_rate_lpow > stats.spk_rate_ldel)json.spk_rate_lpow = stats.spk_rate_ldel\r\n if(json.spk_rate_ldel > stats.spk_rate_lgov)json.spk_rate_lpow = stats.spk_rate_lgov\r\n if(json.spk_rate_ldel < stats.spk_rate_lpow)json.spk_rate_ldel = stats.spk_rate_lpow\r\n if(json.spk_rate_lgov > 0.1)json.spk_rate_lgov = \"0.1\"\r\n if(json.spk_rate_lgov < stats.spk_rate_ldel)json.spk_rate_lpow = stats.spk_rate_ldel\r\n if(json.max_coll_members > 100)json.max_coll_members = 100\r\n if(json.max_coll_members < 15)json.max_coll_members = 15\r\n json.max_coll_members = parseInt(json.max_coll_members)\r\n //stats.item = (json.vote * voteWeight) + (decayWeight * stats.item)\r\n stats.spk_cycle_length = (json.spk_cycle_length * voteWeight) + (decayWeight * parseFloat(stats.spk_cycle_length)) > 28800 ? parseFloat((json.spk_cycle_length * voteWeight) + (decayWeight * stats.spk_cycle_length).toFixed(6)) : 28800\r\n stats.dex_fee = parseFloat((json.dex_fee * voteWeight) + (decayWeight * parseFloat(stats.dex_fee))).toFixed(6)\r\n stats.dex_max = parseFloat((json.dex_max * voteWeight) + (decayWeight * parseFloat(stats.dex_max))).toFixed(2)\r\n stats.dex_slope = parseFloat((json.dex_slope * voteWeight) + (decayWeight * parseFloat(stats.dex_slope))).toFixed(2)\r\n stats.spk_rate_ldel = parseFloat((json.spk_rate_ldel * voteWeight) + (decayWeight * parseFloat(stats.spk_rate_ldel))).toFixed(6)\r\n stats.spk_rate_lgov = parseFloat((json.spk_rate_lgov * voteWeight) + (decayWeight * parseFloat(stats.spk_rate_lgov))).toFixed(6)\r\n stats.spk_rate_lpow = parseFloat((json.spk_rate_lpow * voteWeight) + (decayWeight * parseFloat(stats.spk_rate_lpow))).toFixed(6)\r\n stats.max_coll_members = (json.max_coll_members * voteWeight) + (decayWeight * parseFloat(stats.max_coll_members)) < 25 ? 25 : ((json.max_coll_members * voteWeight) + (decayWeight * stats.max_coll_members) > 79 ? 79 : parseFloat((json.max_coll_members * voteWeight) + (decayWeight * stats.max_coll_members)).toFixed(6))\r\n //useful-votes-calc\r\n if(!aValidator)stats.power_voted[stats.lastIBlock] = effective_power + (typeof stats.power_voted[stats.lastIBlock] == \"number\" ? stats.power_voted[stats.lastIBlock] : 0)\r\n ops.push({\r\n type: \"put\",\r\n path: [\"stats\"],\r\n data: stats,\r\n });\r\n ops.push({\r\n type: \"put\",\r\n path: [\"spkVote\", from],\r\n data: thisVote,\r\n });\r\n ops.push({\r\n type: \"put\",\r\n path: [\"feed\", `${json.block_num}:${json.transaction_id}`],\r\n data: `@${from}| Has updated their votes.`,\r\n });\r\n store.batch(ops, pc);\r\n }\r\n });\r\n } else {\r\n ops.push({\r\n type: \"put\",\r\n path: [\"feed\", `${json.block_num}:${json.transaction_id}`],\r\n data: `@${from}| Attempted SPK vote with posting key`,\r\n });\r\n store.batch(ops, pc);\r\n }\r\n}\r\n\r\n```\r\n\r\n---\r\n\r\nThank you for participating in our development process and participating in these early stages.\r\n\r\n---\r\n\r\n#### Vote for our Witness:\r\n\r\n- https://vote.hive.uno/@threespeak\r\n\r\n- https://vote.hive.uno/@diregardfiat\r\n\r\n</div>\r\n\r\n---\r\n\r\n<center>\r\n\r\n![image.png](https://files.peakd.com/file/peakd-hive/spknetwork/23tkpCz5fuuTPRBFcbQz9ihncoGt7qVFEhxiWB6AYesGjBzkPfaZcDNxerj4vbq575nZe.png)\r\n\r\n</center>\r\n\r\n---\r\n\r\n<div class=\"text-justify\">\r\n\r\n#### About the SPK Network:\r\n\r\n>The SPK Network is a decentralized Web 3.0 protocol that rewards value creators and infrastructure providers appropriately and autonomously by distributing reward tokens so that every user, creator, and platform, will be able to earn rewards on a level playing field.\r\n\r\n- Check out the SPK Network Light Paper: https://peakd.com/hive/@spknetwork/spk-network-light-paper\r\n\r\n- Our Website: https://spk.network/\r\n\r\n- Telegram Group: https://t.me/spknetwork\r\n\r\n- Discord Server: https://discord.gg/JbhQ7dREsP\r\n\r\n- SPK Network Linktree: https://linktr.ee/spknetwork\r\n\r\n</div>","tags":["spknetwork","video","spk","voting","blockchain","leofinance","ctp","web3","dpos"]}}}"
created2023-02-08 15:03:06
last_update2023-02-08 15:03:06
depth0
children18
last_payout2023-02-15 15:03:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value45.402 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length8,350
author_reputation348,970,601,774,222
root_title"Novel Voting Mechanism - SPK Network Team Meeting"
beneficiaries
0.
accountdisregardfiat
weight4,000
1.
accounteddiespino
weight1,900
2.
accountspk.beneficiary
weight1,000
3.
accountthreespeakleader
weight100
4.
accountvaultec
weight3,000
max_accepted_payout100,000.000 HBD
percent_hbd10,000
post_id120,597,664
net_rshares162,874,605,283,755
author_curate_reward""
vote details (292)
@hivebuzz ·
Congratulations @spknetwork! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

<table><tr><td><img src="https://images.hive.blog/60x70/http://hivebuzz.me/@spknetwork/posts.png?202302081531"></td><td>You published more than 40 posts.<br>Your next target is to reach 50 posts.</td></tr>
</table>

<sub>_You can view your badges on [your board](https://hivebuzz.me/@spknetwork) and compare yourself to others in the [Ranking](https://hivebuzz.me/ranking)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>


To support your work, I also upvoted your post!


**Check out our last posts:**
<table><tr><td><a href="/hive-122221/@hivebuzz/pum-202301-delegations"><img src="https://images.hive.blog/64x128/"></a></td><td><a href="/hive-122221/@hivebuzz/pum-202301-delegations">Our Hive Power Delegations to the January PUM Winners</a></td></tr><tr><td><a href="/hive-122221/@hivebuzz/pud-202302-feedback"><img src="https://images.hive.blog/64x128/https://i.imgur.com/zHjYI1k.jpg"></a></td><td><a href="/hive-122221/@hivebuzz/pud-202302-feedback">Feedback from the February Hive Power Up Day</a></td></tr><tr><td><a href="/hive-139531/@hivebuzz/proposal-2324"><img src="https://images.hive.blog/64x128/https://i.imgur.com/RNIZ1N6.png"></a></td><td><a href="/hive-139531/@hivebuzz/proposal-2324">The Hive Gamification Proposal</a></td></tr></table>

###### Support the HiveBuzz project. [Vote](https://hivesigner.com/sign/update_proposal_votes?proposal_ids=%5B%22248%22%5D&approve=true) for [our proposal](https://peakd.com/me/proposals/248)!
properties (22)
authorhivebuzz
permlinknotify-spknetwork-20230208t155005
categoryhive-112019
json_metadata{"image":["http://hivebuzz.me/notify.t6.png"]}
created2023-02-08 15:50:03
last_update2023-02-08 15:50:03
depth1
children0
last_payout2023-02-15 15:50:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,652
author_reputation369,491,875,191,127
root_title"Novel Voting Mechanism - SPK Network Team Meeting"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id120,598,658
net_rshares0
@jelly13 ·
$0.30
*TLDR: The code may be fine but the voting rulebook is demonstrably flawed.*

At 12:30, the speaker (disregardfiat?) shows the variable voting is apparently done by [stake-weighted] averaging (*a voter with 1% stake changes 200k to 1M and the result moves up 8k*) and explains "no big fluctuations" as the advantage of this system, apparently compared to (stake-weighted) median. (*a system that I understand to be used on Hive to decide consensus witnesses' vote for HBD Savings APR*).

While that may be true, the method only (somewhat) works as long as the voters stay naive (*=ignorant of the rules and their practical consequences*) and enter their preferred value as their vote.

Let's say all other voters want instant powerdown so 99% of the stake is voting for 0 on that variable. End result: 10k (blocks). In my book, that's a failure (I want the ruleset to declare the result as 0). 
 
Am I allowed to "correct" and vote a negative number? (*minus 1M if I have 1% stake in this particular case*)

In practice someone has to set an upper and lower bound to valid votes. Often an arbitrary one. Although at times there are natural boundaries that work out poor - such as the zero lower bound here - those may favour one side (*the long powerdown camp in this example*).

Do we vote on the bounds first? Do we settle the vote with averages?

Wait, why is that? Well, most voters should vote for the minimum/maximum allowed unless they either (1) possess a large stake or (2) are lucky to have the current result close enough their optimal value. If you are this rare voter, you can calculate a value to get your dream result but you need to follow any changes and recalculate when a vote is changed. Total mess.

There is a correct way. Keep using median. The way to deal with rapid changes is to look at the current value in addition to the vote result and mildly push the new value in the direction of the result of the vote. Think of an ELO rating changing after a game - towards the 1-game performance rating but no overreactions.

👍  
properties (23)
authorjelly13
permlinkre-spknetwork-rpsaab
categoryhive-112019
json_metadata{"tags":["hive-112019"],"app":"peakd/2023.2.1"}
created2023-02-08 22:54:12
last_update2023-02-08 22:54:12
depth1
children14
last_payout2023-02-15 22:54:12
cashout_time1969-12-31 23:59:59
total_payout_value0.148 HBD
curator_payout_value0.149 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,044
author_reputation-23,210,583,863,489
root_title"Novel Voting Mechanism - SPK Network Team Meeting"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id120,609,213
net_rshares536,604,854,697
author_curate_reward""
vote details (1)
@disregardfiat ·
You're mostly right here, but at the end of the day I don't think it matters. Staking didn't stop the Sun takeover, and median values are exceptionally unlikely to be ideal values. The moving average here is done to give the most number of people the ability to vote, as a system that calculates median values would need to store and calculate all accounts votes at every vote, which won't scale. What seems like a median on Hive really is the median of 20 accounts who have a few key votes, a barely decentralized plutocracy. 

The number of people who have left Hive is just shy of all them. Let's not stretch our imagination too much and think 90% of accounts hold 20% of the stake. On Hive there is nothing they could do even together to get a single witness voted from outside the top. At least with this system they could exercise 20% of the vote toward governance. The top 20 in this paradigm are the people who vote for all the apathetic accounts... which would have prevented the Sun takeover. It also disallows the biggest accounts from exercising more than 5%(hopefully closer to 2.5% with 50% apathy) votes as well, which addresses the last point: Any single vote won't effect a variable more than 5% in the arbitrary range. 

The code does have vote range limits, so a negative vote will just be counted as a minimum. At this stage at least most of the range limits are fairly natural. Interest rates can't be negative, key holders are limited by Hive code, power-down voting range is something like 1 to 100 days... (which translates to 4 to 400 days for a full powerdown). The flip side is the 13 week power down on Hive is almost kinda voted on when there is a hardfork... but as much as people want it to drop in line with the rest of the market, there isn't even a path to do so. 

To sum

Pros:
* Scalable
* Non-exclusionary
* Same or better whale influence limit as Hive.
* Same of better arbitrary vote range limits as Hive

Cons:
* Less plutocratic(?)




👍  
properties (23)
authordisregardfiat
permlinkre-jelly13-rpsgwf
categoryhive-112019
json_metadata{"tags":["hive-112019"],"app":"peakd/2023.2.1"}
created2023-02-09 01:17:06
last_update2023-02-09 01:17:06
depth2
children13
last_payout2023-02-16 01:17:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,978
author_reputation345,191,366,639,512
root_title"Novel Voting Mechanism - SPK Network Team Meeting"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id120,612,416
net_rshares664,355,388
author_curate_reward""
vote details (1)
@jelly13 ·
I appreciate your response but I am going to mindfully ignore the most of it as it deals with voting the consensus witnesses and we might as well join/bump the discussion in [Dan's post](https://peakd.com/hive/@theycallmedan/why-20-witnesses-are-better-than-insert-arbitrary-number) for that. I am sticking to variable voting here.

I am going to quote my premises. As someone who cannot read the code, I can be easily misguided there so anyone is welcome to point out any misconceptions I have.

> The variables on SPK are voted by validators not all token holders.

Even when the number of validators goes through the roof, it is still like hundreds or thousands, not millions (of all token holders).

> Hive exhibits an arbitrary decision in (1) limiting the variable voting to 20 consensus witnesses (*maybe 21 including the backup-witness-lottery-winner?*) AND (2) voting by headcount rather than weighting by the HP backing the witness votes. 

Even if you want to avoid using all witnesses' input, it is probably easy to pick up Top 50 or 100 instead of Top 20 (the further you go, the more important is to weight).

> The system needs to store all the votes anyway (you need to look up the previous vote of the account that changed the vote) so you can only avoid recalculating every single vote. 

If storage were a problem, imagine a system that only allows you to vote for (1) increase the current value OR (2) decrease the current value (plus an option to stop voting and abstain if the value is right). That's equivalent for all rational voters and you can have 3rd party tools that voters enter their dream value in and have it monitor the results to see if a change of vote is needed.

Recalculating under such system is easy. It seems to me that at least under the non-weighted system the median can be recalculated in a similar fashion. The old vote was either UNDER the old resulting value or OVER. If the new vote stayed the same, result stands. If it changes camps, you lookup the new result as the neighbouring vote value (probably not cool for weighted votes if that means recaluclation a few million "vests" the changed vote represents).

BTW, if you still prefer averaging over medians, you can at least save some space by storing vote values as one of (min, max, something_wierd_pls_look_it_up_over_here) if it is validators voting (as opposed to general public voting naively).

> One account holding 20.1% stake should have more say than 90% of accounts holding 20% stake combined.



This is actually not subject to the prove-me-wrong request. It is a personal political view. If you change my 99% of zero, 1% of 1M example to 80-20, different people will have substantially diferent legitimate opinions on what the result should be. What a challenge!

While I am not trying to change anyone else's view, I think it is useful to know what the spirit of the SPK Network is. If negating stake-weighting is as basic part of the project as negating DVs is for Blurt, I want to know (foot voting is legit and not necessarily an all-or-nothing dilemma on blockchain as compared to IRL). FTR, I have never noticed other core personalities positioning themselves where you seem to.

People do not leave Hive as a consequence of losing an election and therefore having no say on DEX fee size. If it was like that, their "20% say on governance" would not help at all. That can prevent extreme values being voted in. Unfortunately, "exercising your 20% vote towards governance" can totally override the other 80% at times (using the bounds you call "fairly natural"). It does not sound a well-thought concept to me. I could write a full post to illustrate but I do not see any audience ITT.

Anyway, on Hive, dissent leaves because the winners can execute a financial penalty on them for voting wrong.
properties (22)
authorjelly13
permlinkrpt9ws
categoryhive-112019
json_metadata{"links":["https://peakd.com/hive/@theycallmedan/why-20-witnesses-are-better-than-insert-arbitrary-number"],"app":"hiveblog/0.1"}
created2023-02-09 11:43:42
last_update2023-02-09 11:43:42
depth3
children12
last_payout2023-02-16 11:43:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length3,818
author_reputation-23,210,583,863,489
root_title"Novel Voting Mechanism - SPK Network Team Meeting"
beneficiaries
0.
accounttipu
weight100
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id120,623,320
net_rshares0
@poshtoken · (edited)
https://twitter.com/1161694792604164097/status/1623339969803694080
https://twitter.com/1533652315152044033/status/1623341014453714946
<sub> The rewards earned on this comment will go directly to the people( @yeckingo1 ) sharing the post on Twitter as long as they are registered with @poshtoken. Sign up at https://hiveposh.com.</sub>
properties (22)
authorposhtoken
permlinkre-spknetwork-pzblscua-442287248
categoryhive-112019
json_metadata"{"app":"Poshtoken 0.0.1","payoutToUser":["yeckingo1"]}"
created2023-02-08 15:18:09
last_update2023-02-08 15:22:03
depth1
children0
last_payout2023-02-15 15:18:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length335
author_reputation5,223,287,411,206,420
root_title"Novel Voting Mechanism - SPK Network Team Meeting"
beneficiaries
0.
accountreward.app
weight10,000
max_accepted_payout1,000,000.000 HBD
percent_hbd0
post_id120,598,025
net_rshares0
@urun ·
is really hard to follow, sound is not that clear :)
properties (22)
authorurun
permlinkre-spknetwork-rpt68b
categoryhive-112019
json_metadata{"tags":["hive-112019"],"app":"peakd/2023.2.1"}
created2023-02-09 10:24:12
last_update2023-02-09 10:24:12
depth1
children0
last_payout2023-02-16 10:24:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length52
author_reputation94,125,949,460,949
root_title"Novel Voting Mechanism - SPK Network Team Meeting"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id120,622,010
net_rshares0