Published: April 18, 2023
8
11
88

0/ We've gotten a lot of questions about how Hyperliquid's tech works and how the order book is fully onchain, so we wrote a deep dive on the underlying L1 that powers it all.

Image in tweet by Hyperliquid

1/ For context, Hyperliquid is an order book perpetual futures DEX that offers the same features, execution, and UX as CEXs. The Hyperliquid L1 powers it all, designed from the ground up to be performant enough to operate the whole exchange, with <1 sec block latency.

2/ Off-chain order books weren't viable due to the potential for validators to wield too much centralizing power. If the order book state lives offchain, the order book operator effectively runs a localized centralized exchange with exclusive permissions.

3/ To ensure decentralization, a blockchain capable of supporting a fully onchain order book was necessary. Though existing chains quote impressive stats, none met the minimum latency and TPS requirements. And so, we built the Hyperliquid L1 from scratch.

4/ The Hyperliquid L1 is custom built and laser focused on running a performant derivatives exchange. There are no plans to support general purpose smart contracts. This allows for aggressive optimizations to make a DEX that competes with CEXs in performance and throughput.

5/ Hyperliquid has been optimized across the entire tech stack, from infrastructure to application code, without relying on the Cosmos SDK or other frameworks. The L1 state transition logic is implemented in pure Rust, drawing from abstractions in high-performance HFT systems.

6/ The L1’s surplus throughput allows validators to operate the network with no gas or trading fees during the mainnet closed alpha phase. Eventually, the Hyperliquid L1, like most proof-of-stake systems, will introduce fees on trades that accrue to validators and delegators.

7/ Although the exact fee structure remains undecided, the threshold gas per operation required for DDoS protection will be orders of magnitude lower compared to general-purpose L1s.

8/ Consensus uses a tuned version of Tendermint optimized for end-to-end latency, which is measured as duration between sending a request to receiving its committed response.

9/ Median end-to-end latency for a geographically co-located client’s order is 0.2 secs, with a 99th percentile of 0.9 secs. This performance allows users to port over automated strategies from CEXs with minimal changes and gives retail users instant feedback through the UI.

10/ Out-of-the-box Tendermint takes 2–5 times longer depending on the latency percentile measured, leading to a noticeably inferior user experience.

11/ Through efficient data representation and other low level engineering magic, the Hyperliquid L1 supports 20,000 operations/sec, where operations include orders, cancels, and liquidations. In comparison, vanilla Tendermint’s upper bound is around 1,000 TPS.

12/ In closing: from the L1 to the user flow, Hyperliquid was created to compete with and eventually overtake centralized exchanges. Decentralization without sacrifices is the only way forward.

13/ If this technical deep dive was interesting to you, see it in action on mainnet closed alpha at http://hyperliquid.xyz. You can read the full article at @hyperliquid/the-hyperliquid-l1-a-high-performance-chain-for-advanced-trading-14d18ec63b5f class="text-blue-500 hover:underline" target="_blank" rel="noopener noreferrer">https://medium.com/@hyperliqui...

@HyperliquidX I really like the sound of it. But I’m not sure you can say ‘decentralisation without sacrifices’ when users need to be co-located to achieve the stated 200ms block times?

@SolBeachBum The geographic info was just context for the measurements. You can send txs from anywhere. All L1s have this property that txs will confirm faster if network latency is reduced

@HyperliquidX You mention that there is no pan to support general purpose smart contact so my question is that what other financial instrument do you plan to build in the future

Share this thread

Read on Twitter

View original thread

Navigate thread

1/18