Decentralized, Chainlink-compatible USD price oracle running natively on GGCHAIN. Powered by CoinGecko + GGSwap reserves, updated every 5 minutes.
| Symbol | Latest Price | Updated | Round | Source | |
|---|---|---|---|---|---|
| Loading feeds… | |||||
interface IPriceOracle {
function latestPrice(string calldata sym)
external view returns (int256 price, uint256 ts);
function safePrice(string calldata sym)
external view returns (int256);
}
contract MyDapp {
IPriceOracle constant ORACLE =
IPriceOracle(0x...);
function ggUsd() external view returns (int256) {
return ORACLE.safePrice("GG"); // reverts if stale
}
}
import {ethers} from "ethers";
const ABI = ["function latestPrice(string) view returns (int256,uint256)"];
const oracle = new ethers.Contract(
"0x...",
ABI,
new ethers.JsonRpcProvider("https://rpc.gghyper.net")
);
const [p, t] = await oracle.latestPrice("GG");
console.log("GG = $" + Number(p)/1e8);