Repository navigation
feat: sDOLA to USDC oracle - #26
johnnyonline wants to merge 2 commits into
Conversation
| # DOLA/USDC from the Curve EMA. `price_oracle(0)` is USDS priced in DOLA, so it is inverted | ||
| dola_price: uint256 = min(_WAD * _WAD // staticcall CURVE_POOL.price_oracle(0), _UPPER_BOUND) | ||
|
|
||
| # sDOLA --> DOLA |
| if False, returns WAD format | ||
| @return Price scaled to the required format | ||
| """ | ||
| # DOLA/USDC from the Curve EMA. `price_oracle(0)` is USDS priced in DOLA, so it is inverted |
| assert price > 0, "wtf" | ||
|
|
||
| # Scale price to the required format if needed and return | ||
| return price * _ORACLE_SCALE_FACTOR // _WAD if scaled else price |
There was a problem hiding this comment.
Above Schlag comments are on point. Additionally, price_oracle returns the price of 1 DOLA in sUSDS, not USDS. You are also assuming 1 USDS == 1 USDC.
I'd suggest using the same template that's used for ysyBOLD oracle with depeg mode protection included for downwards movement
There was a problem hiding this comment.
this comment is the opposite way
It's coin1 priced in coin0, so USDS priced in DOLA, and we invert it. So i think it's fine
usds != usdc != usd
Yes. Notice the @dev tag. But also fix this comment
@dev The pool's EMA is in USDS terms, and USDS is atomically redeemable 1:1 for USDC through
the PSM, so it is used as a DOLA/USDC price
price_oracle returns the price of 1 DOLA in sUSDS, not USDS. You are also assuming 1 USDS == 1 USDC.
The pool scales sUSDS by its vault rate, so price_oracle(0) is in USDS terms. If it were sUSDS, it would read ~0.896 per DOLA right now, not 1.0032. And yes, 1 USDS == 1 USDC is deliberate, see the PSM point above
I'd suggest using the same template that's used for ysyBOLD oracle with depeg mode protection included for downwards movement
Was using depeg mode in ysyBOLD because i trust BOLD's redemption mechanism, so a depeg reported by the pool is more likely the pool being off. I trust DOLA's peg less, so if the pool reports a depeg i'd rather follow it and liquidate than floor it
|
LGTM, However, this pools lender should not be yvFlexUSDC because it does not have the same risk standards. Also, the pool is not huge and there are other pools so ideally pools balance would be arbed back and not easily manipulatable. Regardless, the LTV choice should be 80% levels since manipulating the oracle +10% on DOLA requires 1.5m swap and only 2 minutes waiting time (assuming no arbs) |
No description provided.