Hyperliquid prices,
live onchain on Elysium.
Five Hyperliquid markets posted onchain about every 20 seconds, around the clock, and recorded into an onchain price history any contract can average. Price history
Onchain price
next to Hyperliquid's.
| Feed | Hyperliquid market | Onchain price | Updated | Hyperliquid price | 24h | Difference |
|---|---|---|---|---|---|---|
| Reading the chain and Hyperliquid… | ||||||
Our feeds post 24/7, including weekends, so stock pools can price the weekend gap.
Onchain price: the mark price in PoseidonFeed's ticks(asset). Hyperliquid price and 24h change: Hyperliquid's public info API, read by your browser. Difference: onchain minus Hyperliquid, in basis points; small differences come from the seconds between the two reads.
Price history,
recorded onchain.
The price history oracle records these prices onchain, so any contract can read a time-weighted average (TWAP) instead of a single moment. Nobody owns it: no admin, no upgrade, no fee, and nobody can change or delete what it recorded.
| Feed | TWAP, read from chain | Last recorded price | Last sample | Last vs TWAP |
|---|---|---|---|---|
| Reading PriceHistory on Elysium… | ||||
Reading…
Read live by your browser from PriceHistory's twap(feedId, window) and latestPrice(feedId). Each feed records Troy Oracle's HyperCore oracle price through PoseidonFeedReader, at most once every 15 s, about every 2 minutes today, and keeps the last 720 samples.
Read it onchain
interface IPriceHistory {
// 1e8 prices. A window older than the buffer reverts TooOld.
function twap(bytes32 feedId, uint32 window) external view returns (uint256);
function geoTwap(bytes32 feedId, uint32 window) external view returns (uint256);
function latest(bytes32 feedId) external view returns (int256 value, int24 tick, uint32 timestamp);
function observe(bytes32 feedId, uint32[] calldata secondsAgos) external view returns (int56[] memory, int160[] memory);
function checkFresh(bytes32 feedId, uint32 maxAge) external view; // reverts Stale
}
IPriceHistory h = IPriceHistory(0x48de455540928f19e152cc15136da9b1f666bd63);
bytes32 NVDA = 0x5b3512479651d74b6109c7a5707a82813c569aca06d292776353b0612772a4ca;
h.checkFresh(NVDA, 300); // last sample at most 5 min old
uint256 px = h.twap(NVDA, 1 hours); // 1 h average, 1e8Contracts and feeds
0xf8ea…ac880x5b35…a4ca0xd2ff…4f6c0xc72c…3e3d0xe34e…1828Three functions.
No key, no fee.
Solidity
interface ITroyOracle {
// 1e8 prices. markPx and oraclePx return 0 once a price is older than 30 s.
function markPx(uint32 asset) external view returns (uint64);
function oraclePx(uint32 asset) external view returns (uint64);
function ticks(uint32 asset) external view returns
(uint64 mark, uint64 oracle, uint64 bidSz, uint64 askSz, uint40 updatedAt);
}
uint64 nvda = ITroyOracle(0x289eCEa47D1342EF099c1E46a3501b74B488dB22).markPx(110002);
require(nvda != 0, "stale");Contract and keeper
Next: native HyperCore reads.
Waiting on ElysiumWith Elysium's HyperCore upgrade, contracts read Hyperliquid natively and the keeper is no longer needed. The price history oracle already talks to a reader adapter, so it switches over without losing its record. How it works