These are Compound Finance's former oracle contracts:
As per this tweet, these are Compound's oracles that run in production (as of November 2018 the least). I say "former" because Compound switched to the Open Price Feed UniwapAnchoredView.sol oracle on Aug 17, 2020.
Now, whileWhile studying this function:
function getUnderlyingPrice(CToken cToken) public view returns (uint) {
address cTokenAddress = address(cToken);
(bool isListed, ) = comptroller.markets(cTokenAddress);
if (!isListed) {
// not listed, worthless
return 0;
} else if (cTokenAddress == cEtherAddress) {
// ether always worth 1
return 1e18;
} else if (cTokenAddress == cUsdcAddress) {
// read from hand picked key
return v1PriceOracle.assetPrices(usdcOracleKey);
} else {
// read from v1 oracle
address underlying = CErc20(cTokenAddress).underlying();
return v1PriceOracle.assetPrices(underlying);
}
}
I started to wonder why did they choose ETH as the base unit of price reference? Their web interface tracks all values in USD.
Are there majorWhat advantages are there in using ETH instead of USD for the on-chain pricing data?