LHYPE Builder Codes

Integrate LHYPE into your app to acquire users and earn fees

Product Overview

LoopedHYPE (LHYPE) is a yield‑optimizing protocol that loops staking positions on HYPE tokens. Integrators earn fees for every deposit bridged through their unique community code. Users deposit HYPE (native) or HYPE staking tokens (WHYPE, STHYPE, KHYPE) and receive LHYPE tokens that accrue yield over time.

Key benefits:

  • Maximized yield via automated looping strategies

  • Revenue sharing through communityCode attribution

  • Composable token compatible with DeFi platforms

If you plan to integrate LHYPE, get in touch with the Looping Collective team on Telegram @loopingcollective to further discuss reward options.

Contract Addresses

Contract
Address
Description

LHYPE (ERC-20)

The ERC20 token and the BoringVault contract that custodies the underlying HYPE and staking positions.

Accountant

Returns current exchange rate for LHYPE ↔ HYPE derivatives

Depositor

Entry point for all deposit operations

Atomic Queue

Manages the withdrawal request queue

Contract
Address
Description

WHYPE (ERC‑20)

Wrapped HYPE token

STHYPE (ERC‑20)

Staked HYPE Liquid Staking Token

KHYPE (ERC‑20)

Kinetica HYPE Liquid Staking Token

Deposit Flow

Native HYPE Deposit

To accept native HYPE, call the depositNative function on the Depositor contract:

const minimumMint = getQuote(AMOUNT, WHYPE)

const cc = encodeBytes(COMMUNITY_CODE ?? '')

const args = [AMOUNT, minimumMint, ADDRESS, cc]

const writeContractProps = {
    contractAddress: DEPOSIT_CONTRACT,
    accountAddress: ADDRESS,
    value: BigInt(depositAmount),
    abi: DEPOSIT_CONTRACT_ABI as Abi,
    functionName: 'depositNative',
    args,
    gasLimit: 215000n,
}
Parameter
Type
Description

depositAmount

uint256

Amount of native HYPE to deposit

minimumMint

uint256

Minimum LHYPE shares to mint, reverts if minimumMint is too high (not enough slippage deduced from: depositAmount / rate)

to

address

Address to receive minted LHYPE

communityCode

bytes32

Byte‑encoded integrator code

ERC‑20 Deposits (WHYPE, STHYPE, KHYPE)

For wrapped or staked HYPE tokens, approve and then call deposit:

LHYPE.approve(DEPOSIT_CONTRACT, AMOUNT);
const minimumMint = getQuote(AMOUNT, TOKEN_ADDRESS)

const cc = encodeBytes(COMMUNITY_CODE ?? '')

const args = [TOKEN_ADDRESS, AMOUNT, minimumMint, ADDRESS, cc]

const writeContractProps = {
    contractAddress: DEPOSIT_CONTRACT,
    accountAddress: ADDRESS,
    value: 0n,
    abi: DEPOSIT_CONTRACT_ABI,
    functionName: 'deposit',
    args,
    gasLimit: 300000n,
}
Parameter
Type
Description

depositAsset

address

ERC‑20 token to deposit (wHYPE | stHYPE | kHYPE)

depositAmount

uint256

Amount of token to deposit

minimumMint

uint256

Minimum LHYPE shares to mint, reverts if minimumMint is too high (not enough slippage deduced from: depositAmount / rate)

to

address

Address to receive minted LHYPE

communityCode

bytes32

Byte‑encoded integrator code

Minimum Mint Calculation

Compute the minimum number of LHYPE shares to mint, factoring in slippage.

If the calculated minimumMint is too high, the deposit call will fail.

const maxSlippage = 0.000001
const quote = new BigNumber(AMOUNT)
    .times(new BigNumber(1 - maxSlippage))
    .div(LHYPE_EXCHANGE_RATE)
  • LHYPE_EXCHANGE_RATE is fetched via Accountant.getRateInQuote(assetAddress).

  • maxSlippage defines your worst acceptable deviation.

Exchange Rate & Swap vs Mint

Before depositing, you may choose between swapping on a DEX or depositing natively:

const rate = accountant.getRateInQuote(WHYPE);

Decide based on:

  1. Order size (large orders may incur DEX price impact)

  2. Market rate vs native rate (if on-chain swap is cheaper)

Withdrawal Flow

Requesting a Withdrawal

To request a withdrawal from LHYPE into HYPE derivatives (STHYPE or KHYPE), use the Atomic Queue:

LHYPE.approve(ATOMIC_QUEUE_CONTRACT, AMOUNT);
const threeDays = 5 * DAY_IN_SECONDS
const deadline = Math.floor(Date.now() / 1000) + threeDays
const atomicPrice = new BigNumber(1 - MAX_SLIPPAGE).times(LHYPE_EXCHANGE_RATE)

const args = [
    LHYPE,
    STHYPE,
    [deadline, ATOMIC_PRICE, AMOUNT, false],
]

const writeContractProps: WriteContractProps = {
    contractAddress: ATOMIC_QUEUE_CONTRACT,
    accountAddress: ADDRESS,
    value: 0n,
    abi: ATOMIC_QUEUE_CONTRACT_ABI,
    functionName: 'updateAtomicRequest',
    args,
    gasLimit: 40000n,
}
Parameter
Type
Description

offer

address

Asset to withdraw from (LHYPE)

want

address

Desired asset (STHYPE or KHYPE)

deadline

uint64

Unix timestamp after which the request expires

atomicPrice

uint88

Solver price quote

offerAmount

uint96

Amount of LHYPE to redeem

inSolve

bool

Used during solves to prevent duplicate users, and to prevent redoing multiple checks

  • Solver frequency: ~10 min

  • Min. delay: 0 days

  • Expiry period: configurable by you (e.g. 5 days)

Querying & Cancelling Requests

  • Fetch pending/fulfilled/cancelled requests using the Nucleus API:

GET https://backend.nucleusearn.io/v1/protocol/withdrawals
  ?chainId=999
  &vaultAddress=0x5748ae796AE46A4F1348a1693de4b50560485562
  &user=0xYourUserAddress
  &status=all
  &all=true
  • Cancel an existing request by revoking LHYPE approval or submitting a new request (automatically cancels prior pending request).

Data Endpoints


Support

If you need integration help, reach out on Telegram: @loopingcollective

Last updated