Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

aHYPE Contract Logic

Supply Accounting

getERC20Supply() = circulating αHYPE + queued withdrawal balance
 
getUnderlyingSupply() = total HYPE backing
                      - queued deposits
                      - queued withdrawals
                      - accrued fees

Fee Structure

Fee TypeRateApplication
Mint Fee0.1% (10 BPS)Applied when minting αHYPE
Burn Fee0.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 exceeded

Withdrawal Flow

User calls withdraw(amount) ──► αHYPE burned ──► WithdrawalRequest queued


                               Price snapshot locked
                               (slashing protection)


                             processQueues() settles


                         User calls claimWithdrawal()


                              HYPE transferred

Queue Processing

processQueues() executes once per block and:

  1. Revalidates solvency by comparing EVM holdings to owed withdrawals
  2. Reads HyperCore state via L1Read.delegatorSummary and L1Read.spotBalance
  3. Prices deposits and withdrawals using high-precision ratios
  4. Mints αHYPE minus mint fee for deposits
  5. Settles withdrawal requests when liquidity exists
  6. 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

RoleCapabilities
OwnerConfigure maxSupply, minDepositAmount, processor; harvest fees
ProcessorExecute processQueues() once per block (if set)
UsersDeposit 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

VariableTypeDescription
validatoraddressTarget validator for delegation
hypeTokenIndexuint64HYPE token index on Hyperliquid
depositQueueDepositRequest[]Pending deposits (max 100)
pendingWithdrawalQueueWithdrawalRequest[]Pending withdrawals
pendingDepositAmountuint256Total unprocessed deposit HYPE
withdrawalAmountuint256Total pending withdrawal αHYPE
owedUnderlyingAmountsmapping(address => uint256)HYPE owed per user
feeAmountuint256Accumulated protocol fees
maxSupplyuint64Optional supply cap (0 = none)
processoraddressDesignated processor (optional)
minDepositAmountuint256Minimum deposit threshold
lastProcessedBlockuint256One-per-block guard