11 min read

Hyperliquid L1: The Next-Gen DEX

Redefining Exchanges

Cover Image

Published on

13 Oct, 2024

Introduction

Hyperliquid is a highly optimized and performant Layer-1 blockchain. More importantly for traders, it is an order book-based perpetual futures decentralized exchange (DEX). Hyperliquid touts itself as "the only exchange you need to trade perps in DeFi." Its DEX runs on the Hyperliquid chain, a Layer-1 blockchain built on HyperBFT.

Building a decentralized Layer 1 to house a perpetual order book DEX requires a detailed understanding of multiple factors, including blockchain tech and quantitative trading, which the team has in abundance. The core contributor is Hyperliquid Labs, led by a team of Harvard classmates and others from MIT and Caltech.

The founders worked in the proprietary market-making sector in 2020 and moved to DeFi in 2022. What surprised them was the number of platforms plagued with bad tech, poor market design, and clunky UX. It quickly became evident that the gap between centralized products and DeFi left the latter trailing by a wide margin. So, they set out to create a product that could overcome challenges faced by DeFi protocols to offer a better trading experience.

Hyperliquid's creators envision a fully open financial system with decentralized applications (dApps) interfacing with native components and a top-flight user experience. This article will cover Hyperliquid's DEX with its popular perpetual futures (perps) trading platform, Layer 1 blockchain, and other prominent features.

Perpetual Futures Trading on Hyperliquid

Most traders know Hyperliquid for its perps trading. "Perps” is short for perpetual futures, a type of derivative that does not have an expiration date. Traditional futures contracts have fixed expiration dates. However, perps are popular because they let traders indefinitely speculate on a digital asset. This feature gives traders more flexibility because they can maintain positions for as long as they wish. Perps have grown in popularity because they offer easy access to leverage without the costs typically associated with fixed-term futures.

To trade perpetual contracts on Hyperliquid, users will need a crypto wallet like Metamask or WalletConnect. They will also need USDC to "long" or "short" the token rather than buy it outright. Hyperliquid Layer-1 validators natively secure USDC as the only token currently used for perps margining.

Users must deposit USDC from Arbitrum onto the Hyperliquid L1. ETH is used to pay for gas on the Arbitrum side, while USDC is used as collateral on Hyperliquid.

Next, traders can use Hyperliquid's token selector to choose the token with which they want to open a position. After deciding to go long or short, they can select their position size and place the order. Hyperliquid currently supports trading over 100 assets. New assets are added based on community input. Further, maximum leverage varies by asset and ranges from 3x up to 50x.

Detailed onboarding instructions are here.

A DEX with CEX Features

Hyperliquid stands for decentralization, self-custody, and transparency. It offers the positive features of a centralized exchange but without the negatives, like interacting with an opaque institution that can misuse user funds. That's why users keep full custody of their assets when depositing to Hyperliquid.

With DEXs, everything should happen transparently on-chain. That's why Hyperliquid chose decentralization: to offer full transparency, impeccable execution, and low costs. Hyperliquid’s Layer-1 chain is built to operate an ecosystem of permissionless financial applications. Every order, cancel, trade, and liquidation occurs transparently on-chain. In short, Hyperliquid offers CEX features on a DEX.

When concepting Hyperliquid, the team explored other models like oracle-based solutions, Automated Market Makers (AMMs), and Request for Quote (RFQ) because they offer a quick way to get up and running on-chain. However, the glaring shortcoming is limited throughput. In the team's estimation, AMMs offered the most straightforward solution but faced the worst problems, such as front-running and MEV attacks.

RFQ is another solution that might be optimal for block trades with limited liquidity. However, RFQ is too opaque, and the asymmetrical relationship between makers and takers tends towards centralization.

Oracle-based solutions can serve as a band-aid when working with a CEX possessing high-quality data and nearly all of the liquidity. However, they can fall prey to oracle attacks and centralization risk and shouldn't be a venue for true price discovery.

Hyperliquid's Order Book

Because of the challenges with oracle-based solutions, AMMs, and RFQ, Hyperliquid chose to be an order book. Order books let liquidity providers control their risk and are the only tested and sustainable solution at scale that leads to tighter spreads and greater capital efficiency.

Therefore, the project's flagship native app is the Hyperliquid DEX, a fully on-chain order book perpetual exchange. Hyperliquid's order book works similarly to a CEX but is entirely on-chain. All trades, funding, and liquidations happen on Hyperliquid’s fully on-chain order book, where traders can enjoy a one-click trading experience without wallet approvals interrupting their trading flow. Furthermore, Hyperliquid Layer 1 has an order book for each asset.

The team chose a perpetual order book because it is the most valuable vertical in DeFi and is where most user-built dApps would benefit. Moreover, it drives users to interact with the Layer-1 infrastructure. The flagship native perps DEX continually presses the Hyperliquid Layer 1, driving more crucial optimizations that general-purpose chains tend to miss.

The Problem with Off-Chain Order Books

For order book DEXs, there is a crucial distinction between on-chain and off-chain matching engines. A DEX is supposed to be permissionless and trustless. However, just because user funds remain on-chain doesn't make a platform decentralized. A system is only as decentralized as its most centralized component. A single party with special privileges and no oversight controls the matching engine with off-chain order books. And if the sole operator running the matching engine off-chain has to shut down, the entire platform collapses. Therefore, it’s hard to call a platform decentralized when a single entity can cancel operations.

Furthermore, an off-chain order book grants operators special privileges with no oversight to prevent them from controlling the order books. Users must trust the operator to follow the rules even though they can't verify it's happening. Such is the world of centralized exchanges.

True, the order book operator must follow the rules cryptographically guaranteed by the signed orders. However, even though only signed orders can be matched, the operator still has leeway to censor transactions, front-run users, or offer preferential treatment to others. They can refuse to cancel a user's order or match a user at a worse price.

Hyperliquid - On-Chain and Decentralized

On the other hand, Hyperliquid's order book is entirely on-chain, with Layer 1 to support it. It surpasses off-chain order books with transparency and decentralization by executing transactions transparently. Moreover, when the matching engine is on-chain, a single validator shutting down doesn't take the network down because all the other validator nodes can continue operating.

hyperliquid (1).png

Due to the state transition rules of Layer 1, users can verify that the platform is working fairly. The Hyperliquid Layer 1 enforces this ordering on-chain. The only way for a node to execute a block correctly on Layer 1 is to sort “cancels” and “post-only” orders first. Makers can quote more confidently when they know that cancels go through with high success. And since Hyperliquid has the fastest Layer 1 in production, its users hardly notice the ordering.

MEV still looms as a risk since validators can reorder transactions for their own gain. However, it's much more difficult for a decentralized set of validators to conspire to control transaction flow.

More Hyperliquid DEX Features

Traders using Hyperliquid enjoy a low-cost trading experience, as there are no gas fees on the network. Instead, only trading fees apply, starting at 0.035% for takers and varying based on the trader's fee tier. This streamlined fee structure makes Hyperliquid an attractive choice for traders seeking efficiency and affordability.

One wonders why no other CEX or DEX emulates Hyperliquid's design. The answer is that most exchanges are not optimized for the end user. Instead, many focus on maximizing fees and volume. At the same time, Hyperliquid is hyper-focused on the end user. Fees and market maker profit and loss are merely byproducts of the relentless focus on the end user's experience.

hyuperliquid-1 (1).png

A well-designed exchange matches trades on both sides, keeping buyers and sellers happy, with maximizing volume as the secondary goal. Hyperliquid is optimized for the end user, not to maximize fees and volume.

Additionally, users can trade with maximum capital efficiency with up to 50x leverage. The chain supports 100,000 orders per second and instant block finality in less than one second. There is no waiting for confirmations, no MEV, and low taker fees. Spot dusting occurs once daily, whereby all spot balances with a value of less than 1 USD get dusted. Further developments include permissionless liquidity, a native token standard, and spot trading.

The result is that liquidity becomes deeper during periods of volatility, while retail users get lower spreads and reduced slippage on large orders.

The Hyperliquid Layer-1 Blockchain

The Hyperliquid Layer 1 uses HyperBFT, a custom consensus algorithm. The networking stack and algorithm are optimized from the ground up to support the Layer 1. Building Hyperliquid on an existing chain like Solana or Arbitrum would have been easier. However, these chains are not performant enough to run an order book at a particular scale. So, the team decided to build a blockchain that could handle their exchange rather than compromise and try to fit their DEX to a particular chain.

Without the proper specs, spreads, and liquidity can degrade and negatively impact retail traders. Thus, Hyperliquid built its chain on HyperBFT. It's performant enough to handle every order, cancel, or trade.

HyperBFT is optimized for end-to-end latency with performance that enables users to port over automated strategies from other venues. Mainnet handles approximately 100,000 orders per second, with execution being the only sticking point. Any trader knows order types like Market, Limit, Stop Market, and Stop Limit. Other types that may be less familiar are Scale Orders (multiple limit orders in a set price range) and TWAP orders, which are large orders divided into smaller suborders and executed in 30-second intervals.

Plans are in place to optimize the execution logic further. Once execution can keep up, the networking stack and consensus algorithm can scale to millions of orders per second as needed.

Validators, Liquidations, and Vaults

The same validator set for Hyperliquid Layer 1 secures Hyperliquid's Arbitrum bridge. Hyperliquid's native bridge is between Arbitrum and Hyperliquid Layer 1—validators on the Layer 1 sign and secure deposits to the bridge. Layer 1 withdrawals are immediately escrowed on Layer 1, and validators sign the withdrawals as separate transactions. Once 2/3rds of the staking power has signed off on the withdrawal, a transaction can be sent to the bridge with the withdrawal request.

In addition, validators publish spot oracle prices for each perp every three seconds. Each validator computes spot oracle prices as the weighted median of Binance, Kucoin, Kraken, OKX (and others) spot prices for each asset. The clearinghouse uses the final oracle price determined by the weighted median of each validator's submitted oracle prices.

Liquidations occur when a trader's positions move against them, causing their account equity to fall below the maintenance margin. If the trader's account equity drops below 2/3 of the maintenance margin without being liquidated through the book, a backstop liquidation will occur via the liquidator vault. Furthermore, liquidation occurs on-chain transparently with a block latency of less than one second.

Vaults are a powerful primitive built into the Hyperliquid Layer 1 with advanced strategy options. Strategies running on vaults range from liquidating overleveraged accounts to market-making strategies.

Any individual, DAOs, or protocols can deposit into a vault to earn a share of the profits, with the vault owner receiving 10% of the total profits—protocol vaults notwithstanding, as they do not have any profit share or fees. Individual traders can run vaults, or a market maker can automate management. Of course, all strategies involve their particular risks. Therefore, users must assess each vault's risks and performance history before participating.

Luganodes X Hyperliquid: Pioneering Secure and Scalable Validation

Luganodes continues to lead the charge in providing top-tier validation services for the Hyperliquid network. In a recent announcement, we highlighted our partnership with Hyperliquid as an institutional validator. With our expertise in maintaining secure, scalable infrastructure, we ensure Hyperliquid can meet the needs of the growing decentralized financial ecosystem. As we collaborate, we’re pushing the boundaries of what’s achievable in on-chain trading systems, supporting Hyperliquid’s evolution as a high-performance Layer 1 blockchain.

Hyperliquid - Summary

To summarize, Hyperliquid’s Layer 1 network revolves around its groundbreaking derivatives exchange, designed for seamless, decentralized trading. By fully embracing decentralization, Hyperliquid eliminates the need for off-chain order books, offering a transparent and efficient trading experience. Retail traders, in particular, will benefit from the fairness and user-friendly interface of the DEX. As Hyperliquid approaches its mainnet beta, traders can look forward to a platform that redefines how decentralized financial applications operate, delivering unmatched speed and security.

About Luganodes

Luganodes is a world-class, Swiss-operated, non-custodial blockchain infrastructure provider that has rapidly gained recognition in the industry for offering institutional-grade services. It was born out of the Lugano Plan B Program, an initiative driven by Tether and the City of Lugano. Luganodes maintains an exceptional 99.9% uptime with round-the-clock monitoring by SRE experts. With support for 45+ PoS networks, it ranks among the top validators on Polygon, Polkadot, Sui, and Tron. Luganodes prioritizes security and compliance, holding the distinction of being one of the first staking providers to adhere to all SOC 2 Type II, GDPR, and ISO 27001 standards as well as offering Chainproof insurance to institutional clients.

Line pattern
© 2024 Luganodes | All rights reserved