Skip to content

Conversation

@jayantk
Copy link
Contributor

@jayantk jayantk commented Jun 28, 2022

Bound the range on price account exponents 8 >= expo >= -8 such the the EMA computation can't lose too much precision.

I also verified that all existing price accounts have exponents between -3 and -8 (inclusive).

Copy link

@ptaffet ptaffet left a comment

Choose a reason for hiding this comment

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

Looks good. I didn't check all the existing prices, but this does prevent any new prices with strange exponents. The value is only used when creating a price, so I don't see any potential unintended consequences of this change.

@jayantk jayantk merged commit 467641d into main Jun 29, 2022
@jayantk jayantk deleted the exponent_range_check branch June 29, 2022 16:38
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