Contracts
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
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 managerdeposit(account, token, amount)— Deposits tokens into an accountaddApiWallet(account, apiWallet)— Authorizes an API wallet for tradinghlRequestOrder(...)— Places HyperLiquid perp/spot orders via ActionCasterhlRequestCancel(...)— Cancels HyperLiquid ordershlActionSendAsset(...)— Sends assets from Account to recipienthcActionWithdrawToken(...)— Withdraws tokens from Exchange to AccounthcActionWithdrawOption(...)— Withdraws options to HyperEVM recipientrsmCommandRebalance(...)— RSM-initiated reduce-only ordersrsmCommandRepay(...)— 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 requestshlRequestCancel(...)— Processes cancel requestshlActionSendAsset(...)— Processes send asset actionsrsmCommandRebalance(...)— Processes RSM rebalance commandsrsmCommandRepay(...)— Processes RSM repay commandsusdToHype(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:
| Action | Signer | Description |
|---|---|---|
hlRequestOrder | Agent/API Wallet | Place perp/spot orders |
hlRequestCancel | Agent/API Wallet | Cancel orders by OID |
hlRequestCancelByCloid | Agent/API Wallet | Cancel orders by CLOID |
Manager Actions
Actions that require the account manager's signature:
| Action | Description |
|---|---|
hlActionSendAsset | Send assets from Account to recipient |
hcActionWithdrawToken | Withdraw tokens from Exchange to Account |
hcActionWithdrawOption | Withdraw options to HyperEVM address |
RSM Commands
Commands signed by the RSM signer (no manager consent required):
| Command | Description |
|---|---|
rsmCommandRebalance | Post reduce-only orders to increase USDC balance |
rsmCommandRepay | Force 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:
- RSM Sequencer triggers a full liquidation auction
- Anyone can bid by supplying the requested USDC amount
- Winner becomes the new Account manager
- RSM Sequencer can stop ongoing auctions if conditions change
Deployed Addresses
Testnet
| Contract | Address | Description |
|---|---|---|
| Exchange | Coming soon | Main exchange contract |
| Processor | Coming soon | Action encoding and signature verification |
| Registry | Coming soon | Option token registry |
Mainnet
| Contract | Address | Description |
|---|---|---|
| Exchange | Coming soon | Main exchange contract |
| Processor | Coming soon | Action encoding and signature verification |
| Registry | Coming soon | Option token registry |
Source Code
Contract source code will be made available after audit completion.
Related
- EIP-712 Signing — Message formats and signing
- Agent Authorization — API wallet setup
- Onboarding — Account creation and deposits
- API Authentication — Signing requests