Skip to content

Commit

Permalink
Merge branch 'galacticcouncil:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
degengami committed Sep 18, 2023
2 parents 9859fb9 + 767d78f commit 92ef589
Show file tree
Hide file tree
Showing 11 changed files with 149 additions and 59 deletions.
29 changes: 16 additions & 13 deletions docs/democracy_referenda.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,29 @@ There are two factors which determine the weight of each vote in a referendum. T
vote_weight = tokens * conviction_multiplier
```

Vote lock periods have the same duration as the enactment delay. If tokens are locked for 1 voting period, this means that they will remain locked for **3 days** after the voting has ended. Voters can influence the weight of their votes by decreasing or increasing the amount of periods for which the tokens are locked. It is possible to bring out a vote with 0 lock periods, however its weight would be only a fraction (conviction multiplier of 0.1x). On the other hand, the conviction multiplier increases by 1 for every doubling of the lock periods. As shown in the table below, locking the votes for the maximum of 32 periods would raise the conviction multiplier to 6x.

| Lock Periods | Conviction Multiplier |
|:-----------------:|:---------------------:|
| 0 | 0.1 |
| 1 | 1 |
| 2 | 2 |
| 4 | 3 |
| 8 | 4 |
| 16 | 5 |
| 32 | 6 |
The table below contains an overview of the various Conviction Multipliers and the amount of days the tokens will be locked up for. It is possible to bring out a vote without locking your HDX, however its weight would be only a fraction (conviction multiplier of 0.1x). As shown in the table below, locking the tokens for the maximum of 192d would raise the conviction multiplier to 6x.

| Conviction Multiplier | Days Locked |
|:---------------------:|:-----------:|
| 0.1x | 0d |
| 1x | 6d |
| 2x | 12d |
| 3x | 24d |
| 4x | 48d |
| 5x | 96d |
| 6x | 192d |

```
An example:
Alice votes with 5000 HDX and 0 lock periods.
Bob votes with 100 HDX and 32 lock periods.
Alice votes with 5000 HDX and 0.1x Conviction Multiplier.
Bob votes with 100 HDX and 6x Conviction Multiplier.
Weight Alice: 500
Weight Bob: 600
Token lock Alice: 0 days
Token lock Bob: 192 days
```

### Voting Modes {#referenda-voting-modes}
Expand Down
52 changes: 52 additions & 0 deletions docs/howto_stake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
id: howto_stake
title: Stake HDX
---

import useBaseUrl from '@docusaurus/useBaseUrl';

Staking allows users to stake their HDX tokens and earn rewards which vest over time. This page contains a step-by-step guide on how to stake your HDX. Before proceeding, we recommend that you get familiar with [the basics of HDX staking](/staking).

If you don't have any HDX, you can obtain some on our [trade page](https://app.hydradx.io/#/trade) by swapping against a range of assets supported by the Omnipool.

### Step 0: Navigate to HydraDX Staking Page

https://app.hydradx.io/staking

Connect your wallet to HydraDX by clicking **`Connect Account`**.

### Step 1: Stake Your HDX

- Select the amount of HDX tokens you would like stake **(3)**.
- Click on **`Stake`** **(4)** to confirm and sign the transaction using your wallet app.

<div style={{textAlign: 'center'}}>
<img alt="metadata" src={useBaseUrl('/howto_stake/staking_1.jpg')} />
</div>

### Step 2: Keep Your HDX Staked

- The amount of rewards you receive is determined by the size of your staked HDX relative to the whole stake pool.
- As time passes, you unlock a greater portion of your allocated rewards. The rate of unlocking is determined by a rewards bonding curve.
- Learn more in the [Staking product docs](/staking).

### Step 3: Boost Your Rewards

- Collect Action Points to boost your rewards and increase the pace at which you unlock rewards.
- You can collect Action Points by [voting on referenda](https://hydradx.subsquare.io/democracy/referenda). The more staked HDX you use for the vote and the higher the Conviction Multitplier - the more Action Points you receive.
- Learn more in the [Staking product docs](/staking).

### Step 4: Claim Your Rewards

- Review your Staking statistics to observe and plan your own staking strategy **(5)**.
- Once you are done staking, `Claim` your unlocked rewards **(8)**.

<div style={{textAlign: 'center'}}>
<img alt="metadata" src={useBaseUrl('/howto_stake/staking_2.jpg')} />
</div>

:::caution
Every time you claim unlocked staking rewards, you forfeit any locked rewards which are redistributed to all other stakers. Furthermore, your past Action Points will be reset.

For instance, if a staker claims rewards when 75% of the rewards are available, the remaining 25% is forfeited. The staker must then wait for the same duration to claim 75% of the subsequent batch of rewards.
:::
26 changes: 13 additions & 13 deletions docs/node_monitoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ $ sudo chown -R prometheus:prometheus /var/lib/prometheus
### Install Prometheus {#install-prometheus}

Check latest version number of Prometheus at the [GitHub release page](https://github.com/prometheus/prometheus/releases/).
At the time of writing it is v2.25.2. Insert the latest release version in the following commands.
At the time of writing it is v2.34.0. Insert the latest release version in the following commands.

```shell script
# download prometheus
$ wget https://github.com/prometheus/prometheus/releases/download/v2.25.2/prometheus-2.25.2.linux-amd64.tar.gz
$ wget https://github.com/prometheus/prometheus/releases/download/v2.34.0/prometheus-2.34.0.linux-amd64.tar.gz

# unpack the binaries
$ tar xfz prometheus-*.tar.gz

# enter the unpacked directory
$ cd prometheus-2.25.2.linux-amd64
$ cd prometheus-2.34.0.linux-amd64
```

Now copy over the binaries into the local folder.
Expand Down Expand Up @@ -180,27 +180,27 @@ You should now be able to access Prometheus' web interface at http://localhost:9

We will install Node Exporter to scrape server metrics that will be used in the dashboard.
Please check the version number of the latest release [here](https://github.com/prometheus/node_exporter/releases/) and update the command.
At the time of writing the latest version was `1.1.2`.
At the time of writing the latest version was `1.3.1`.

### Install Node Exporter {#install-node-exporter}

Download the latest release.

```shell script
$ wget https://github.com/prometheus/node_exporter/releases/download/v1.1.2/node_exporter-1.1.2.linux-amd64.tar.gz
$ wget https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz
```

Unpack the archive you just downloaded. This will create a folder called `node_exporter-1.1.2.linux-amd64`.
Unpack the archive you just downloaded. This will create a folder called `node_exporter-1.3.1.linux-amd64`.

```shell script
$ tar xvf node_exporter-1.1.2.linux-amd64.tar.gz
$ tar xvf node_exporter-1.3.1.linux-amd64.tar.gz
```

Next we copy the binary into our local application directory and assign it to our monitoring user.

```shell script
# copy binary
$ cp node_exporter-1.1.2.linux-amd64/node_exporter /usr/local/bin
$ sudo cp node_exporter-1.3.1.linux-amd64/node_exporter /usr/local/bin

# set ownership
$ sudo chown prometheus:prometheus /usr/local/bin/node_exporter
Expand Down Expand Up @@ -264,7 +264,7 @@ Paste the following content and save the file.
- targets: ['localhost:9100']
```
The apply the changes configuration a restart of the Prometheus service is required.
Then apply the changes. A restart of the Prometheus service is required.
```shell script
$ sudo systemctl restart prometheus.service
Expand All @@ -282,12 +282,12 @@ We want it nice and beautiful. That's where Grafana comes into play.

Please check what's the latest Grafana Version [with this link](https://grafana.com/grafana/download?platform=linux).
You can either change the version number in the following commands or copy the install commands directly from the link.
At the time of writing the latest version was `7.5.1`.
At the time of writing the latest version was `8.4.6`.

```shell script
$ sudo apt-get install -y adduser libfontconfig1
$ wget https://dl.grafana.com/oss/release/grafana_7.5.1_amd64.deb
$ sudo dpkg -i grafana_7.5.1_amd64.deb
$ wget https://dl.grafana.com/oss/release/grafana_8.4.6_amd64.deb
$ sudo dpkg -i grafana_8.4.6_amd64.deb
```

The package comes with a builtin `systemd`-service which we will configure and start just like the Prometheus service.
Expand Down Expand Up @@ -327,7 +327,7 @@ Please click the `Plus`-button in the main navigation and select `import`.
<img src={useBaseUrl('/node-monitoring/grafana-import.png')} />
</div>

We will use the [HydraDX Dashboard](https://grafana.com/grafana/dashboards/14158) and to load it you simply input the id `14158` and hit the `Load`-button.
We will use the [HydraDX Dashboard](https://grafana.com/grafana/dashboards/14158) layout, so simply input the id `14158` and hit the `Load`-button.

<div style={{textAlign: 'center'}}>
<img src={useBaseUrl('/node-monitoring/grafana-import-options.png')} />
Expand Down
47 changes: 16 additions & 31 deletions docs/participate_in_referenda.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,51 +5,36 @@ title: Participate in Referenda

import useBaseUrl from '@docusaurus/useBaseUrl';

This post provides a step-by-step guide on how to participate in referenda - voting and proposing. There are two alternative tools which you can use for this purpose - [Commonwealth.im](#cw) or [Polkadot/apps](#polkajs).
This post provides a step-by-step guide on how to participate in referenda - voting and proposing. There are two alternative tools which you can use for this purpose - [Subsquare](#sub) or [Polkadot/apps](#polkajs).

Before you decide to participate, we strongly encourage you to read through the [knowledge article](/democracy_referenda) in the Learn / Democracy section. There you will find some important details on the mechanics behind referenda.

:::caution
The HydraDX democracy module will be launched on or after **15 September 2021**. Please do not attempt any of the shown actions before that date.
:::

## Using Commonwealth.im {#cw}
### Vote in a Referendum {#cw-vote}
You can see all referenda which are open for voting by navigating to the [Referenda tab](https://commonwealth.im/hydradx/referenda) on the HydraDX Commonwealth page.

To vote on an active referendum, you need to click on it. After that, you will see a page showing all relevant details.

In the section *Cast Your Vote*, fill in the following information:
## Using Subsquare {#sub}
### Vote in a Referendum {#sub-vote}
To see all active and past referenda, navigate to the [Referenda tab](https://hydradx.subsquare.io/democracy/referenda) on Subsquare.

* Amount to vote - this is the amount of HDX tokens you are willing to lock in support of the referendum
* Conviction multiplier - this is the multiplier which co-determines the [weight of your vote](/democracy_referenda#referenda-votes-weighing).

After that, bring out your vote by clicking on *Vote yes* or *Vote no* and sign the transaction.
For first time and previous users, click on `Login` (top right corner) and connect your wallet.

### Propose a Referendum {#cw-propose}
To propose a referendum, visit the [HydraDX Commonwealth page](https://commonwealth.im/hydradx/) and click in the top menu on *New Thread > New democracy proposal*.
Click on an active referendum to see its details, the voting turnout, as well as the voting module.

<div style={{textAlign: 'center'}}>
<img src={useBaseUrl('/participate_in_referenda/cw-proposal.jpg')} />
<img src={useBaseUrl('/participate_in_referenda/sub-proposal.jpg')} />
</div>

Fill in the information in the fields show above. The most important parameters are:
* Module
* Function
* Any additional information as specified by the function that you are proposing to be called
* Deposit - the amount of HDX tokens which you are willing to deposit in support of the proposal
To cast your vote, click on `Vote` and provide the following information:

In the example above, the proposal module is *balances*, and the function is *setBalance* which modifies the free and reserve balances of a given account.
- **Vote with account** - select the voting account.
- **Value** - this is the amount of HDX tokens you are willing to lock in support of the referendum.
- **Vote lock** - this is the multiplier which co-determines the [weight of your vote](https://docs.hydradx.io/democracy_referenda#referenda-votes-weighing).

To submit the proposal, click on *Send transaction* and sign using your wallet.
After that, bring out your vote by clicking on *Nay* (No) or *Aye* (Yes) and sign the transaction.

After submitting the proposal on-chain and signing the transaction, your proposal should appear in the [list of proposed referenda](https://commonwealth.im/hydradx/referenda).
In the section *Cast Your Vote*, fill in the following information:

:::caution
Every voting period, the referendum proposal with the highest backing (*seconding*) enters the voting round. As the amount of referenda grows, there is no guarantee that your proposal will ever gain sufficient seconding to enter voting. There is no option to withdraw a referendum proposal, meaning that your funds might remain locked for a longer period of time.
* Amount to vote - this is the amount of HDX tokens you are willing to lock in support of the referendum
* Conviction multiplier - this is the multiplier which co-determines the [weight of your vote](/democracy_referenda#referenda-votes-weighing).

Malicious referendum proposals are punished. The HydraDX Council and the Technical Committee have the right to cancel any referendum which was proposed in bad faith. As a result, the deposited tokens will be burnt.
:::
After that, bring out your vote by clicking on *Vote yes* or *Vote no* and sign the transaction.

## Using Polkadot/apps {#polkajs}

Expand Down
48 changes: 48 additions & 0 deletions docs/staking.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
id: staking
title: Staking
---

import useBaseUrl from '@docusaurus/useBaseUrl';

HydraDX has a **long-running HDX staking program** which **incentivizes user activity** in areas that are beneficial to the Protocol. On this page you will find important information regarding the **mechanics behind the HDX Staking program**. You can also check out our [step-by-step guide on staking](/howto_stake).

## Staking Basics {#basics}

HDX holders can **stake their HDX and receive rewards** which become **claimable as time passes**. Staking rewards are distributed from a dedicated pot that is gradually filled up by **different Protocol revenue streams**. Initially, the main revenue stream are the **LP fees** which the HydraDX Protocol accrues from its **HDX LP position in the Omnipool**. Furthermore, the HydraDX community has approved a proposal to support the APR during the first year of the staking program with **an additional subsidy of ~22M HDX** from the HydraDX Treasury which is gradually distributed to the staking rewards pot once per day.

Rewards which enter the staking pot are always distributed directly to all stakers at any given moment. The amount that users are entitled to is proportional to the relative size of their stake in the stake pool. However, stakers do not automatically receive the rewards on their account - instead, they need to claim them.

When it comes to claiming rewards, all participants in HDX staking should be aware of the elements of **loyalty and gamification**. Once rewards are awarded, they cannot be instantly claimed for the full amount - doing so would yield just a fraction of the total rewards, with the remainder being returned the pot for redistribution to all stakers.

Users who want to claim as many rewards as possible should keep their HDX staked without claiming until sufficient time has passed (rewards are “vested” following a bonding curve). The length of the waiting period is dynamic and depends on the user (in)actions. A user who just **stakes passively** would need to **wait ~2 years to claim 95% of their rewards**. In contrast, **active stakers** who collect the maximum amount of action points (more on that below) could claim **95% of their rewards in just over 2 months.** These are rough estimates - the actual timelines may vary in accordance with user actions and overall count of referenda.

## Boosting Your Rewards {#boosting-your-rewards}

Stakers can increase the pace at which they can claim their rewards by **collecting action points** and **boosting their rewards**. Action points can be acquired by performing certain actions that are incentivized by the Protocol. Initially, the only way to collect action points is to **participate in the governance of HydraDX** by [voting on community referenda](https://hydradx.subsquare.io/democracy/referenda) **using the staked HDX**.

<div style={{textAlign: 'center'}}>
<img alt="login" src={useBaseUrl('/staking/rewards_bonding_curve.jpg')} width="500px" />
</div>

There are 2 factors which determine the amount of action points that stakers will receive: The **size of the vote** (relative to the total size of their staked HDX), and the **conviction multiplier**. The higher the conviction multiplier of the vote, the greater its weight. Keep in mind that voting with a conviction multiplier places a **temporary lock on the tokens**. Stakers looking to achieve the highest rewards boost would be voting with 6x conviction multiplier, thereby locking their HDX for 192 days (counted from the last vote using such conviction). Just a reminder that **this lock is not related to staking** as such - instead, it is a standard feature of governance in the Polkadot ecosystem (more info [in our docs](/democracy_referenda#referenda-votes-weighing)).

| Conviction Multiplier | Days Locked |
|:---------------------:|:-----------:|
| 0.1x | 0d |
| 1x | 6d |
| 2x | 12d |
| 3x | 24d |
| 4x | 48d |
| 5x | 96d |
| 6x | 192d |

## Claiming Your Rewards

As they keep their HDX staked, **users accumulate rewards over time**. These rewards become claimable subject to a bonding curve which is influenced by the boosts from action points (see above).

At any given time, **stakers can claim** (a portion of) their claimable rewards. By doing so, however, they **forfeit the remainder of their non-claimable rewards**. These rewards are **automatically transferred back to the staking rewards pot** which **redistributes them to all other stakers**. Furthermore, claiming **resets the past action points of the user**, sending users back to the beginning of the bonding curve for future rewards from staking.

This mechanism creates an interesting **gamification dynamic**: By **remaining longer in the pool of stakers**, users not only **unlock a greater part** of their allocated rewards - they also have the chance to receive a **juicy portion of rewards from other stakers who claim or exit early**.

Happy staking!
6 changes: 4 additions & 2 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = {
"omnipool_trading",
"omnipool_dca",
"omnipool_lp",
"staking",
"omnipool_treasuries",
"omnipool_security",
"omnipool_impermanent_loss",
Expand All @@ -13,12 +14,13 @@ module.exports = {
"spending_fw",
],
"How-to": [
"howto_xcm",
"howto_bridge",
"howto_trade",
"howto_dca",
"howto_lp",
"howto_hydrated_farms",
"howto_xcm",
"howto_bridge",
"howto_stake",
{
type: "category",
label: "Wallets",
Expand Down
Binary file added static/howto_stake/staking_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/howto_stake/staking_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed static/participate_in_referenda/cw-proposal.jpg
Binary file not shown.
Binary file added static/participate_in_referenda/sub-proposal.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/staking/rewards_bonding_curve.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 92ef589

Please sign in to comment.