Integrate
How to integrate staking and unstaking stHYPE on your frontend or from smart contracts.
Last updated
How to integrate staking and unstaking stHYPE on your frontend or from smart contracts.
Last updated
If you are a DeFi protocol interacting with StakedHYPE contracts, PLEASE familiarize yourself with the between stHYPE/wstHYPE.
Send a transaction to the overseer with the function signature mint(address to, uint256 communityCode)(uint256)
, which returns the amount of StakedHYPE (as of right now this will always be the same amount as minted). There is also another function signature mint(address to)
that is callable if you do not have a community code to stake to. The to
address is the address the stHYPE tokens will be minted to and the communityCode
is the code representing the validator you want those tokens to be designated too. The amount minted will be the amount of HYPE included in the value of the transaction. There is no onchain Community Code validation - please ensure you are using the right one.
This will mint stHYPE to the user.
These will be whitelisted in a public, transparent offchain indexer for governance approved validators. This index was originally onchain prior to the Hyperliquid gas/s updates.
These are passed as a param to the staking and unstaking functions in order to track HYPE flow and rewards throughout the ecosystem.
Burning is has the potential to be a multistep process depending on the amount of free (unstaked) tokens available in the protocol. There will typically always be a small float of the total supply unstaked in order to instantly fulfill burns, but if it is the burn of a large amount of tokens or there is high outflow volume steps become a two-step process. You can access the amount of free tokens (if a burn has less than this amount it will be processed atomically) by calling maxRedeemable()
Approve the overseer with the amount of stHYPE tokens that you want to unstake.
Call burnAndRedeemIfPossible(address to, uint256 amount, string communityCode)
to burn amount
of tokens from communityCode
the redeemed HYPE will go to the to
address. Note: if you do not want to burn from a community code leave the field a blank string (""). maxRedeemable()
of these tokens will be burned instantly and sent to the to
address, and the rest will be processed in a burn request. This function returns the burnID
which will be used to redeem the burn once it has been finished.
If this was a large burn or there was not enough tokens, wait some time until redeemable(uint256 burnID
is true
Call redeem(uint256 burnID)
which will send the pending HYPE to the to
address specified in the previous transaction