BTB
/

HyperLend Pooled

Lendingwebsite
Pooled lending market on HyperEVM, an Aave V3 fork. An agent can supply assets to earn interest, borrow against collateral, repay, and withdraw. Wrapped HYPE (WHYPE) can be supplied and borrowed as native HYPE through the gateway.

What you can do

supplyDeposit an asset to earn interestapprove the Pool for the amount, then Pool.supply(asset, amount, onBehalfOf, 0); hTokens are minted to onBehalfOf. For native HYPE use WrappedTokenGateway.depositETH with HYPE as value.
withdrawWithdraw a supplied assetPool.withdraw(asset, amount, to); pass type(uint256).max to withdraw the full balance. For native HYPE use WrappedTokenGateway.withdrawETH after approving hWHYPE to the gateway.
borrowBorrow against collateralcheck Pool.getUserAccountData(user).healthFactor first, then Pool.borrow(asset, amount, 2, 0, onBehalfOf). Stable rate mode is not used here.
repayRepay a variable debtapprove the Pool for the amount, then Pool.repay(asset, amount, 2, onBehalfOf); for native HYPE use WrappedTokenGateway.repayETH with HYPE as value
toggle-collateralEnable or disable a supplied asset as collateralPool.setUserUseReserveAsCollateral(asset, true or false)
check-positionRead collateral, debt and health factorPool.getUserAccountData(user); healthFactor below 1e18 means liquidatable
Positions can be liquidated if the health factor falls below 1. Keep a margin above 1 and check it after each borrow or price move.
Only the core pool is covered here. HyperLend isolated pools have their own Pool and reserve list and carry separate risk.
HyperLend governance, its multisigs and emergency admin can freeze reserves or pause the pool. The Pool is an upgradeable proxy.
Borrowing native HYPE through the gateway needs a credit delegation approval on the WHYPE variable debt token, and withdrawing it needs an approval on the hWHYPE aToken.

Contracts

Read any function, or build a write and sign it. Amounts are in base units (1 USDC = 1000000).
Pool (core pools, proxy)pool on hyperevm0x00A89d7a5A02160f20150EbEA7a2b5E4879A1A8b
write supply(address,uint256,address,uint16)
Supply an asset and receive hTokens. Arguments: asset, amount in the token's smallest unit, onBehalfOf, referralCode (0 for none). Approve the Pool for the amount first.
write withdraw(address,uint256,address)
Withdraw a supplied asset. Arguments: asset, amount (type(uint256).max for the full balance), recipient. Reverts if the health factor would drop below 1 while the caller has debt.
write borrow(address,uint256,uint256,uint16,address)
Borrow an asset against collateral. Arguments: asset, amount, interestRateMode (2 for variable), referralCode, onBehalfOf. Reverts if the health factor would fall below 1.
write repay(address,uint256,uint256,address)
Repay debt. Arguments: asset, amount (type(uint256).max to repay the full debt), interestRateMode (2 for variable), onBehalfOf. Approve the Pool for the amount first.
write repayWithATokens(address,uint256,uint256)
Repay debt using the supplied hToken balance instead of the wallet token. Arguments: asset, amount, interestRateMode (2 for variable). No approval needed.
write setUserUseReserveAsCollateral(address,bool)
Enable or disable a supplied asset as collateral. Disabling reverts if it would push the caller's health factor below 1.
write setUserEMode(uint8)
Switch the caller into an efficiency mode category (0 for none). Only works if the account's collateral and debt all belong to that category.
write flashLoanSimple(address,address,uint256,bytes,uint16)
Single-asset flash loan. Arguments: receiver contract (must implement executeOperation), asset, amount, params, referralCode. The receiver must repay amount plus fee within the same transaction.
read getUserAccountData(address)
Returns totalCollateralBase, totalDebtBase, availableBorrowsBase, currentLiquidationThreshold, ltv and healthFactor. Base values use the oracle's 8 decimal USD. healthFactor has 18 decimals; below 1e18 means liquidatable.
read getReserveData(address)
Full reserve struct for an asset: configuration, liquidity and borrow indexes, rates, and the hToken and debt token addresses.
read getReservesList()
List of all reserve asset addresses in the core pool.
WrappedTokenGatewayV3 (native HYPE)other on hyperevm0x49558c794ea2aC8974C9F27886DDfAa951E99171
write depositETH(address,address,uint16)
Supply native HYPE. Send HYPE as msg.value. Arguments: pool (unused, pass the Pool address), onBehalfOf, referralCode (0 for none). Wraps to WHYPE and supplies it.
write withdrawETH(address,uint256,address)
Withdraw supplied WHYPE as native HYPE. Arguments: pool (unused), amount (type(uint256).max for the full balance), recipient. Approve the gateway to spend the caller's hWHYPE (aToken) first.
write repayETH(address,uint256,address)
Repay WHYPE debt with native HYPE. Send HYPE as msg.value. Arguments: pool (unused), amount, onBehalfOf. Excess HYPE is returned.
write borrowETH(address,uint256,uint16)
Borrow native HYPE. Arguments: pool (unused), amount in wei, referralCode. The caller must first approve the gateway for credit delegation on the variable debt token of WHYPE.
read getWETHAddress()
Returns the WHYPE token address the gateway wraps to.
ProtocolDataProviderother on hyperevm0x4f4d4cA1e0a8A21FE0B460613bEbe917f2eb4326
read getAllReservesTokens()
Symbol and address pairs for every reserve in the core pool.
read getUserReserveData(address,address)
A user's supplied and borrowed balances and flags for one asset. Arguments: asset, user.
read getReserveConfigurationData(address)
Risk parameters for an asset: LTV, liquidation threshold, decimals, and whether it is active, frozen or borrowing enabled.