Ending a stake

I see quite some confusion among Hexicans on how to end a stake. One would expect this to be the easiest and most comprehensible contract function, yet it appears guidance is needed. Ending a stake is one of several aspects that makes the HEX blockchain certificate of deposit technically different from bank certificates of deposits you may have used in the past.

Just like any interaction with the HEX smart contract, ending a stake is performed trough any of the several HEX contract frontends.

Smart contracts have no automatism

First of all, one needs to understand the basics on how blockchain technology and smart contracts work. What is most relevant here, is understanding that a smart contract is just code written on the blockchain. This code does nothing unless someone calls it using a blockchain network transaction. Therefore, the stake can’t end by itself. Someone needs to pay the Ethereum network miners a fee to run the code and reach consensus on the outcome.

In the HEX contract, there are two options on who can do this. The stake owner is the only one who can mint HEX by ending a stake at any point, either using the Emergency End Stake (EES) function when the stake is not yet mature, or the End Stake (ES) function when the stake is mature. Both functions are actually the same contract call. The difference is only in stake maturity. This call requires the same key that created the stake in the first place.

Meanwhile, anyone can run a Good Accounting (GA) contract call, as any ethereum network key can do that, however this function does not mint coins and only applies to mature stakes.

A mature stake will not accrue any more interest after the maturation day, regardless when and how it is concluded.

Emergency End Stake (EES)

Never break your contract obligations! This general rule is good for any contract you have ever signed in your life, but is particularly true for smart contracts, because these are self enforcing. The penalty for doing EES can be up to 100% of the stake, depending on how far the stake is from maturity, and how much interest it accrued in relation to the principal.

The EES function mimics the penalties one has to pay when breaking the legacy certificate of deposit contract at a bank. The difference is that the penalties for breaking the HEX contract early are extreme. However, at the end of the day, half of the penalty is credited to the staker class as interest, while the other half is minted into circulation trough the Origin Address. The immediate minting increases the inflation basis, thus again rewarding the staker class, but this indirect effect rewards also any new stakers, not just the ones staked on the day of EES.

As a rule of thumb, a stake can be 100% penalized (nuked) when the EES is performed on a short stake (less than 180 days), or in the first half of any stake length, or on a stake that received a huge interest in the first half of its length, such as the BPD bonus interest. For more details, consult The HEX Contract in Layman’s Terms, or the Hex.wiki website, or best of all, let the Staker.app calculate the penalty for you.

Sometimes using EES may actually be reasonable. A lot of Hexicans applied EES a few days before BigPayDay (BPD) to their stakes set to mature just after it. This way they paid a minimal penalty, but could restake longer just before BPD to receive more shares and thus a higher BPD bonus interest, as well as a higher interest in general due to a higher share ratio and longer staking.

Otherwise, EES is commonly performed by stakers who can’t handle the frustration from volatility, or from “fear, uncertainty and doubt” (FUD). When price pumps or dumps, or someone creates FUD, a lot of so called weak hands decide to EES, sometimes even nuking the stakes. In such periods, the interest can rise substantially. This makes HEX the first cryptocurrency that may be profitable during fast price depreciations.

EES is not available for autostaked HEX freeclaimed from a Bitcoin address.

EES warning on the go.hex.com contract frontend.

End Stake (ES)

End stake (ES) is the proper way to conclude a stake. Once a stake matures, the stake owner has 14 days to conclude it without any penalties. Ending the stake can be done later too, but then late end stake penalty applies. Running ES burns HEX shares, and then mints the principal with the interest directly into the Ethereum network address that held the stake.

There is no custody in HEX, as one stakes and mints to the same address with its key: Do not lose your keys! No keys, no stake.

Good Accounting (GA)

There may be reasons one may want to mint HEX at some later time without paying the late end stake penalty. Good Accounting (GA) burns shares of a mature stake and thus prevents penalization. HEX can be minted any time later with the ES contract call.

This may be useful in some jurisdictions where minting coins is subject to taxation. It may be used for postponing the minting to the next taxation year.

But clearly the most useful aspect of GA is the ability to burn shares of any mature stake by anyone, not just the stake owner. This may be useful in some situations when the stake owner can’t get ahold of his key on time. The stake owner could also not have access to the network and can ask someone else to run GA for them.

GA is also useful to collect the late end stake penalties from expiring stakes (the backuphex.com HEX frontend offers an easy way to run GA on any expiring stake). For example, someone with a significant share ratio may be incentivized to run GA on expiring stakes on the day before their stakes mature in order to collect their share of penalties. Even though a network fee needs to be paid, it is certainly quite profitable for HEX sharks and whales to do so.

Late end stake penalty

All active stakes have HEX shares assigned to them. Shares are a crucial element of HEX fundamentals, as all interest is based on them. They literally are shares of the staking system in the sense that all interest is credited daily to a stake based solely on its share ratio (the ratio between the shares in a stake and the total shares in the system).

When a new stake is launched, the contract burns the staked HEX (principal) and at the same time creates shares to be locked in the stake. These shares are then burned when either ES, EES, or GA is applied. This is very important for the staker class, because due to lack of automatism, a mature stake still holds its shares embezzled. While shares in a mature stake do not accrue interest anymore, they reduce the share ratio of every other stake in the system by keeping the total shares inflated.

To prevent stakers from embezzling shares and reducing interest to other stakers by not ending a stake when they signed they would, the contract enforces a late endstake penalty. After two weeks of grace period, a penalty is applied that causes the expiring stake to bleed for 1% each week (0.143% per day). This means that after 2 years the penalty takes the entire stake. This penalty is only distributed once the stake owner runs ES, or anyone runs GA on it. Similarly to EES, half of late end stake penalty is then distributed to the staker class, while the other half is immediately minted in circulation trough the Origin Address.

Network fees

Ending a stake by any method requires significantly more gas than creating one, as it is much more computationally intensive. Miners need to calculate the accrued interest for each day up to maturation. Consequently, the longer the stake, the more gas is consumed to conclude it.

The HEX contract runs on the Ethereum network which is still in development and thus not yet scalable on its base level. This means it has periods of high congestion, particularly when crypto markets are in bull run. Gas price is auction based, which means the users will offer higher gas fees in times of congestion, because miners prioritize transactions with higher fees.

A staker has two weeks to end a stake, so generally there is no particular hurry to end the stake immediately. The network fee can therefore be reduced by using a lower gas price and letting the transaction pend for a day or more. Because the network congestion varies strongly from hour to hour, it easily happens that an ES transaction gets approved overnight even at the lowest gas price. In case your transaction does not get approved in time, you will have to speed it up.

You can use the gas information on hex.vision to estimate the lowest still functional gas price. Edit only the gas price before approving the transaction and do not modify the gas limit. The unused gas is returned to you anyway, but the transaction will fail when the gas limit is set lower than what is needed. Nevertheless, the miners will take the fee for the computation they performed before running out of gas.

By abit_Hex

.

By @Benzenoid

Disclaimer: None of the above is meant to be a financial advice. Never rely on a single source of information and do your own research before any investment. Don’t trust, verify!

If you found any of the above useful and want to give a tip, please use the Ethereum address: 0x4BaE10B7B20A4f92670f03474dbDD6716D2C143f

24 Replies to “Ending a stake”

  1. hey there. I staked a bunch of HEX in the 3 weeks before the BPD in November 2020. my stakes varied from 12 months up to 6 years in length. With (considerable sized stakes) at 1, 2, 3, 5 & 6 years respectively. The stakes at 1, 2 & 3 years when they naturally End Stake – I’d love to re-stake them for longer – although I’m confused by this, what it means, is it too late ? I think I can keep the interest & restake the principal again ?. Is that true. although I’m still confused how this works and if I stuffed it up back in November 2020 ?? etc etc. would love some help and clarity from any hexicans out there. thank you so much. ))

    1. Hi James!
      After your stakes mature and you mint your coins, you can do with them whatever you want: sell, hodl, and/or stake. You can stake part of them and sell the rest, for example. I also have some stakes that will mature next year and plan to restake them, though I may sell some of the interest, if HEX will be overbought. Otherwise, I will keep restaking until use case adoption is achieved.
      I suggest you use Staker.app to monitor your stakes. It is an amazing app created by two community members that allows monitoring stakes, contract and market info, and it also calculates the penalties. If you have specific questions, I recommend the @HEXcrypto group on Telegram, where you can always find hexperts willing to help (just block anyone that direct messages you, or groups you get added to – Telegram abounds with scammers).

  2. Hi man,
    How do I go about good accounting for my son, he is away at work, and he forgot to bring his PC along. I cant reach his PC either.

    1. Hi Anders, the simplest way is to use the backuphex.com frontend which gives you the option to do Good accounting for any address. Find your son’s address among the late stakes and run the contract call.

  3. Hi Hexicans. Now that I am ending the first stakes, there is a little confusion at my end.

    The Gas fee is very high on smaller stakes. EG an end stake of about 10,000 Hex is about $10.
    But to end one about 30,000 Hex is about $6.

    Am I missing something?

    Please point me towards a guide on ending stakes or smart accounting if there is one.

    1. HEX minting is done the same way as BTC or fiat money (different technology, but same concept). The difference is in who does the minting. In HEX the minting is done by the staker class (in BTC the minting is done by bitcoin miners; in fiat the minting is done by the banks licensed by a central bank). Another lesser difference is that in BTC the circulating supply is inflationary for the next century, while HEX can be inflationary or deflationary (as the staker class decides). For comparison between fiat monetary policy and HEX, see also https://hexicans.info/decentral
      For HEX tokenomics, see https://hexicans.info/hexonomics

  4. Hi Benzenoid,
    Thank you for the detailed info. Where did you get the data for that chart titled “End Stake Gas Cost by Served Days”? If that linear trend continues it is quite concerning to me, because for a 15-year stake (5,478 days) the gas cost would end up being 5,767,972. If a 15-year stake ended today (February 7, 2021) with a conservative low gas price of about 100 GWEI, it comes out to about 0.57 ETH. Based on today’s conversion rates that’s about $900 USD or 92,000 HEX. In other words, if your principal stake plus interest is less than 92k HEX, you’ll have a net loss.

    I know we’re currently in a bull crypto market so gas prices are particularly high. Gas prices were about 10x less a year ago. If we return to that then the above estimates to end a 15-year stake would be much more reasonable. But since you only have 2 weeks to end a stake before being penalized, you can’t wait too long for gas prices to change. If your stake ends in the middle of a bull run then you’re kinda screwed.

    1. That graph was made by Firebun, one of the two developers of the Staker app. He took actual on-chain data and used them for the linear regression, so it is as accurate as it gets.

      I wouldn’t worry about fees in stakes longer than 3 years. If Ethereum network scalability will not be solved by then, then the HEX community would be forced to migrate the contract state to another network. To be avoided, but may be unavoidable. But more realistically, the scalability will be solved by Ethereum 2.0 and the gas price of 1 gwei should work just fine. At 1 gwei even 5555 days stakes will not be expensive to end. Meanwhile, ending stakes during the bull market of 2021 will continue to be expensive. It is particularly painful, because in the beginning of 2020 a gas price of as low as 1 gwei could get trough, so people didn’t consider the risk of making small stakes.

      The lesson learned is to only create stakes of size and length comparable to the real world certificates of deposit that one would buy in a bank.

  5. I’m very new and am trying to figure a few things out. I needed to end my stake. I originally staked through MetaMask to go.hex.com. Once I ended the stake, from what I understand it should go back to the same address used to stake, but I am not seeing it show back up. I see the transaction on Etherscan from the tokens going to the right address I sent from, but I do not see the HEX in the account. It shows the amount of tokens in the transaction but nothing in my account.

    1. In HEX, staking doesn’t involve counterparties and custody which means that your staking data is all on your staking address. Consequently, end stake contract calls mint HEX directly to your address after it burns the shares. If you don’t see the coins in your wallet, then the most common problem is not having added the token visibility (in Metamask you use the add token function). Another possibility is that you nuked your stake. If you break your contract obligations, you get penalized. If you break it real bad, like emergency end staking a fresh stake, the penalty can be 100% of the stake. In this case you don’t mint the coins to your address, but you redistribute them instead.

      If you want someone to analyse the transaction, you can ask in the @HEXcrypto Telegram group. There are always helpful people there, but block&report anyone that direct messages you (if you are new to Telegram, you should know that only scammers direct message people – only seek support in publicly reviewed chats!).

  6. Hi I need some help to understand what happened! I unfortunately decided to end my stake a few months ago. I thought I was doing everything accordingly to get my money back ( penalties included). But once I’ve finished the transaction it’s showing on Etherscan that still needs more than 11 millions of confirmations… So now I don’t know if I was totally penalised and I lost my entire HEX or if is just a matter of waiting for +3 years to get the transaction confirmation due the extreme low Gas fee that was set when I ended the stake ( my newbie mistake to not check properly the Gas fees )… If you could help me on that… I know I made a huge mistake to end my stake of 5 years in less than 30 days but anyway I don’t know where am I now… Maybe I lost everything but I really don’t know! Thanks for your support! Nice blog great stuff here!

    1. Hi Illustrader. I suggest you ask someone to check your transaction on etherscan. Try in the Telegram group https://t.me/HEXcrypto (block&report any direct messages in Telegram!).
      However, if you emergency endstaked a 5 year deposit after just 30 days, then it is likely you nuked it all. That is one insane breakage of the contract obligation – I’m pretty sure this is 100% penalized.

      Highly unlikely, but you may have been lucky and you underbid the gas price and the transaction is still pending. Check etherscan and if this is the case you need to cancel it immediately.

      You should never sign contract obligations you know you can’t hold, no matter if it is paper or blockchain contract. A blockchain contract is self-enforcing, so even much worse, as you immediately punish yourself by breaking it. There’s no way to game it like you can game a paper contract. Keep in mind you can enjoy the price appreciation of HEX without staking – you don’t get any interest, but at least you are safe from penalizing yourself.

  7. Hi there,

    Apologies if this is not the best place to post this, but I’m quite desperate. Still, if there is a better place to post this, could you please tell me so? Thank you.

    I’ve lost my secret phrase from my metamask account…. and I’ve lost access to my stake in the hex platform. Is there any other possible way to access such staking, such platform, and hence retrieve my staked coins by sending them to any other interface?

    Any help will be more than welcomed.

    Thanks and, again, apologies if this is not the right place for this post.

    1. Hi Ferran
      When one loses the seed phrase (secret phrase) and the keys themselves, that means one lost access to the address on the blockchain database. In other words, the crypto on that address is lost for everyone for ever. See https://hexicans.info/help

      There is no “HEX platform” – staking in HEX is trustless which means that you burn the coins and you mint the coins using your keys. Unfortunatelly for you in this case, there’s no counterparty in HEX – by design. I’m sorry to hear about your loss, but make sure you searched well for your paper wallet. I find it hard one can just lose something so important. Hopefully you find it one day.

  8. Hi there, I ended a hex stake last night.
    My Metamask wallet was linked.
    I ended the stake but still haven’t received my hex into my MM wallet. Is this normal? I can see the transaction on etherscan. Any thoughts?

    1. Hi Dylan
      If you can see the transaction on etherscan, then your coins are in your address. However, Metamask has this annoying feature that one needs to “Add token” to make a particular token visible.

  9. Thank you for a very informative article. I just staked for the 3rd time. You write about ‘needing to access your key’. I was not aware that I needed to keep track of my keys. Gosh, I hope I have not screwed up.

  10. Is it possible to relink my hex staking if I believe my MetaMask has been hacked?

    Could I recreate a MetaMask account and link my hex stake to it?

    1. Hi Dermot
      If by Metamask being hacked, you mean you got your seed phrase or keys compromised, there’s nothing that can be done to reverse that. The reason is in that seed phrase = set of keys = your crypto. Read https://hexicans.info/help to understand why.

      I suggest you join @HEXsecurity at Telegram and ask the expert members there to provide you a strategy on how to deal with it. All is not necessarily lost. On Telegram you need to block&report anyone that direct messages you – only communicate under public supervision (general rule for all social media when it comes to crypto).

  11. Is the formula for calculating end stake gas fees “1039 x # of days staked + 75,551 = gas used”
    Do we know how often the SLOAD function is called during an end stake? Is it once per day? The above formula appears to be an estimate based on a number of end stakes but i wonder if there is a more precise method.

    1. Hi Crypto Crazy
      Unfortunatelly, that equation was made invalid by the Berlin fork. I was working on an update to address the new gas consumption after the SLOAD gas cost was increased, but then never finished being busy with life and stuff. Meanwhile, just the short answer:

      The new post-Berlin equation is gas_consumption = 2310 × days_staked + 53694

      The SLOAD function is called once per every staked day (the contract iterates the interest equation trough the entire staking period).

      The only more precise method would be to run the contract code itself, but the linear regression of executed endstake transactions is actually pretty much as precise as it can get.

Leave a Reply

Your email address will not be published. Required fields are marked *