Skip to content

feat: sDOLA to USDC oracle - #26

Open
johnnyonline wants to merge 2 commits into
masterfrom
sdola-market
Open

johnnyonline wants to merge 2 commits into
masterfrom
sdola-market

Conversation

@johnnyonline

Copy link
Copy Markdown
Member

No description provided.

# 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this comment is the opposite way

Comment thread src/periphery/sdola_to_usdc_oracle.vy Outdated
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usds != usdc != usd

assert price > 0, "wtf"

# Scale price to the required format if needed and return
return price * _ORACLE_SCALE_FACTOR // _WAD if scaled else price

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@tapired

tapired commented Oct 18, 2026

Copy link
Copy Markdown

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants