Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -153,18 +153,7 @@ console.log(Object.fromEntries(pools))
},
"tokenId": 1,
"capacity": "0x00000000001a784379d99db420000000",
"bonusCycle": {
"previousStart": 98,
"start": 219,
"end": 339,
"pendingDuration": null
},
"creationBlock": 1654079,
"bonusesPaid": [
164,
...
247
],
"name": "0x"
},
...
Expand Down Expand Up @@ -202,21 +191,7 @@ console.log(pool)
},
"tokenId": 1,
"capacity": "0x00000000001a784379d99db420000000",
"bonusCycle":
{
"previousStart": 98,
"start": 219,
"end": 339,
"pendingDuration": null
},
"creationBlock": 1654079,
"bonusesPaid":
[
163,
164,
165,
...
],
"name": "0x"
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ You should look out for the following criteria when choosing a nomination pool:
- **Capacity -** shows the maximum amount of sENJ that the pool can issue. If the capacity is reached, you will not be able to stake ENJ in the pool.
- **Nominees -** displays the validators that the pool is nominating. Remember that the pool will only receive rewards if their nominated validators are selected to produce a block. If the validator is slashed for any reason (e.g. being offline for too long), the funds nominated by pool will be slashed as well.
- **Members -** shows the current participants for each nomination pool. More members can provide higher stake, but it also means that rewards will be split between more people.
- **Bonus Cycle -** when pool information is expanded, you can see the `start era` and `end era` number of the bonus cycle, during this period the bonus rewards are tracked for the pool and its members.

![](/img/components/enjin-relaychain/21.png)

Expand Down Expand Up @@ -58,7 +57,10 @@ Every era the rewards are generated for NPoS participants, creating inflation. T

## Leaving a nomination pool

If you wish to leave a nomination pool, you can do so by clicking on the `Unbond` button that is displayed under each expanded pool. Please note that unbonding period is not immediate and the bonus cycle needs to completely pass before funds can be withdrawn using `Withdraw unbonded` button.
To leave a nomination pool, expand the pool details and click `Unbond`.
:::note
You must wait 28 eras for the unbonding period to complete. Once finished, click `Withdraw unbonded` to retrieve your funds.
:::

![](/img/components/enjin-relaychain/28.png)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ slug: "validator-staking"
---
This is an overview of staking on Enjin Relaychain, known as liquid staking.

:::info The Enjin Blockchain Console
Use [console.enjin.io](https://console.enjin.io/) to use the user interface referenced in this document.
:::info Staking Interfaces
- **[NFT.io](https://nft.io):** Use NFT.io for a simplified experience. It provides a convenient, user-friendly interface to manage your stake and nomination pools.
- **[Enjin Console](https://console.enjin.io/)**: For advanced features and the full user interface referenced in this document, use [console.enjin.io](https://console.enjin.io/).
- *Note:* Ensure you connect to the **Enjin Relaychain** network in the top left corner, as staking takes place on the Relaychain.
:::

## Concepts
Expand All @@ -15,7 +17,7 @@ Use [console.enjin.io](https://console.enjin.io/) to use the user interface refe
- **Liquid staking -** a token is received that represents the user's stake. The staked token can be used (is liquid) while the user is staked. It is minted when the user stakes and burned when they unstake. It can also be exchanged for the real token.
- **Validator -** Provides security for the network and receives rewards for doing so. On Enjin, these rewards are distributed to nomination pools. (A list of active validators can be seen on [Subscan](https://enjin.subscan.io/validator).)
- **Nominator -** The account that chooses a validator to stake with. In the case of Enjin, this is the nomination pool's account.
- **Commission -** A percentage of the rewards taken for offering a service. On Enjin, a commission can be taken by both the validator and the holder of the Degen NFT.
- **Commission -** A percentage of the rewards taken for offering a service. This can be either or both: a commission set by a validator, for their contributions to progressing and securing the network; and/or a commission set by a nomination pool owner, for having created the pool for which the active validator(s) were selected and the user(s) of the pool benefited.

## Nomination Pools vs Direct Staking

Expand All @@ -26,7 +28,7 @@ On Enjin, we use nomination pools to handle staking due to the increased simplic
With nomination pools, there is one account that multiple users put their funds into. This account acts as the nominator and receives the rewards. The liquid token, sENJ, is used to represent a user's stake in the pool.

- **Low minimum (1 ENJ) -** pools can have lower minimums per user because all of the pool's funds are staked together
Easy to use - users only need to choose a pool, no need to choose validators
- **Easy to use** - users only need to choose a pool, no need to choose validators
- **Receive liquid token -** a liquid token, sENJ, is received that represents the user's stake. This can be transferred or even exchanged for ENJ
- **Immediate exit -** due to the liquid token, the user can exit immediately by exchanging their sENJ for ENJ

Expand Down Expand Up @@ -55,7 +57,7 @@ Direct staking is not supported on Enjin. This information is just for compariso
There are three tokens relevant to staking:

- **ENJ -** ENJ is the native token of the Enjin network. It is the token staked in the pool.
- **sENJ -** sENJ is the liquid token that represents staked ENJ. It is minted when ENJ is staked and burned when ENJ is unstaked. It can also be exchanged for ENJ through the exchange pallet.
- **sENJ -** sENJ is the liquid token that represents staked ENJ. It is minted when ENJ is staked and burned when ENJ is unstaked. It can also be exchanged for ENJ through the `stakeExchange` pallet.
- **Degen Token -** The degen token is an NFT in a special collection. It is required to create a pool and is also used to manage the pool. The owner of this NFT can optionally receive a commission. Each token is only usable in one pool at a time.

![](/img/components/enjin-relaychain/3.png)
Expand Down Expand Up @@ -83,33 +85,14 @@ Here's an example to show the relationship between ENJ and sENJ. The important t

![](/img/components/enjin-relaychain/5.jpg)

## Bonus Cycle

There are two balances in a pool.

- reward balance - rewards from the pool
- bonus balance - part of the rewards that are held and distributed in cycles

80% of the rewards are distributed immediately, 20% are put into the bonus balance. Bonuses are calculated per validator. As the graphic shows, the 20% is collected at the beginning of the payout, then it is distributed to each pool's bonus account. Pools with longer bonus cycles get more bonus.

![](/img/components/enjin-relaychain/6.png)

Each era, some amount of bonus is distributed from each pool's bonus account to its rewards account. This amount changes depending on the pool's bonus cycle. A small amount of bonus is distributed at the beginning of the cycle, but at the end, each era distributes a large amount of bonus. By the end of the cycle, the whole bonus is distributed, and the cycle restarts.

![](/img/components/enjin-relaychain/7.png)

## Payouts

Payouts do not happen automatically. The payout_rewards extrinsic should be called once per validator per era. This extrinsic does two things:
Reward payouts are automated by validators, eliminating the need for manual intervention. However, understanding the distribution logic is helpful:

1. Collect rewards
1. For the era it is called in, it collects the staking rewards from the validator. As stated above, some of this goes directly to the reward account. The rest goes through several calculations some portion goes into each pool's bonus account.
2. Distribute rewards
1. The reward distribution happens for the previous era, so it's always one era behind. It is done this way because it needs to wait for the pools to collect rewards from all validators. It does the following:
1. If the pool has reached the end of its cycle, it cycles the pool
2. Sends bonus for era from the bonus account to the rewards account
3. Sends reward commission to the degen token holder
4. The pool's reward balance is staked (reinvested) so that rewards will be as high as possibl
1. **Reward Collection:** Staking rewards are collected from the validator into the reward account for the current era.
2. **Reward Distribution:** Rewards are distributed for the *previous* era (one era lag) to ensure all validator rewards are fully collected first. This stage involves:
1. Sending the commission to the Degen token holder.
2. Staking (reinvesting) the pool's remaining reward balance to maximize future returns.

![](/img/components/enjin-relaychain/8.png)

Expand Down Expand Up @@ -137,8 +120,6 @@ These are the extrinsics that will be called by users (members) of the pool.

### Permissionless

These extrinsics can be called by anyone. Some of them can only be called when the pool is in the `Destroying` state.

- **`payout_rewards`** - This can be called by anyone, and should be called once per validator per era. It distributes the payouts and handles calculations like bonuses and commissions.
- **`unbond_deposit`** - Unbonds the deposit. Only callable after the pool is destroyed and all members have left the pool.
- **`withdraw_deposit`** - Withdraws the deposit. Can only be called after the deposit is unbonded. The pool will be destroyed (deleted) after this is called successfully.
These extrinsics can be called when the pool is in the `Destroying` state, by anyone.
* **`unbond_deposit`** - Unbonds the deposit. Only callable after the pool is destroyed and all members have left the pool.
* **`withdraw_deposit`** - Withdraws the deposit. Can only be called after the deposit is unbonded. The pool will be destroyed (deleted) after this is called successfully.
Binary file removed static/img/components/enjin-relaychain/6.png
Binary file not shown.
Binary file removed static/img/components/enjin-relaychain/7.png
Binary file not shown.
Binary file modified static/img/components/enjin-relaychain/8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.