Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Staking docs #168

Merged
merged 6 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
:::
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.
vgantchev marked this conversation as resolved.
Show resolved Hide resolved

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 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.
Loading