Skip to content

Commit

Permalink
Edits Voluntary Locking (#5072)
Browse files Browse the repository at this point in the history
* edits

* final edits

- changed pallet rendering
- updated jsx file table

* added info about voting twice

* Michalis feedback

* minor edit
  • Loading branch information
filippoweb3 authored Aug 7, 2023
1 parent ae7befe commit 191e6dc
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 56 deletions.
13 changes: 6 additions & 7 deletions components/Voluntary-Locking.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ let table = <table>
const lockPeriods = ["p0", "p1", "p2", "p4", "p8", "p16", "p32"]

const dotLocking = {
p0: 0,
p1: 28,
p2: 56,
p4: 112,
Expand All @@ -69,12 +68,12 @@ const dotLocking = {

const ksmLocking = {
p0: 0,
p1: 8,
p2: 16,
p4: 32,
p8: 64,
p16: 128,
p32: 256
p1: 7,
p2: 14,
p4: 28,
p8: 56,
p16: 112,
p32: 224
}

function VoluntaryLocking() {
Expand Down
49 changes: 3 additions & 46 deletions docs/learn/learn-governance.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ slug: ../learn-governance

import RPC from "./../../components/RPC-Connection";

import VLTable from "./../../components/Voluntary-Locking";

{{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} uses a sophisticated governance
mechanism that allows it to evolve gracefully overtime at the ultimate behest of its assembled
stakeholders. The stated goal is to ensure that the majority of the stake can always command the
Expand Down Expand Up @@ -361,54 +359,13 @@ below).

### Voluntary Locking

{{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} utilizes an idea called voluntary
locking that allows token holders to increase their voting power by declaring how long they are
willing to lock up their tokens; hence, the number of votes for each token holder will be calculated
by the following formula:

```
votes = tokens * conviction_multiplier
```

The conviction multiplier increases the vote multiplier by one every time the number of lock periods
double.

<VLTable />

The maximum number of "doublings" of the lock period is set to 6 (and thus 32 lock periods in
total), and one lock period equals
{{ polkadot: <RPC network="polkadot" path="consts.democracy.voteLockingPeriod" defaultValue={403200} filter="blocksToDays"/> :polkadot }}
{{ kusama: <RPC network="kusama" path="consts.democracy.voteLockingPeriod" defaultValue={115200} filter="blocksToDays"/> :kusama }}
days. Only doublings are allowed; you cannot lock for 24 periods and increase your conviction by
5.5. For additional information regarding the timeline of governance events, check out the
governance section on the
{{ polkadot: [Polkadot Parameters page](maintain-polkadot-parameters/#governance) :polkadot }}{{ kusama: [Kusama Parameters page](kusama-parameters/#governance) :kusama }}.

:::info Staked tokens can be used in governance
:::info Voluntary Locking

While a token is locked, you can still use it for voting and [staking](./learn-staking.md). You are
only prohibited from transferring these tokens to another account.
For more information about voluntary locking or conviction voting see
[Polkadot OpenGov](./learn-polkadot-opengov.md#voluntary-locking).

:::

Votes are always "counted" at the same time (at the end of the voting period), no matter for how
long the tokens are locked.

See below an example that shows how voluntary locking works.

Peter: Votes `No` with {{ polkadot: 10 DOT :polkadot }}{{ kusama: 1 KSM :kusama }} for a 128 week
lock period => {{ polkadot: 10 x 6 = 60 Votes :polkadot }}{{ kusama: 1 x 6 = 6 Votes :kusama }}

Logan: Votes `Yes` with {{ polkadot: 20 DOT :polkadot }}{{ kusama: 2 KSM :kusama }} for a 4 week
lock period => {{ polkadot: 20 x 1 = 20 Votes :polkadot }}{{ kusama: 2 x 1 = 2 Votes :kusama }}

Kevin: Votes `Yes` with {{ polkadot: 15 DOT :polkadot }}{{ kusama: 1.5 KSM :kusama }} for a 8 week
lock period => {{ polkadot: 15 x 2 = 30 Votes :polkadot }}{{ kusama: 1.5 x 2 = 3 Votes :kusama }}

Even though combined both Logan and Kevin vote with more
{{ polkadot: DOT :polkadot }}{{ kusama: KSM :kusama }} than Peter, the lock period for both of them
is less than Peter, leading to their voting power counting as less.

### Delegations

In {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} you can
Expand Down
64 changes: 61 additions & 3 deletions docs/learn/learn-polkadot-opengov.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,20 +404,78 @@ additionally cast a _abstain_ and _split_ votes.
[Vote splitting](../maintain/maintain-guides-polkadot-opengov.md#voting-on-referenda) allows voters
to allocate different votes for _aye_, _nay_, and _abstain_.

:::info Only the last vote counts

Voting a second time replaces your original vote, e.g. voting with 10
{{ polkadot: DOT :polkadot }}{{ kusama: KSM :kusama }}, then a second extrinsic to vote with 5
{{ polkadot: DOT :polkadot }}{{ kusama: KSM :kusama }}, means that you are voting with 5
{{ polkadot: DOT :polkadot }}{{ kusama: KSM :kusama }}, not 10
{{ polkadot: DOT :polkadot }}{{ kusama: KSM :kusama }}.

:::

### Voluntary Locking

:::info Voluntary Locking
{{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} utilizes an idea called voluntary
locking that allows token holders to increase their voting power by declaring how long they are
willing to lock up their tokens; hence, the number of votes for each token holder will be calculated
by the following formula:

```
votes = tokens * conviction_multiplier
```

The conviction multiplier increases the vote multiplier by one every time the number of lock periods
double.

<VLTable />

{{ polkadot: **The table above shows the correct duration values. However, the current values for Polkadot are the same as those for Kusama. This is going to be fixed. For more information, see [this GitHub issue](https://github.com/paritytech/polkadot/issues/7394).** :polkadot }}

The maximum number of "doublings" of the lock period is set to 6 (and thus 32 lock periods in
total), and one lock period equals {{ polkadot: 28 :polkadot }}
{{ kusama: <RPC network="kusama" path="consts.convictionVoting.voteLockingPeriod" defaultValue={100800} filter="blocksToDays"/> :kusama }}
days. For additional information regarding the timeline of governance events, check out the
governance section on the
{{ polkadot: [Polkadot Parameters page](maintain-polkadot-parameters/#governance) :polkadot }}{{ kusama: [Kusama Parameters page](kusama-parameters/#governance) :kusama }}.

:::info Staked tokens can be used in governance

Voluntary locking in Polkadot OpenGov is
[the same as in Governance v1](./learn-governance.md#voluntary-locking).
While a token is locked, you can still use it for voting and [staking](./learn-staking.md). You are
only prohibited from transferring these tokens to another account.

:::

Votes are always "counted" at the same time (at the end of the voting period), no matter for how
long the tokens are locked.

See below an example that shows how voluntary locking works.

Peter: Votes `No` with
{{ polkadot: 10 DOT for a 128-week :polkadot }}{{ kusama: 1 KSM for a 32-week :kusama }} lock period
=> {{ polkadot: 10 x 6 = 60 Votes :polkadot }}{{ kusama: 1 x 6 = 6 Votes :kusama }}

Logan: Votes `Yes` with
{{ polkadot: 20 DOT for a 4-week :polkadot }}{{ kusama: 2 KSM for one week :kusama }} lock period =>
{{ polkadot: 20 x 1 = 20 Votes :polkadot }}{{ kusama: 2 x 1 = 2 Votes :kusama }}

Kevin: Votes `Yes` with
{{ polkadot: 15 DOT for a 8-week :polkadot }}{{ kusama: 1.5 KSM for a 2-week :kusama }} lock period
=> {{ polkadot: 15 x 2 = 30 Votes :polkadot }}{{ kusama: 1.5 x 2 = 3 Votes :kusama }}

Even though combined both Logan and Kevin vote with more
{{ polkadot: DOT :polkadot }}{{ kusama: KSM :kusama }} than Peter, the lock period for both of them
is less than Peter, leading to their voting power counting as less.

:::info Conviction Voting Locks created during Gov 1

Conviction voting locks in Governance v1 will not be carried over to OpenGov. Voting with conviction
in OpenGov will create a new lock (as this will use the `convictionVoting` pallet), while any
existing lock under Governance v1 (using the deprecated `democracy` pallet) will be left to expire.
Delegations under Governance v1 will need to be re-issued under OpenGov.

:::

### Multirole Delegation

Polkadot OpenGov builds on the
Expand Down

0 comments on commit 191e6dc

Please sign in to comment.