A Pricer contract for a Compound cToken
-
constructor(address _cToken, address _underlying, address _oracle) (public)
-
getPrice() (external)
-
setExpiryPriceInOracle(uint256 _expiryTimestamp) (external)
-
_underlyingPriceToCtokenPrice(uint256 _underlyingPrice) (internal)
-
_cToken
: cToken asset -
_underlying
: underlying asset for this cToken -
_oracle
: Opyn Oracle contract address
get the live price for the asset
- price of 1e8 cToken in USD, scaled by 1e8
set the expiry price in the oracle
requires that the underlying price has been set before setting a cToken price
_expiryTimestamp
: expiry to set a price for
convert underlying price to cToken price with the cToken to underlying exchange rate
_underlyingPrice
: price of 1 underlying token (ie 1e6 USDC, 1e18 WETH) in USD, scaled by 1e8
- price of 1e8 cToken in USD, scaled by 1e8