Skip to content
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

forgot to update smoothed price with price scale in switchboard case #175

Merged
merged 2 commits into from
Dec 18, 2023

Conversation

0xripleys
Copy link

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Dec 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (v2.0.3_upcoming@2888452). Click here to learn what that means.

Additional details and impacted files
@@                Coverage Diff                 @@
##             v2.0.3_upcoming     #175   +/-   ##
==================================================
  Coverage                   ?   84.26%           
==================================================
  Files                      ?       51           
  Lines                      ?    19744           
  Branches                   ?        0           
==================================================
  Hits                       ?    16637           
  Misses                     ?     3107           
  Partials                   ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -531,7 +531,7 @@ fn _refresh_reserve<'a>(
// currently there's no way to support two prices without a pyth oracle. So if a reserve
// only supports switchboard, reserve.smoothed_market_price == reserve.market_price
if reserve.liquidity.pyth_oracle_pubkey == solend_program::NULL_PUBKEY {
reserve.liquidity.smoothed_market_price = market_price;
reserve.liquidity.smoothed_market_price = market_price.try_mul(reserve.price_scale())?;
Copy link
Member

Choose a reason for hiding this comment

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

isn't it wasteful to multiply again?

@0xripleys 0xripleys force-pushed the oracle_multiplier_bugfix branch from b3b1b2a to b1ae6bb Compare December 16, 2023 21:11
@0xripleys 0xripleys merged commit 85ca111 into v2.0.3_upcoming Dec 18, 2023
8 checks passed
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