corewire

Core Orders live

CoreRouter 0x06842dA0e07f488F497DcFC133F21Ab73d8AC36B lets a contract send HyperCore orders as intents. Orders are carried by the Corewire registrar until ElysiumCoreWriter exists; they are not native precompile writes.

bind (account signs EIP-712)
approveAgent on Hyperliquid
placeOrder: intent in your tx
registrar: claim, submit with cloid
result: onCoreResult

Bind an account

struct Limits { uint64 maxOrderUsd; uint64 maxDayUsd; bool reduceOnly; uint32[] assets; }
function bind(address hcAccount, address registrar, Limits calldata l,
    uint256 deadline, bytes calldata sig) external;

The contract that will send intents calls bind. sig is the HyperCore account owner's EIP-712 signature over Bind(address binder,address registrar,uint64 maxOrderUsd,uint64 maxDayUsd,bool reduceOnly,bytes32 assetsHash,uint256 nonce,uint256 deadline) in the domain CoreRouter, version 1, chain 99901. assetsHash is keccak256(abi.encodePacked(assets)) and the nonce is per account (bindNonce). Limits use 6-decimal USD and are capped in the contract at 1,000 USD per order and 10,000 USD per day. Only the bound contract can rebind or unbind().

The agent

On Hyperliquid, the account approves the registrar's API agent with approveAgent. The house registrar's agent is 0x2C93EeCB3fe1837dd22532C86bebD5b45cDF8746. Hyperliquid agents can place and cancel orders and cannot withdraw or transfer. The account can remove the agent on Hyperliquid at any moment.

Intents

function placeOrder(uint32 asset, bool isBuy, uint64 limitPx, uint64 sz,
    uint8 tif, bool reduceOnly, uint16 builderFeeTenthsBp, uint32 callbackGas)
    external payable returns (uint256 id);
function cancel(uint256 id) external;

limitPx and sz use 1e8 decimals; tif is 0 Gtc, 1 Ioc, 2 Alo. The router checks the asset list, reduce-only, the per-order and daily limits, and a builder fee of at most 100 tenths of a basis point. It emits IntentPlaced in your transaction, so the intent is atomic with your own state: if your transaction reverts, there is no intent. msg.value escrows the result callback's gas and pays the registrar when the first result lands.

Results and faults

The registrar calls claim(id), submits the order, and posts result(id, status, oid, filledSz, avgPx, hcTime): 1 resting, 2 filled, 3 cancelled, 4 rejected, 5 error. A resting order can be updated later. Your contract receives onCoreResult(id, status, oid, filledSz, avgPx, hcTime, simulated). If no result lands 10 minutes after the intent, reclaim(id) returns the escrow. isFault(id) is true when a claimed intent had no result within 30 seconds; it is the liveness fault the bonded seats will slash once they exist.

cloid audit

Every order is sent with cloid = cloidOf(id) = bytes16(keccak256(abi.encode(chainid, router, id))). Anyone can query Hyperliquid's orderStatus by cloid for the bound account and compare it with the intent and the posted result. A Core Read of the account's position right after gives a second check that needs no trust in the registrar.

Builder codes not active yet

Intents carry Hyperliquid's builder fee field, bounded by the router at 0.1% and by the account's own approveBuilderFee. Builder fees accrue in USDC on HyperCore. The daily route that brings them to Elysium and pays integrators is not active yet. The planned split is 60% to the integrator and 40% to the protocol.

What a registrar can do

  • The router enforces limits on intents, and the registrar re-checks the binding before it submits. Hyperliquid itself does not know those limits: an agent key, if stolen, could place and cancel any order on the accounts that approved it, though it could never withdraw or transfer. Approve an agent only on an account sized for that risk, and revoke it on Hyperliquid when you stop.
  • A registrar can be slow or silent. Faults are visible through isFault, and escrows come back through reclaim.
  • A registrar could post a wrong result. The cloid audit shows it; wrong-result faults are not slashable in v1.