-
Notifications
You must be signed in to change notification settings - Fork 602
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
Calculate SpotPrice with Ratios and SigFigs #1176
Conversation
Should I modify all the tests that failed to utilize the 8 sigfigs now? |
I basically would just need to change this test here Just lmk what you would like and I will change accordingly |
Yeah lets fix those other tests with the right value! |
Co-authored-by: Dev Ojha <[email protected]>
Test modified to include sigfigs, now pass |
// spot_price = (Base_supply / Weight_base) / (Quote_supply / Weight_quote) | ||
// spot_price = (weight_quote / weight_base) * (base_supply / quote_supply) |
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.
wait, this says spot_price
is two different things. Or are you suggesting there are two ways to get the value?
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.
They are equivalent! Its intended to show that they're the same, if you simplify the equation in that way
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.
The first equation is how its commonly quoted, but we're computing according to the second equation for the speed and improved precision due to the weight common denominator
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.
LGTM
Closes: #1155
Description