PegOracleImpl ​
This contract is used to get the exchange rate between pegged assets like sUSDE / USDC or USDE / USDC. Price is adjusted for token decimals and optionally a IERC4626 source feed can be set (e.g. for sUSDE or sUSDS).
_DECIMALS_PRICE_SCALER_MULTIPLIER ​
solidity
uint256 _DECIMALS_PRICE_SCALER_MULTIPLIER
constant value for price scaling to reduce gas usage
_ERC4626_FEED ​
solidity
contract IERC4626 _ERC4626_FEED
IERC4626 source feed contract, e.g. sUSDE on mainnet 0x9d39a5de30e57443bff2a8307a4256c8797a3497
_COL_TOKEN_DECIMALS ​
solidity
uint8 _COL_TOKEN_DECIMALS
_DEBT_TOKEN_DECIMALS ​
solidity
uint8 _DEBT_TOKEN_DECIMALS
constructor ​
solidity
constructor(uint8 colTokenDecimals_, uint8 debtTokenDecimals_, contract IERC4626 erc4626Feed_) internal
_getPegExchangeRate ​
solidity
function _getPegExchangeRate() internal view returns (uint256 rate_)
Get the exchange rate for the pegged assets. Fetching from ERC4626 feed if configured.
Return Values ​
Name | Type | Description |
---|---|---|
rate_ | uint256 | The exchange rate in OracleUtils.RATE_OUTPUT_DECIMALS |
pegOracleData ​
solidity
function pegOracleData() public view returns (uint256 pegExchangeRate_, contract IERC4626 erc4626Feed_, uint256 colTokenDecimals_, uint256 debtTokenDecimals_)
returns all peg oracle related data as utility for easy off-chain use / block explorer in a single view method