FluidOracle ​
Inherits:IFluidOracle, OracleError
Base contract that any Fluid Oracle must implement
State Variables ​
_infoName ​
short helper string to easily identify the oracle. E.g. token symbols
bytes32 private immutable _infoName;
_targetDecimals ​
target decimals of the oracle when scaling to 1e27. E.g. for ETH / USDC it would be 15 because diff of ETH decimals to 1e27 is 9, and USDC has 6 decimals, so 6+9 = 15, e.g. 2029,047772120364926 For USDC / ETH: 21 + 18 = 39, e.g. 0,000492842018675092636829357843847601646
uint8 private immutable _targetDecimals;
Functions ​
constructor ​
constructor(string memory infoName_, uint8 targetDecimals_);
targetDecimals ​
target decimals of the returned oracle rate when scaling to 1e27. E.g. for ETH / USDC it would be 15 because diff of ETH decimals to 1e27 is 9, and USDC has 6 decimals, so 6+9 = 15, e.g. 2029,047772120364926 For USDC / ETH: 21 + 18 = 39, e.g. 0,000492842018675092636829357843847601646
function targetDecimals() external view returns (uint8);
infoName ​
helper string to easily identify the oracle. E.g. token symbols
function infoName() external view returns (string memory);
getExchangeRate ​
Deprecated. Use getExchangeRateOperate()
and getExchangeRateLiquidate()
instead. Only implemented for backwards compatibility.
function getExchangeRate() external view virtual returns (uint256 exchangeRate_);
getExchangeRateOperate ​
Get the exchangeRate_
between the underlying asset and the peg asset in 1e27 for operates
function getExchangeRateOperate() external view virtual returns (uint256 exchangeRate_);
getExchangeRateLiquidate ​
Get the exchangeRate_
between the underlying asset and the peg asset in 1e27 for liquidations
function getExchangeRateLiquidate() external view virtual returns (uint256 exchangeRate_);