forked from 1inch/merkle-distribution
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Handling legacy staking (Nu & Keep tokens) end of support #112
Comments
List of legacy stakes affected: Legacy staking provider list
Legacy stakes authorizations: Monitoring legacy stakes staked amount: |
Related issues: #95 |
This was referenced Dec 26, 2023
manumonti
added a commit
that referenced
this issue
Feb 1, 2024
As this is a cumulative Merkle distribution, the rewards here collected are the sum of the rewards distributed in previous Merkle distributions plus the rewards earned in the period between the last and the current distribution. The rewards earned in this distribution are determined for the period between Jan 1st 2024 and Feb 1st 2024 and include: - One-off Commitment Bonus: this is a incentive for longer staking commitments at genesis. Stakes that did the lock-up extension before January 15th, 2024 (UTC 23:59:59) received an extra yield that varies according to the extra lock-up period choosen [1]. - TACo rewards: for those that have a TACo operator confirmed and were staking T and authorized TACo application for the period Jan 1st 24 - Feb 1st 24. - tBTCv2 rewards: for those that complied with the tBTCv2 requirements for the period Jan 1st 24 - Feb 1st 24. Note that stakes with legacy Keep staking won't be included in this distribution. See note below. The rewards allocation for this distribution is 25% for TACo rewards and 75% for tBTC rewards. Note: No rewards for stakes with legacy Keep. Since the deadline for the legacy tokens transtion has not yet ended for legacy Keep staking, and considering that stakes which completed the process will earn the complete amount of rewards for their legacy tokens at the end of the process, but those that won't complete the process in time won't, it is not possible to know how much rewards have been calculated for those stakes with legacy tokens. For this reason, no rewards have been calculated for legacy stakes in this distribution period. In future distributions after the transition deadline, the remaining rewards will be distributed. Info: [2] [3]. [1] https://docs.threshold.network/staking-and-running-a-node/taco-node-setup/taco-authorization-and-operator-registration/one-off-commitment-bonus [2] https://forum.threshold.network/t/transition-guide-for-legacy-stakers/719 [3] #112
manumonti
added a commit
to threshold-network/staking-subgraphs
that referenced
this issue
Feb 15, 2024
To calculate the pending legacy Keep rewards [1] it is necessary to know if the stakes are elegible for legacy PRE rewards. To know this, it is necessary to have (again) this subgraph. [1] threshold-network/merkle-distribution#112
manumonti
added a commit
to threshold-network/staking-subgraphs
that referenced
this issue
Feb 15, 2024
To calculate the pending legacy Keep rewards [1] it is necessary to know if the stakes are elegible for legacy PRE rewards. To know this, it is necessary to have (again) this subgraph. [1] threshold-network/merkle-distribution#112
manumonti
added a commit
to threshold-network/staking-subgraphs
that referenced
this issue
Feb 15, 2024
To calculate the pending legacy Keep rewards [1] it is necessary to know if the stakes are elegible for legacy PRE rewards. To know this, it is necessary to have (again) this subgraph. [1] threshold-network/merkle-distribution#112
This was referenced Feb 20, 2024
manumonti
added a commit
that referenced
this issue
Feb 26, 2024
As this is a cumulative Merkle distribution, the rewards here collected are the sum of the rewards distributed in previous Merkle distributions plus the rewards earned in the period between the last and the current distribution. Note that this is a special distribution, and the date of this distribution is the date of legacy Keep staking transition deadline [1]. This distribution releases the frozen rewards of legacy Keep stakes. As mentioned on #112, the rewards for legacy Keep stakes had been frozen during the legacy staking transition period. Once this period has ended, the rewards have been released: This distribution also includes the "regular" stakes rewards (i.e. the rewards for the stakes that didn't have legacy Keep tokens). - tBTC rewards for those non-legacy stakes for the period Feb 1st 24 - Feb 24th 24. - TACo rewards for those non-legacy stakes for the period Feb 1st 24 - Feb 24th 24. - tBTC rewards for those that had legacy Keep tokens (keepInT) on Nov 22nd 23. The rewards are for the period Nov 22nd 2023 - Feb 24th 2024. The conditions to be eligible for these rewards are: - To have a tBTC client running and complying with the usual requirements: pre_params, uptime, and client version. - To have tokens staked and authorized to the two Threshold apps: Random Beacon and WalletRegistry (aka tBTC). The rewards are calculated from two sources: (a) the `T` tokens staked and authorized to both apps and (b) the `keepInT` tokens if these have been re-staked and re-authorized for both apps during the transition period. - PRE rewards for those that had legacy Keep tokens (keepInT) on Nov 22nd 23. The rewards are for the period Nov 22nd 2023 - Feb 1st 2024 (date of PRE deactivation). The conditions to be eligible for these rewards are: - To have a PRE operator confirmed on Nov 22nd 2023. - To have tokens staked. Staked `T` tokens will be considered for the rewards calculation. Staked `keepInT` tokens will be considered only in the case the stake re-staked it during the transition period. - TACo rewards for the period Feb 1st 2024 - Feb 24th 2024. The condition to be eligible for these rewards are: - To have a TACo operator confirmed. - To have TACo application authorized. This PR closes #95, #112. [1] https://forum.threshold.network/t/transition-guide-for-legacy-stakers/719
All tasks have been finalized. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context
Before the Threshold network emerged, there were Nu and Keep stakers. Up to now, these users have been earning staking rewards. To achieve this, the legacy tokens were accepted in the TokenStaking contract, establishing a conversion between these tokens and the T token through the VendingMachine contract.
These converted tokens have been treated as a special case in the TokenStaking contract, so these were not T tokens, but
nuInT
andkeepInT
tokens. Either way, the staking rewards have been calculated fromnuInT
andkeepInT
values in the same way that the staked T.Since it has been planned to stop supporting these legacy stakers, there was an update on staking contracts, so these tokens
nuInT
andkeepInT
are no longer eligible to earn rewards.This is the tx where this happened:
https://etherscan.io/tx/0x68ddee6b5651d5348a40555b0079b5066d05a63196e3832323afafae0095a656#eventlog
The changes made consisted of the legacy tokens being unstaked. So subgraph queries return 0 stakes with
nuInT
orkeepInT
greater than 0.Also, these tokens
nuInT
andkeepInT
have been used as authorization amount in tBTC and RandomBeacon apps. So, in addition to the unstaking of these tokens, the authorization amount has been decreased. InvoluntaryAuthorizationDecrease events were emitted (see tx logs in Etherscan link above).So, now, the stakers can withdraw their NU/KEEP tokens from the legacy NU/KEEP staking contracts, upgrading them to T and stake resulting T. If they do this before the deadlines, they will receive all the rewards even when there is a transition period in which they didn't be eligible for rewards. The process to achieve this is described here: https://forum.threshold.network/t/transition-guide-for-legacy-stakers/719
Also, see threshold-network/solidity-contracts#141.
Action points
Release a distribution with the rewards earned before unstaking tx: stakes should earn rewards as usual in the period between the last distribution (Nov 1st) and the unstaking tx (Nov 22nd). This requires modifying how the tBTC rewards script captures the authorization events. ✅ Done -> Add support for legacy stakes in tBTC calculations #106 Fix bug: miscalculation in last epoch duration for PRE rewards #107 Add AuthorizationDecreasedRequested support #109 New Merkle Distribution for Nov 22nd 23 #110
Release a partial distribution with the rewards earned between unstaking tx (Nov 22nd) and the next planned release date (Dec 1st). Nov 22nd is the starting date for the transition period (see Transition Guide for Legacy Stakers, so we can't be sure if legacy stakes will earn the full rewards or not (it depends on if they complete the transition process or not). So stakes that had legacy tokens are not going to earn rewards in this short period, and the earned amount will be calculated and distributed in distributions after the transition deadline dates. ✅ Done -> New Merkle Distribution for Dec 1st 23 #111
Dec 8th 2023 distribution: legacy Nu stakers transition rewards #114 Release a distribution that includes legacy Nu stakes. The transition process deadline for legacy Nu stakes ends 7th Dec, so to distribute the rewards earned since Nov 22nd we are going to distribute a rewards batch that will include those earned by
(a) legacy Nu stakes that completed the transition process. The period of these rewards is Nov 22nd to Dec 7th.
(b) stakes that haven't legacy tokens (i.e. regular stakes). The period of these rewards is Dec 1st to Dec 7th. ✅ Done -> New Merkle Distribution for Dec 8th 23 #116 . Rewards' distribution fixed in -> Fix Dec 8th 23 and Jan 1st 24 distributions #122
Release a distribution for Jan 1st. This distribution will include the earnings of the regular stakes for the period Dec 7th to Jan 1st. This distribution will not include legacy Keep earnings. ✅ Done -> New Merkle Distribution for Jan 1st 24 #118 . Rewards' distribution fixed in -> Fix Dec 8th 23 and Jan 1st 24 distributions #122
Release a distribution for Feb 1st. This distribution will include the earnings of the regular stakes for the period Jan 1st to Feb 1st. This distribution will include legacy Keep earnings for those stakes that, at this time, have finalized the transition process. ✅ Done -> New Merkle Distribution for Feb 1st 24 #128 Fix Feb 1st 24 distribution #129
Release a partial distribution with earnings before Keep transition deadline. This distribution will include:
(a) the rewards for the period Feb 1st to Feb 23rd of regular stakes (no legacy stakes).
(b) the rewards earned by legacy Keep stakes for the period Nov 22nd (unstaking tx) to Feb 23rd. Only those legacy Keep stakes that completed the transition process are eligible for rewards. Note: check if the amount of T that the legacy staker have topped up and authorized is the same that it was unstaked/deauthorized. If the staker authorize a lower amount, the earned rewards must be lower also. ✅ Done -> Add calculation script for special distribution: legacy Keep stakes rewards #137 New Merkle distribution for Feb 24th 23 #138
Release a regular distribution with earnings after Keep transition deadline. This distribution will include the rewards for the period Feb 23rd to Mar 1st for all stakes. The legacy stake transition process has been completed, so the following distributions don't need to have special rules for them. ✅ Done -> Remove legacy keep calculations #139 New Merkle distribution for Mar 1st 24 #140
Additional work
The text was updated successfully, but these errors were encountered: