Integrate Iris
Five lines to read Hyperliquid prices from an Elysium contract. A few more to place HyperCore orders from one.
Overview
Elysium is an Arbitrum Orbit chain that settles to HyperEVM, but it does not have HyperEVM's HyperCore read precompiles (0x0000000000000000000000000000000000000800 and up) or the CoreWriter contract (0x3333333333333333333333333333333333333333). Calls to those addresses succeed and return empty data, so ported contracts revert when they decode. Iris fills the price gap on Elysium mainnet today. The order lane is closed there for now.
| Need | HyperEVM | Elysium with Iris |
|---|---|---|
| Oracle price | L1Read.oraclePx(index) | IrisOracle.oraclePx(index) or getPriceNoOlderThan |
| Mark price | L1Read.markPx(index) | IrisOracle.markPx(index) |
| Best bid and ask | L1Read.bbo(asset) | IrisOracle.bbo(asset) |
| Send an action | CoreWriter.sendRawAction(data) | IrisWriter.sendRawAction{value: escrow}(data) |
Prices keep HyperCore's integer scaling: a perp price has 6 - szDecimals decimals, a spot price 8 - szDecimals. BTC (szDecimals 5) has 1 decimal, so 604979 means 60,497.9.
Read a price
The relayer pushes every listed asset when the oracle price moves 25 bps or 60 seconds pass. Read it with a freshness bound you choose.
import {IIrisOracle} from "iris-contracts/src/interfaces/IIrisOracle.sol"; contract Vault { IIrisOracle constant IRIS = IIrisOracle(/* IrisOracle address, see Addresses */ address(0)); function btcPrice() public view returns (uint256 px18) { (uint256 px, uint8 dec, ) = IRIS.getPriceNoOlderThan(0, 90); // asset 0 = BTC on Hyperliquid return px * 10 ** (18 - dec); } }
Pull a fresh price in your transaction
For trades, liquidations and auctions, carry a signed payload in the user's own transaction. The oracle verifies 2 of 3 signatures and stores it first, so your read sees a price from a second ago. Older or equal observations are skipped, never reverted, so a racing push cannot break your transaction.
function swap(uint32 asset, uint256 amountIn, bytes calldata irisPayload) external { IRIS.updatePriceFeeds(irisPayload); (uint256 px, uint8 dec, ) = IRIS.getPriceNoOlderThan(asset, 5); // price the swap at px / 10**dec }
const { payload } = await fetch("https://iris-server-mainnet-production.up.railway.app/v1/payload?assets=0,1").then(r => r.json()); await vault.swap(0, amountIn, payload);
Moving to native precompiles
Kinetiq plans a HyperCore market-data precompile and an ElysiumCoreWriter predeploy in a later ArbOS upgrade. Iris keeps L1Read's function names and return types and CoreWriter's byte encoding, so the move is one address and, for the pull model, one deleted line.
// today IIrisOracle constant PX = IIrisOracle(/* IrisOracle address, see Addresses */ address(0)); uint64 px = PX.oraclePx(3); // after the precompile ships: same call, new address // uint64 px = L1Read(NATIVE_PRECOMPILE).oraclePx(3);
Act on HyperCore
Encode the action exactly as for CoreWriter: a version byte, a 3-byte action id, then the ABI-encoded params. Send HYPE with it as escrow. Limit order price and size are 1e8-scaled, as on CoreWriter.
| Id | Action | Params |
|---|---|---|
| 1 | Limit order | (uint32 asset, bool isBuy, uint64 limitPx, uint64 sz, bool reduceOnly, uint8 tif, uint128 cloid), tif 1 Alo, 2 Gtc, 3 Ioc |
| 6 | Spot send | (address destination, uint64 token, uint64 wei) |
| 10 | Cancel by oid | (uint32 asset, uint64 oid) |
| 11 | Cancel by cloid | (uint32 asset, uint128 cloid) |
| 1001 | Ticker auction bid | (string ticker, uint8 szDecimals, uint8 weiDecimals, uint64 maxGas, string fullName) |
IIrisWriter constant WRITER = IIrisWriter(/* IrisWriter address, see Addresses */ address(0)); function hedge(uint64 limitPx, uint64 sz) external payable returns (uint256 id) { bytes memory data = abi.encodePacked(uint8(1), uint24(1), abi.encode(uint32(159), false, limitPx, sz, false, uint8(3), uint128(0))); // HYPE short, IOC id = WRITER.sendRawAction{value: msg.value}(data); }
Receipts and reclaim
The keeper executes the action on HyperCore as an agent wallet, then 2 of 3 receipt signers sign the outcome. Filled pays the keeper up to your escrow and refunds the rest; Rejected refunds everything and carries HyperCore's error. Contracts receive a callback with a fixed 200k gas stipend; a reverting callback never blocks settlement.
contract Hedger is IIrisReceiver { function onIrisReceipt(uint256 id, IIrisWriter.Status status, bytes calldata result) external { require(msg.sender == address(WRITER)); (uint64 oid, uint64 filledSz, uint64 avgPx, string memory message) = abi.decode(result, (uint64, uint64, uint64, string)); // update your books } }
No receipt by the deadline (10 minutes by default, 1 minute to 7 days if you set it): anyone can call reclaim(id) and the escrow returns to the intent's account. Refunds sit in your IrisWriter balance until you call withdraw. There is no owner function that moves user funds.
Guards and errors
| Error | When |
|---|---|
StalePrice(asset, updatedAt) | The stored price is older than your maxAge, or older than the asset's maxStaleness for oraclePx, markPx, bbo. |
DeviationTooLarge(asset, bps) | A signed update moves the price more than the asset's limit within 60 seconds of the last one. |
PayloadTooOld, FutureTimestamp | The payload was observed more than 60 s ago, or more than 5 s in the future. |
WrongEpoch | Signed for a signer set that has since rotated. |
InsufficientSignatures, UnknownSigner, SignaturesNotSorted | Fewer than the threshold, a non-signer, or duplicates. |
NotExpired(id, deadline) | Reclaim called before the deadline. |
Signer set changes wait behind a public timelock and bump the epoch inside every signature. Asset decimals are fixed forever once listed.
API
GET /v1/feeds | Live HyperCore and on-chain values per asset, deviation and age |
GET /v1/payload?assets=0,1 | Signed payload for updatePriceFeeds |
GET /v1/updates?asset=3 | On-chain update history |
GET /v1/latency | p50 and p95, observation to confirmation |
GET /v1/intents | Intents with decoded params and receipts |
WS /v1/stream | Feeds every 500 ms plus push events |
Base URL https://iris-server-mainnet-production.up.railway.app
Addresses
Mainnet addresses appear here as soon as the contracts are deployed.
| Hyperliquid assets | BTC 0, ETH 1, SOL 5, HYPE 159 |
| Elysium mainnet RPC | https://rpc.elysium.kinetiq.xyz, chain id 99901 |