aHYPE Contract Interface
Complete API reference for the AlphaHYPEManager contract.
Initialization
initialize
Initializes the upgradeable contract. Must be called immediately after deployment.
function initialize(address validator, uint64 hypeTokenIndex) external initializer| Name | Type | Description |
|---|---|---|
validator | address | Target validator address for HYPE delegation |
hypeTokenIndex | uint64 | HYPE token index on Hyperliquid Spot |
Access: Can only be called once during proxy deployment.
User Functions
receive (Deposit)
Deposit native HYPE to queue for αHYPE minting.
receive() external payablemsg.value >= minDepositAmountmsg.valuemust be a multiple of10^10wei (8-decimal alignment)- Deposit queue length < 100
- If
maxSupply > 0, minting must not exceed cap
Emits: DepositQueued(address indexed depositor, uint256 amount)
withdraw
Request withdrawal of αHYPE tokens for underlying HYPE.
function withdraw(uint256 amount) external nonReentrant| Name | Type | Description |
|---|---|---|
amount | uint256 | Amount of αHYPE to withdraw |
- Caller must have sufficient αHYPE balance
- Withdrawal queue length < 100
- Burns αHYPE immediately
- Locks current exchange rate snapshot for slashing protection
- Queues
WithdrawalRequestfor processing
Emits: WithdrawalQueued(address indexed withdrawer, uint256 wrappedAmount)
claimWithdrawal
Claim processed HYPE after withdrawal has been settled.
function claimWithdrawal() external nonReentrant- Caller must have non-zero
owedUnderlyingAmounts[msg.sender]
- Transfers owed HYPE to caller (scaled back to 18 decimals)
- Zeros owed amount before transfer (reentrancy protection)
Emits: WithdrawalClaimed(address indexed withdrawer, uint256 amount)
Processing Functions
processQueues
Process pending deposits and withdrawals. Can be called once per block.
function processQueues() external nonReentrant- If
processoris set: only callable by processor - If
processoris zero address: callable by anyone
block.number > lastProcessedBlock
- Validates solvency against EVM holdings
- Reads HyperCore state (delegator summary, spot balance)
- Calculates deposit/withdrawal prices
- Processes deposit queue (mints αHYPE minus fee)
- Processes withdrawal queue when liquidity permits
- Balances liquidity across EVM/Spot/Staking
Emits: Multiple events depending on operations performed
Admin Functions
setMaxSupply
Set the maximum αHYPE supply cap.
function setMaxSupply(uint64 _maxSupply) external onlyOwner| Name | Type | Description |
|---|---|---|
_maxSupply | uint64 | Maximum supply cap (0 = no cap) |
Access: Owner only
setMinDepositAmount
Set the minimum deposit amount.
function setMinDepositAmount(uint256 _minDepositAmount) external onlyOwner| Name | Type | Description |
|---|---|---|
_minDepositAmount | uint256 | Minimum deposit in wei |
Access: Owner only
setProcessor
Set the designated processor address.
function setProcessor(address _processor) external onlyOwner| Name | Type | Description |
|---|---|---|
_processor | address | Processor address (zero = permissionless) |
Access: Owner only
collectFees
Withdraw accumulated protocol fees.
function collectFees() external onlyOwner nonReentrant- Transfers accumulated
feeAmountto owner - Zeros
feeAmountbefore transfer
Access: Owner only
View Functions
getERC20Supply
Get total αHYPE supply including queued withdrawals.
function getERC20Supply() public view returns (uint256)Returns: totalSupply() + withdrawalAmount
getUnderlyingSupply
Get total HYPE backing available for price calculation.
function getUnderlyingSupply() public view returns (uint256)Returns: Combined HYPE from:
- EVM balance (scaled to 8 decimals)
- Delegated stake
- Undelegated stake
- Pending withdrawals from staking
- Spot holdings
Minus:
pendingDepositAmountwithdrawalAmountfeeAmountowedUnderlyingAmount
decimals
Get token decimals.
function decimals() public pure override returns (uint8)Returns: 8
pendingDepositQueueLength
Get number of pending deposits.
function pendingDepositQueueLength() external view returns (uint256)Returns: Length of depositQueue
pendingWithdrawalQueueLength
Get number of pending withdrawals.
function pendingWithdrawalQueueLength() external view returns (uint256)Returns: Length of pendingWithdrawalQueue
Inherited ERC20 Functions
Standard ERC20 functions inherited from OpenZeppelin:
| Function | Description |
|---|---|
name() | Returns "Alpha HYPE" |
symbol() | Returns "αHYPE" |
totalSupply() | Total minted αHYPE |
balanceOf(address) | αHYPE balance of address |
transfer(address, uint256) | Transfer αHYPE |
approve(address, uint256) | Approve spender |
transferFrom(address, address, uint256) | Transfer from approved |
allowance(address, address) | Check allowance |
burn(uint256) | Burn own αHYPE |
burnFrom(address, uint256) | Burn from approved |
Error Conditions
| Error | Condition |
|---|---|
InvalidDepositAmount | Deposit below minimum or not aligned |
QueueFull | Queue exceeds 100 entries |
MaxSupplyExceeded | Minting would exceed supply cap |
InsufficientBalance | Caller lacks αHYPE for withdrawal |
NothingToClaim | No owed HYPE to claim |
AlreadyProcessed | Queue already processed this block |
UnauthorizedProcessor | Non-processor called processQueues |
