Quickstart
Read a Plumb price from a contract on Elysium. If you already read Chainlink, you already know how.
Read a price
Every feed is an AggregatorV3Interface. Point your contract at the feed’s proxy address and call latestRoundData().
import {AggregatorV3Interface} from "./AggregatorV3Interface.sol";
contract Market {
AggregatorV3Interface public immutable feed;
constructor(address hypeUsdProxy) {
feed = AggregatorV3Interface(hypeUsdProxy);
}
function price() public view returns (uint256) {
(, int256 answer, , uint256 updatedAt, ) = feed.latestRoundData();
require(answer > 0, "bad price");
require(block.timestamp - updatedAt <= 1 hours + 5 minutes, "stale");
return uint256(answer); // 8 decimals
}
}Check staleness yourself
Like Chainlink, latestRoundData never reverts on an old price. Compare updatedAt with the feed’s heartbeat plus a small margin. On signed feeds, updatedAt is the moment the signers observed the price, not the moment it landed on-chain.
Find a feed
Look a pair up in the on-chain registry, or copy the address from the status page.
FeedRegistry registry = FeedRegistry(REGISTRY);
AggregatorV3Interface eth = registry.feed("ETH/USD");
string[] memory all = registry.pairs();