HyperX
0
0
·5 min read·Dexter

CoreWriter: Hyperliquid's New System Contract for EVM Builders

An in-depth look at CoreWriter, the system contract that allows HyperEVM smart contracts to interact directly with HyperCore, opening new possibilities for DeFi builders on Hyperliquid.

hyperliquidhyperevminfrastructure

The Two Layers of Hyperliquid

Hyperliquid operates two execution environments on the same validator set.

HyperCore is the native layer where the central limit order book, perpetual futures, and spot markets execute. It is purpose-built for speed, processing thousands of orders per second with sub-second finality. You cannot deploy arbitrary smart contracts to HyperCore — it exposes a fixed set of operations: placing orders, managing positions, transferring assets, and staking.

HyperEVM is the general-purpose layer, a fully EVM-compatible environment where developers deploy Solidity smart contracts for lending protocols, yield aggregators, DAOs, and anything requiring custom logic.

The challenge has been making these layers communicate. HyperCore has the liquidity and order books. HyperEVM has the programmability. Without a bridge, EVM developers could not tap into Hyperliquid's trading infrastructure.

What CoreWriter Does

CoreWriter is a system contract — a pre-deployed contract on HyperEVM that acts as a gateway to HyperCore. When an EVM smart contract calls CoreWriter, the instruction is relayed to HyperCore and executes natively.

Think of it as a translator. Your Solidity code speaks EVM. HyperCore speaks its native language. CoreWriter converts well-formatted EVM calls into native HyperCore operations.

Before CoreWriter, interacting with HyperCore required the native API — the same interface the trading UI uses. Smart contracts on HyperEVM were isolated from the trading infrastructure. CoreWriter changes this. For the first time, on-chain smart contracts can place and cancel orders, manage perpetual positions, execute spot trades through the native matching engine, and access staking functions.

How the Bridge Works

Because both layers share the same validator set and state commitment, the bridge avoids the trust assumptions of traditional cross-chain bridges.

When a smart contract calls CoreWriter, the sequence is: the contract invokes a function on the CoreWriter address with encoded parameters specifying the desired operation. CoreWriter validates the parameters against HyperCore requirements — checking margin, price conformity, and risk parameters. The operation then executes on HyperCore within the same consensus round. Finally, results propagate back to the EVM context, allowing the calling contract to react within the same transaction.

This entire flow happens within a single block. No asynchronous messaging, no waiting for confirmations, no bridge relayer. State is shared at the consensus level, eliminating the security risks of traditional bridging.

What Builders Can Build

CoreWriter unlocks applications that were previously impossible on Hyperliquid.

On-Chain Trading Vaults. Smart contracts can manage strategies directly on HyperCore's order book. A vault could accept deposits, execute a defined strategy through CoreWriter, and distribute profits — enabling fully on-chain, auditable copy trading without trusting an off-chain operator with private keys.

Automated Position Management. Contracts that monitor perpetual positions and automatically adjust leverage, manage margin, or place stop-loss orders based on on-chain conditions. Because CoreWriter enables programmatic order placement, these automations run entirely on-chain.

DeFi Composability. Lending protocols can integrate with HyperCore markets directly. A lending protocol could accept HyperCore positions as collateral, liquidating through the native order book if values drop. Yield protocols could combine EVM-based farming with HyperCore perpetual hedging.

Structured Products. Options-like payoffs and range-bound strategies implemented as smart contracts that use CoreWriter for underlying hedge management — all transparently verifiable on-chain.

DAO Treasury Management. DAOs can encode treasury management rules in smart contracts that execute trades through CoreWriter based on governance votes, replacing trusted multisig operators with transparent on-chain logic.

Testnet Validation and Bug Bounties

CoreWriter was thoroughly tested on Hyperliquid's testnet before mainnet enablement. The testnet phase was critical because CoreWriter sits at the intersection of two execution environments, creating a larger attack surface than either in isolation.

Testnet bugs in CoreWriter's interaction logic were eligible for the Hyperliquid bug bounty program. Key areas of concern included:

Reentrancy across layers. Could a malicious contract use CoreWriter to create reentrancy conditions between HyperEVM and HyperCore? The system needed validation against callbacks spanning both environments.

Gas accounting. CoreWriter operations consume resources on both layers. Ensuring gas costs are properly accounted for — preventing expensive HyperCore operations at artificially low EVM gas costs — required careful calibration.

Error handling. When a HyperCore operation fails (for example, an order rejected during a protective market state), the failure must propagate cleanly to the EVM context without leaving either layer inconsistent.

Implications for the Ecosystem

CoreWriter represents a philosophical commitment to making high-performance trading infrastructure composable. Many high-performance chains opt for closed architectures where core trading logic is accessible only through proprietary APIs. Hyperliquid's decision to expose HyperCore through a permissionless system contract signals that composability is viewed as a feature, not a liability.

Hyperliquid already has the deepest on-chain order book liquidity for perpetual futures. Making that liquidity programmable through CoreWriter enables a new generation of DeFi applications combining CLOB capital efficiency with smart contract composability.

For developers considering building on Hyperliquid, CoreWriter significantly lowers the barrier. Instead of building off-chain infrastructure to interact with HyperCore, you can write Solidity contracts that interact with the order book as naturally as any other on-chain protocol. The trading infrastructure is mature, the EVM is operational, and CoreWriter is the connective tissue that unifies them.

Build on Hyperliquid with HyperX

HyperX's Agent API leverages Hyperliquid's infrastructure to deliver real-time data to AI agents and developers. Our REST and WebSocket streams make it easy to build on top of Hyperliquid's expanding capabilities.

D

On-chain analyst and builder at HyperX (hyperx.trade), the Hyperliquid trading analytics and copy trading platform. Focused on smart money tracking and building tools that give every trader an edge on-chain.

AboutBlogContactPrivacyTermsRisk Disclaimer

Trading involves substantial risk. HyperX does not provide financial advice.