aHYPE Contract Logic
Supply Accounting
getERC20Supply() = circulating αHYPE + queued withdrawal balance
getUnderlyingSupply() = total HYPE backing
- queued deposits
- queued withdrawals
- accrued feesFee Structure
| Fee Type | Rate | Application |
|---|---|---|
| Mint Fee | 0.1% (10 BPS) | Applied when minting αHYPE |
| Burn Fee | 0.1% (10 BPS) | Applied when burning αHYPE |
Fees accumulate on the contract and can be harvested by the owner via collectFees().
Operational Flow
Deposit Flow
User sends HYPE ──► Deposit queued ──► processQueues() ──► αHYPE minted
│
▼
Validation:
- msg.value >= minDepositAmount
- Amount is multiple of 10^10 wei
- Queue length < 100
- maxSupply not exceededWithdrawal Flow
User calls withdraw(amount) ──► αHYPE burned ──► WithdrawalRequest queued
│
▼
Price snapshot locked
(slashing protection)
│
▼
processQueues() settles
│
▼
User calls claimWithdrawal()
│
▼
HYPE transferredQueue Processing
processQueues() executes once per block and:
- Revalidates solvency by comparing EVM holdings to owed withdrawals
- Reads HyperCore state via
L1Read.delegatorSummaryandL1Read.spotBalance - Prices deposits and withdrawals using high-precision ratios
- Mints
αHYPEminus mint fee for deposits - Settles withdrawal requests when liquidity exists
- Balances liquidity by:
- Bridging HYPE from spot if EVM liquidity is short
- Withdrawing/undelegating from staking
- Re-deploying idle HYPE to staking when queues are clear
Roles & Permissions
| Role | Capabilities |
|---|---|
| Owner | Configure maxSupply, minDepositAmount, processor; harvest fees |
| Processor | Execute processQueues() once per block (if set) |
| Users | Deposit HYPE, request withdrawals, claim HYPE |
Constants
uint256 constant FEE_BPS = 10; // 0.1%
uint256 constant BPS_DENOMINATOR = 10_000;
uint256 constant SCALE_18_TO_8 = 1e10;
address constant HYPE_SYSTEM_ADDRESS = 0x2222222222222222222222222222222222222222;Storage Layout
Structs
struct DepositRequest {
address depositor;
uint256 amount;
}
struct WithdrawalRequest {
address withdrawer;
uint256 amount;
uint256 pricePerTokenX18; // Snapshot for slashing protection
}State Variables
| Variable | Type | Description |
|---|---|---|
validator | address | Target validator for delegation |
hypeTokenIndex | uint64 | HYPE token index on Hyperliquid |
depositQueue | DepositRequest[] | Pending deposits (max 100) |
pendingWithdrawalQueue | WithdrawalRequest[] | Pending withdrawals |
pendingDepositAmount | uint256 | Total unprocessed deposit HYPE |
withdrawalAmount | uint256 | Total pending withdrawal αHYPE |
owedUnderlyingAmounts | mapping(address => uint256) | HYPE owed per user |
feeAmount | uint256 | Accumulated protocol fees |
maxSupply | uint64 | Optional supply cap (0 = none) |
processor | address | Designated processor (optional) |
minDepositAmount | uint256 | Minimum deposit threshold |
lastProcessedBlock | uint256 | One-per-block guard |
