CoreOracle
The contract provides price feeds to other contracts, such as the BlueberryBank.sol
Contract
State Variables
The CoreOracle
contract contains the following state variables:
routes
This mapping stores the oracle source routes for tokens. For each token address t
, the mapping stores the oracle source route address for t
.
liqThresholds
This mapping stores the liquidation threshold for tokens. The number is multiplied by 1e4. For volatile tokens 85% and 90% for stablecoins as a negative Profit loss on the position in comparison to the supplied tokens as isolated collateral.
whitelistedERC1155
This mapping stores the wrapper addresses for the whitelisted status of ERC1155 tokens in the protocol.
Functions
initialize
This function initializes the CoreOracle
contract. It is called during contract deployment.
setRoutes
This function sets the oracle source routes for tokens. It takes two arrays as inputs, tokens
and oracleRoutes
, both of which must have the same length. For each index i
, the function sets the oracle source route for the token at index i
to the address in oracleRoutes[i]
.
setLiqThresholds
This function sets the token liquidation thresholds. It takes two arrays as inputs, tokens
and thresholds
, both of which must have the same length. For each index i
, the function sets the liquidation threshold for the token at index i
to the value in thresholds[i]
.
setWhitelistERC1155
This function whitelists ERC1155 tokens. It takes an array tokens
of tokens to whitelist and a boolean ok
indicating whether to whitelist or blacklist the tokens. For each token in tokens
, the function sets its whitelist status to the value in ok
.
_getPrice
This internal function returns the USD price of a given token, multiplied by 10^18.
getPrice
This function returns the USD price of a given token, multiplied by 10^18
isWrappedTokenSupported
This function returns a boolean indicating whether the oracle supports the underlying token of a given wrapper token. Only validate wrappers of Blueberry protocol such as WERC20
isTokenSupported
This function returns a boolean indicating whether the oracle supports a given ERC20 token.
Last updated