-
Notifications
You must be signed in to change notification settings - Fork 108
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
OETH L2 Base plugin #1223
OETH L2 Base plugin #1223
Conversation
clement-ux
commented
Oct 30, 2024
- OETH plugin and tests for L2 Base.
|
||
/// @return {ref/tok} Quantity of whole reference units per whole collateral tokens | ||
/// {superOETHb/wsuperOETHb} | ||
function underlyingRefPerTok() public view override returns (uint192) { |
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.
could delete this function entirely if you change the inheritance to ERC4626FiatCollateral
{ | ||
// {tar/tok} | ||
// {ETH/wsuperOETHb} | ||
uint192 targetPerTok = _safeWrap(targetPerTokChainlinkFeed.price()) / 1e18; |
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.
nit: should probably move the paren outside the 1e18 to minimize overflow risk
|
||
/// @param config.chainlinkFeed - ignored | ||
/// @param config.oracleTimeout - ignored | ||
/// @param config.oracleError {1} Should be the oracle error for UoA/tok |
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 should be the combined oracle error I think, since it is applied post-product
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.
Nice catch, indeed. I remove the comment then 👍
wsuperOETHb_ETH: bn(86400), | ||
ETH_USD: bn(1200), | ||
} | ||
export const BASE_ORACLE_ERROR = combinedError( |
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.
what are these 3 errors being added? I was only expecting 2 of them, one per oracle
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.
Thanks, adjusted 👍
|
||
// {tar/ref} = {tar/tok} / {ref/tok} Get current market peg | ||
// ETH/superOETHb = ETH/wsuperOETHb / superOETHb/wsuperOETHb | ||
pegPrice = targetPerTok.div(underlyingRefPerTok()); |
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.
could do pegPrice = FIX_ONE
if these are both operating on the same underlying information