Skip to content
Request a review

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

  1. Supply — Deposit assets to earn interest
  2. Collateral — Lock assets to enable borrowing
  3. Borrow — Take a loan against your collateral
  4. 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

Measured on Testnet

From building hyperevm-lend (HyperEVM testnet, 2026-10-18); a learning project, not audited:

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