DEV Community

lina for Rock'n'Block

Posted on

We Researched Hyperliquid’s Architecture — Here’s What Actually Stands Out

Our team recently conducted a deep technical research into Hyperliquid to understand why it keeps coming up in discussions around high-performance perpetual DEXs. We focused on system design — how trades are executed, where state lives, and how liquidity, custody, and settlement are structured.

Read the full research here: How Hyperliquid Works — A Technical Deep Dive

In this summary, we cover Hyperliquid’s architecture, the HyperCore order book, HyperEVM, and the mechanisms managing trading, liquidity, and smart contract interactions.


DEX Mechanics Background

Most DEXs work like this: the market price of one asset relative to another is determined by a predefined curve, and liquidity comes from users called liquidity providers. These providers supply funds but don’t set prices — pricing happens automatically.

Other key features of typical DEXs:

  • Users retain full control of funds via smart contracts
  • Trades can execute without waiting for a counterparty
  • Independent pricing, self-custody, and no intermediaries

Hyperliquid takes a different approach. Its interface resembles a centralized exchange, but all execution is on-chain and fully deterministic.


Hyperliquid Overview

Hyperliquid provides a fully on-chain central limit order book (CLOB). Unlike other DEXs that rely on off-chain matching or AMM curves, order creation, matching, and execution happen directly on-chain.

It runs on a custom L1 blockchain with two execution environments:

  • HyperCore — high-performance on-chain trading engine
  • HyperEVM — EVM-compatible smart contract environment

Both operate under HyperBFT consensus.


Hyperliquid L1 Blockchain and HyperBFT Consensus

Hyperliquid uses HyperBFT, a variant of Delegated Proof-of-Stake (DPoS):

  • Leader rotation across multiple rounds
  • Validators vote proportionally to stake
  • Byzantine Fault Tolerance tolerates up to ⅓ malicious validators
  • Ensures consistent state across all network participants

Hyperliquid Blockchain Architecture

Hyperliquid splits blockchain state between HyperCore and HyperEVM, synchronized under HyperBFT.

Hyperliquid Architecture

Source: Hyperliquid Community Wiki

Let’s take a closer look at the diagram. The architecture has four layers:

  • Frontend layer — the interface traders interact with
  • Application logic layer — trading, margin, and funding rules
  • Execution layer — HyperCore for the on-chain CLOB, HyperEVM for smart contracts
  • Consensus layer — HyperBFT ensures state consistency

Even with two execution environments, HyperEVM can read and write HyperCore data, enabling smart contracts to interact directly with trading and account state.


HyperCore On-Chain Order Book

HyperCore is the core of Hyperliquid’s trading engine:

  • Fully on-chain CLOB
  • Handles order creation, cancellation, matching, and execution
  • Deterministic price-time priority ensures consistent state across validators

Sub-second finality and throughput:

  • Average finality: ~0.2s
  • Throughput: up to 200,000 orders per second

Order placement types include:

  • Market, Limit, Stop Market, Stop Limit
  • TWAP (time-weighted average price), Scale orders

Options:

  • Reduce Only, Good Til Cancel, Post Only, Immediate or Cancel
  • Take Profit, Stop Loss

Margin Management and the Clearinghouse

The clearinghouse is Hyperliquid’s central accounting and risk engine. It ensures that all trades, margins, and liquidations are processed deterministically.

Let’s take a closer look at the diagram below to see how the clearinghouse operates.

Clearinghouse ArchitectureSource: Hyperliquid Community Wiki

What the Clearinghouse Does in Hyperliquid

  • Tracks balances and positions: user deposits, withdrawals, margin balances, and open positions
  • Enforces leverage and margin requirements: validates margin sufficiency at order submission and before execution
  • Executes liquidations automatically when maintenance thresholds are breached
  • Calculates funding rates for perpetuals to align prices with spot markets
  • Integrates oracle prices from Binance, OKX, Bybit, Kraken, KuCoin, Gate IO, MEXC, and Hyperliquid
  • Supports multiple margin modes: isolated and cross margin

Understanding Funding Rate for Perpetuals

Above, we mentioned the concept of funding rate. Let’s break down what it is.

Funding rate keeps Hyperliquid perpetuals aligned with the underlying spot market. It balances incentives between long and short traders.

How it works:

  • Perp price above spot → longs pay shorts
  • Perp price below spot → shorts pay longs

Formula:

Funding Rate = Average Premium Index(P) + clamp(Interest Rate – P, -0.0005, 0.0005)

Where:

  • Premium Index (P): difference between impact price and oracle price
  • Interest Rate: fixed at 0.01%
  • Clamp: limits sharp deviations to [-0.0005, 0.0005]

Payment frequency: hourly, keeping perp prices continuously aligned with spot.


HyperEVM Smart Contract Environment

HyperEVM is EVM-compatible and runs on the same blockchain:

  • Supports Ethereum tools and EIP-1559
  • Priority fees burned to zero address
  • Small blocks: 2M gas/sec, Large blocks: 30M gas/min

How it interacts with HyperCore:

HyperCore and HyperEVM Data Flow
Source: Hyperliquid Community Wiki

  • Read access: asset prices, open orders, trade history, balances, validator deposits, blockchain metadata
  • Write access: manage orders, execute trades, interact with trading engine in real-time
  • Smart contracts act as active market participants without compromising HyperCore determinism

Key Takeaways

  • Hyperliquid is a fully on-chain, high-performance perpetual DEX
  • HyperCore: on-chain CLOB, deterministic execution, sub-second finality
  • HyperEVM: EVM-compatible environment with HyperCore access
  • Clearinghouse: enforces margin, liquidation, and funding rates using integrated oracle prices
  • Multiple order types and leverage options, all processed on-chain
  • Hourly funding rate aligns perpetuals with spot

This combination of trading engine and smart contract environment provides transparent, programmable, and high-performance DeFi markets.

Make sure toFollow us on X for more deep dives.

We ❤️ Development

Top comments (0)