FeedOracle macro data on-chain via Chainlink Functions.
| Property | Value |
|---|---|
| Network | Polygon Mainnet |
| Consumer Contract | 0xd5094024Ae1F905Bd90B69e3CeCfB55CC89723EE |
| Subscription ID | 185 |
| Functions Router | 0xdc2AAF042Aeff2E68B3e8E33F19e4B9fA7C73F10 |
| LINK Token | 0xb0897686c545045aFc77CF20eC7A532E3120E0F1 |
| Variable | Type | Range | Description |
|---|---|---|---|
economicHealth | uint256 | 0-100 | US Economic Health Score |
fedRate | uint256 | 0-2000 | Fed Rate × 100 (425 = 4.25%) |
recessionRisk | uint256 | 0-100 | Recession Probability % |
tradingBias | uint256 | 0-200 | Market Bias (100 = neutral) |
lastUpdated | uint256 | timestamp | Last update block time |
interface IFeedOracleConsumer {
function economicHealth() external view returns (uint256);
function fedRate() external view returns (uint256);
function recessionRisk() external view returns (uint256);
function isFavorableEconomy() external view returns (bool);
function requestEconomicHealth() external returns (bytes32);
}
IFeedOracleConsumer oracle = IFeedOracleConsumer(
0xd5094024Ae1F905Bd90B69e3CeCfB55CC89723EE
);
uint256 health = oracle.economicHealth(); // e.g., 85
uint256 fed = oracle.fedRate(); // e.g., 425 (4.25%)
if (oracle.isFavorableEconomy()) {
// health > 50 AND recessionRisk < 50
}
// Trigger Chainlink Functions request bytes32 requestId = oracle.requestEconomicHealth(); // Data available after ~30 seconds // Listen for DataReceived(requestId, feedType, value) event
The contract uses Chainlink Functions to fetch data from FeedOracle API:
// JavaScript executed in Chainlink DON
const url = "https://feedoracle.io/api/v1/macro/" + args[1];
const r = await Functions.makeHttpRequest({url});
return Functions.encodeUint256(r.data.value);