Oracle
Hyperliquid mark prices, signed by a keeper quorum and checked on chain.
v0: keeper quorum
BoxOracle accepts batched price updates signed by keepers. Each entry carries the Hyperliquid mark, the market's σ1h and the Hyperliquid timestamp.
struct Px {
uint32 coin; // Hyperliquid perp index
uint64 markE8; // mark price · 1e8
uint32 sigmaE6; // σ1h · 1e6
uint64 hlTimeMs; // Hyperliquid time, ms
}
push(Px[] batch, uint64 deadline, bytes[] sigs)Signatures use EIP-712 with domain name “BoxOracle”, version “1”:
digest = hashTypedDataV4(
keccak256(abi.encode(
keccak256("Batch(bytes32 pxHash,uint64 deadline)"),
keccak256(abi.encode(batch)),
deadline)))On-chain checks
| Check | Rule |
|---|---|
| Quorum | 2 of 3 keeper signatures |
| Staleness | Update no older than 5 s (Turbo actions: 1.5 s) |
| Jump guard | Move of more than 10% in one update needs 3 of 3 signatures |
| Ordering | hlTimeMs must increase for each coin |
| σ1h range | 0.1% to 10% |
Each accepted batch emits PriceBatch(n, hlTimeMs). Any contract or user can read the latest value with price(coin).
v1: HyperCore precompile
When Elysium exposes a HyperCore price precompile, the oracle reads Hyperliquid marks directly on chain. The engine reads prices through the IPriceSource interface, so the switch replaces the adapter and leaves the engine unchanged.