-
Notifications
You must be signed in to change notification settings - Fork 124
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
bigz/improve-perp-match-get_fallback_price #797
bigz/improve-perp-match-get_fallback_price #797
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #797 +/- ##
==========================================
+ Coverage 74.52% 74.55% +0.02%
==========================================
Files 126 126
Lines 29603 29643 +40
==========================================
+ Hits 22062 22100 +38
- Misses 7541 7543 +2
|
amm_available_liquidity: u64, | ||
oracle_price: i64, | ||
seconds_til_order_expiry: i64, | ||
) -> DriftResult<i64> { |
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.
should return u64 probably
} else { | ||
oracle_price.safe_add(self.last_bid_price_twap.cast::<i64>()? | ||
.safe_sub(self.historical_oracle_data.last_oracle_price_twap)? | ||
.min(0) |
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.
think it'd be better to min 0 with (last bid price twap - last_oracle_price_twap) so this is never 0?
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.
think thats what its doing already
@@ -771,6 +771,45 @@ impl Default for AMM { | |||
} | |||
|
|||
impl AMM { | |||
pub fn get_fallback_price(self, |
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.
needs tests
No description provided.