A comprehensive guide for developers looking to integrate beHYPE staking and unstaking functionality into their applications.
Overview
beHYPE is a liquid staking token that represents staked HYPE tokens. Users can stake HYPE to receive beHYPE tokens, which continue to earn staking rewards while remaining liquid and transferable.
Send a transaction to the StakingCore contract with the function signature stake(string communityCode). The communityCode is the validator name you want those tokens to be designated to. The amount minted will be the amount of HYPE included in the value of the transaction. If you do not have a specific validator to stake to, you can pass an empty string ("") for automatic distribution across validators.
This will mint beHYPE tokens to the caller's address.
functionStake()public{address user =address(0x1234); vm.deal(user,10ether); vm.startPrank(user);// using the private key of the user// Stake 10 HYPE to a specific validator stakingCore.stake{value:10ether}("validator_name");// Stake another 10 HYPE with automatic validator distribution stakingCore.stake{value:10ether}("");}
Community Codes
All active set validators (Excluding foundation nodes) are eligible to receive stake from beHYPE. Anyone can select their preferred validator to receive their stake. If you don't specify a validator (empty string), the stake will be automatically distributed across active validators.
Burning (Unstaking)
Burning is a multistep process that depends on the amount of free (unstaked) tokens available in the protocol. There will typically always be a small float of the total supply unstaked to instantly fulfill burns, but for large amounts or high outflow volume, it becomes a two-step process.
Step 1: Approve the WithdrawManager contract with the amount of beHYPE tokens you want to unstake.
Step 2: Call withdraw(uint256 beHypeAmount, bool instant, uint256 minAmountOut) to burn beHypeAmount of tokens. The redeemed HYPE will be processed based on the instant parameter:
instant = false: Normal withdrawal (7-day processing, no fee)
The minAmountOut parameter provides slippage protection. This function returns a withdrawalId which will be used to claim the withdrawal once processed.
Step 3: For normal withdrawals, wait for processing time, then call claimWithdrawal(uint256 withdrawalId) to receive your HYPE tokens.
Instant Redemption
For immediate access to HYPE, you can use instant redemption with a 0.5% fee:
API Endpoints
Base URL
Available Endpoints
Get beHYPE Balance
GET /balance/{user_address}
Returns user's beHYPE balance
Get Exchange Ratio Updates
GET /exchange-ratio-update
Returns latest exchange ratio between beHYPE and HYPE
Get TVL Data
GET /tvl
Returns total value locked, exchange ratio, and price information
Function Signatures
StakingCore Contract
WithdrawManager Contract
BeHYPE Token Contract (ERC20)
Support
For additional support or questions about beHYPE integration, ask us on discord or contact the development team.