wHLP Community Codes
Integrate Wrapped HLP (WHLP) into your app to acquire users and earn fees.
Product Overview
wHLP is a tokenized wrapper of HyperLiquidity Provider (HLP). Users mint wHLP and earn HLP trading fees while keeping full DeFi composability on HyperEVM. Integrators earn fees for every deposit attributed to their unique communityCode
. For CommunityCode flow, deposits are in USDHL.
If you plan to integrate wHLP, get in touch with the Looping Collective team on Telegram @loopingcollective to further discuss reward options.
Contract Addresses
wHLP (ERC-20)
The ERC20 token and the BoringVault contract that that accrues HLP yield
Accountant
Returns current exchange rate for wHLP ↔ USDHL derivatives
Deposit Flow
ERC‑20 Deposits (USDHL)
The CommunityCodeDepositor exposes a single deposit
function. The accepted deposit asset for this flow is USDHL.
USDHL.approve(COMMUNITY_CODE_DEPOSITOR, 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: <estimate>
}
depositAsset
address
ERC‑20 token to deposit (USDHL)
depositAmount
uint256
Amount of token to deposit
minimumMint
uint256
Minimum wHLP shares to mint, reverts if minimumMint is too high (not enough slippage deduced from: depositAmount / rate)
to
address
Address to receive minted wHLP
communityCode
bytes32
Byte‑encoded integrator code
Minimum Mint Calculation
Compute the minimum number of wHLP 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(WHLP_EXCHANGE_RATE)
WHLP_EXCHANGE_RATE
is fetched viaAccountant.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(USDHL);
Decide based on:
Order size (large orders may incur DEX price impact)
Market rate vs native rate (if on-chain swap is cheaper)
Withdrawal Flow
Requesting a Withdrawal
To redeem wHLP back to USDHL, submit/modify a request via the Atomic Queue (UCP). Solvers process requests periodically.
WHLP.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(WHLP_EXCHANGE_RATE)
const args = [
WHLP,
USDHL,
[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: <estimate>
}
offer
address
Asset to withdraw from (wHLP)
want
address
Desired asset (USDHL)
deadline
uint64
Unix timestamp after which the request expires
atomicPrice
uint88
Solver price quote
offerAmount
uint96
Amount of wHLP 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=0x1359b05241cA5076c9F59605214f4F84114c0dE8
&user=0xYourUserAddress
&status=all
&all=true
Cancel an existing request by revoking wHLP approval or submitting a new request (automatically cancels prior pending request).
Data Endpoints
APY
https://app.loopingcollective.org/api/external/asset/wrapped-hlp
reward_rate
TVL
https://app.loopingcollective.org/api/external/asset/wrapped-hlp
assets_under_management
Strategy
https://backend.nucleusearn.io/v1/vaults/underlying_strategies?vault_address=0x1359b05241cA5076c9F59605214f4F84114c0dE8
various
Exchange Rate
https://app.loopingcollective.org/api/external/asset/wrapped-hlp
exchange_rate
Support
If you need integration help, reach out on Telegram: @loopingcollective
Last updated