-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
draft steth pricer #439
draft steth pricer #439
Conversation
Sorry for all additional files changes, as needed to lint testing files to CircleCI to pass. |
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.6.10; | ||
|
||
interface STETHInterface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to use the wstETH interface here, which doesn't include getPooledEthByShares.
|
||
import {ERC20Upgradeable} from "../packages/oz/upgradeability/ERC20Upgradeable.sol"; | ||
|
||
contract MockSTETHToken is ERC20Upgradeable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a mock for stETH, but we need a wstETH token, which has doesn't have getPooledEthByShares.
/** | ||
* @notice A Pricer contract for a Yearn yToken | ||
*/ | ||
contract STETHPricer is OpynPricerInterface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should probably call it WSTETHPricer as it is pricing wstETH collateral.
* @return price of 1e8 stETH in USD, scaled by 1e8 | ||
*/ | ||
function _underlyingPriceToSTETHPrice(uint256 _underlyingPrice) private view returns (uint256) { | ||
uint256 pricePerShare = stETH.getPooledEthByShares(1 ether); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we can use stEthPerToken()
from the wstETH contract
* @param _oracle Opyn Oracle contract address | ||
*/ | ||
constructor( | ||
address _stETH, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throughout, I think should change to wstETH to make it clear we are collateralizing with wstETH.
MockPricerInstance, | ||
MockOracleInstance, | ||
MockERC20Instance, | ||
MockSTETHTokenInstance, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests need to be updated w new mocks, interface, functions, etc
Closing this in favor for #440 |
Task: STETH pricer
High Level Description
Specific Changes
Code
Documentation