Skip to main content

Contracts

Addresses Coming Soon

Contract addresses will be published on this page once deployed to testnet and mainnet.

Hypercall's on-chain components are deployed on Hyperliquid L1 (HyperEVM). The system uses a modular architecture with separate contracts for account management, order processing, and option token handling.

Architecture Overview

User / ManagerEOA or Smart ContractOrders / ActionsExchangeMain Entry Point • Upgradeable Proxy• Creates Accounts (BeaconProxy)• Custodies USDC• RSM Sequencer entry• Liquidation auctionsAccountPer-user BeaconProxy• Custodies collateral• Manager + Agent keysProcessorAction Encoding• ActionCaster encoding• USD → HYPE conversionRegistryOption Token Management• Deploys option ERC20s• Token validationCoreWriterWrites actions to HyperCoreSettlement LayerLEGENDUser callsInternal callsSettlement

Contract Responsibilities

Exchange

The Exchange is the main entry point and uses an upgradeable proxy pattern.

Responsibilities:

  • Creates user Accounts via BeaconProxy pattern
  • Custodies deposited USDC on HyperCore (insurance fund + option positions)
  • Entry point for RSM Sequencer for on-chain actions/requests
  • Handles option ERC20 deposits and withdrawals (bridging between HyperEVM and RSM ledger)
  • Tracks and resolves full liquidation auctions
  • Emits events with raw ActionCaster actions

Key Functions:

  • createAccount() — Creates a new account with caller as manager
  • deposit(account, token, amount) — Deposits tokens into an account
  • addApiWallet(account, apiWallet) — Authorizes an API wallet for trading
  • hlRequestOrder(...) — Places HyperLiquid perp/spot orders via ActionCaster
  • hlRequestCancel(...) — Cancels HyperLiquid orders
  • hlActionSendAsset(...) — Sends assets from Account to recipient
  • hcActionWithdrawToken(...) — Withdraws tokens from Exchange to Account
  • hcActionWithdrawOption(...) — Withdraws options to HyperEVM recipient
  • rsmCommandRebalance(...) — RSM-initiated reduce-only orders
  • rsmCommandRepay(...) — RSM-initiated debt repayment

Account

Each user has their own Account contract (BeaconProxy pointing to shared implementation).

Responsibilities:

  • Custodies collateral on HyperCore side for traders/MMs using non-USDC assets
  • Has a single manager who can add multiple agent keys
  • Agent keys can only sign orders/cancels; other actions require manager signature
  • Entry point for managers for all account-associated actions

Key Concepts:

  • Manager: The account owner who can authorize agents and sign withdrawals
  • Agent Keys: Authorized signers for order placement/cancellation only
  • API Wallets: Authorized addresses that can submit orders on behalf of the account

Deposits:

  • Option ERC20s are deposited by calling Exchange.deposit()
  • Other assets are bridged to HyperCore using the asset's HyperEVM → HyperCore bridge
  • USDC deposits into "Option USDC position" are done via HyperCore transfer from Account to Exchange

Processor

The Processor handles signature verification and action encoding.

Responsibilities:

  • Reconstructs signer addresses from signatures
  • Encodes actions into ActionCaster format
  • Converts USD amounts to HYPE for deposit calculations

Key Functions:

  • hlRequestOrder(...) — Processes order requests
  • hlRequestCancel(...) — Processes cancel requests
  • hlActionSendAsset(...) — Processes send asset actions
  • rsmCommandRebalance(...) — Processes RSM rebalance commands
  • rsmCommandRepay(...) — Processes RSM repay commands
  • usdToHype(amountUsd) — Converts USD to HYPE based on spot price

Registry

The Registry manages option token deployment and validation.

Responsibilities:

  • Deploys option ERC20 tokens
  • Source of truth for "is this ERC20 a supported option token"
  • Whitelisted addresses can deploy new option tokens

Future Guardrails:

  • Allowed set of underlyings
  • Allowed expiry timestamps
  • Allowed strike granularity

Action Types

HyperLiquid Requests

Requests that interact with HyperLiquid's order book:

ActionSignerDescription
hlRequestOrderAgent/API WalletPlace perp/spot orders
hlRequestCancelAgent/API WalletCancel orders by OID
hlRequestCancelByCloidAgent/API WalletCancel orders by CLOID

Manager Actions

Actions that require the account manager's signature:

ActionDescription
hlActionSendAssetSend assets from Account to recipient
hcActionWithdrawTokenWithdraw tokens from Exchange to Account
hcActionWithdrawOptionWithdraw options to HyperEVM address

RSM Commands

Commands signed by the RSM signer (no manager consent required):

CommandDescription
rsmCommandRebalancePost reduce-only orders to increase USDC balance
rsmCommandRepayForce USDC transfer from Account to Exchange

Signature Verification

  • Exchange verifies RSM signer signatures
  • Account verifies manager and agent signatures
  • RSM commands are passed without manager signature (RSM signer is trusted)

Liquidation Auctions

When an account becomes undercollateralized:

  1. RSM Sequencer triggers a full liquidation auction
  2. Anyone can bid by supplying the requested USDC amount
  3. Winner becomes the new Account manager
  4. RSM Sequencer can stop ongoing auctions if conditions change

Deployed Addresses

Testnet

ContractAddressDescription
ExchangeComing soonMain exchange contract
ProcessorComing soonAction encoding and signature verification
RegistryComing soonOption token registry

Mainnet

ContractAddressDescription
ExchangeComing soonMain exchange contract
ProcessorComing soonAction encoding and signature verification
RegistryComing soonOption token registry

Source Code

Contract source code will be made available after audit completion.