HyperEVM Development · DeFi on HyperEVM · 7/8
Lending & Borrowing Protocols
The Opportunity
HyperEVM's read precompiles and CoreWriter give lending protocols something unusual: on-chain access to HyperCore prices, balances, and order books. A protocol can value collateral with HyperCore prices and liquidate by trading directly on the HyperCore order book.
How DeFi Lending Works
The basic lending model:
Lender deposits USDC → Lending Pool ← Borrower provides collateral
↓ ↓
Earns interest Borrows USDC against collateral
Core Concepts
- Supply — Deposit assets to earn interest
- Collateral — Lock assets to enable borrowing
- Borrow — Take a loan against your collateral
- Liquidation — If collateral value drops below threshold, position is liquidated
Aave-Style Lending on HyperEVM
Several HyperEVM lending markets, such as HyperLend, use an Aave V3-style interface:
// Aave V3-style pool interface
// Supplying USDC to earn interest
IERC20(USDC).approve(address(hyperLend), amount);
hyperLend.supply(USDC, amount, onBehalfOf, referralCode);
// Borrowing against collateral
hyperLend.borrow(USDC, borrowAmount, interestRateMode, referralCode, onBehalfOf);
Perp Accounts as Collateral: Read vs. Control
A lending protocol can read a user's HyperCore perp account value via the account margin summary precompile (0x…080F). But reading is not control: the user can withdraw or lose that equity at any time, and a contract cannot seize another account's HyperCore funds. Counting it as collateral is only safe if the equity sits in an account the protocol controls — for example, the contract's own HyperCore account, which it can manage through CoreWriter.
abstract contract PerpCollateralLending {
address constant ACCOUNT_MARGIN_SUMMARY = 0x000000000000000000000000000000000000080F;
struct AccountMarginSummary { int64 accountValue; uint64 marginUsed; uint64 ntlPos; int64 rawUsd; }
// Value of collateral the protocol actually holds for `user` (implementation-specific)
function tokenCollateral(address user) public view virtual returns (uint256);
// Equity of the protocol's OWN HyperCore account (perp dex 0)
function protocolPerpEquity() public view returns (int64) {
(bool ok, bytes memory res) =
ACCOUNT_MARGIN_SUMMARY.staticcall(abi.encode(uint32(0), address(this)));
require(ok, "margin summary failed");
return abi.decode(res, (AccountMarginSummary)).accountValue;
}
function maxBorrow(address user) external view returns (uint256) {
// Allow borrowing up to 50% of collateral the protocol controls
return (tokenCollateral(user) * 50) / 100;
}
}
HyperCore also has native borrow/lend ("Earn"): CoreWriter action 15 supplies or withdraws, and precompiles 0x…0811/0x…0812 read user and reserve state (Interacting with HyperCore).
Risks
- Smart contract risk — HyperEVM contracts are new and may have bugs
- Oracle risk — Thinly traded HyperCore markets can be pushed around; mark, oracle, and spot prices behave differently
- Liquidation cascades — Rapid deleveraging can cause cascading liquidations
- Cross-environment risk — Issues on HyperCore can affect HyperEVM positions, and CoreWriter actions are delayed a few seconds onchain
Measured on Testnet
From building hyperevm-lend (HyperEVM testnet, 2026-10-18); a learning project, not audited:
- HyperCore's own borrow/lend values HYPE at the mark, not the oracle. Its reserve precompile (0x812) gave 51.802 for HYPE while the mark (0x806) was 51.80 and the oracle (0x807) 40.48. The user-state precompile (0x811) reverts for an account with no borrow/lend history
- Testnet prices can be unusable. The testnet HYPE perp's mark was 28% off its oracle and its book 38% wide, so test liquidation logic with a price you set yourself in a testnet-only contract
- One way to liquidate without trusting a single feed: judge liquidation at whichever of the oracle and the mark is better for the borrower (for a HYPE-collateralised loan, the higher). One feed moving alone then liquidates no one, while a real crash, which moves both, still does
Example HyperEVM DeFi Projects
Examples only, not endorsements; check current status in the ecosystem directories linked from the HyperEVM docs.
| Project | Type | Description |
|---|---|---|
| HyperLend | Lending | Aave-style lending |
| Kinetiq | Liquid Staking | kHYPE (liquid staked HYPE) |
| HyperSwap | DEX | AMM for HyperEVM tokens |
| Felix | Stablecoin | CDP stablecoin backed by HYPE |