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

test(twap): edge case tests for geometric twap #3541

Closed
p0mvn opened this issue Nov 27, 2022 · 5 comments
Closed

test(twap): edge case tests for geometric twap #3541

p0mvn opened this issue Nov 27, 2022 · 5 comments

Comments

@p0mvn
Copy link
Member

p0mvn commented Nov 27, 2022

Background

Currently, most of the test cases for computeGeometricTwap use base values.

To be more confident about correctness, we should add more test cases with hand-picked custom values.

This is an open-ended task so someone having context on the state of geometric twap should be working on this.

Acceptance Criteria

  • custom tests added if applicable
@p0mvn
Copy link
Member Author

p0mvn commented Dec 21, 2022

need to test this function:

func (s *geometric) computeTwap(startRecord types.TwapRecord, endRecord types.TwapRecord, quoteAsset string) sdk.Dec {

where arithmeticMeanOfLogPrices is negative. It can happen when sp0 is < 1

@p0mvn
Copy link
Member Author

p0mvn commented Dec 21, 2022

Revisit this comment while working on this issue: https://github.com/osmosis-labs/osmosis/pull/3809/files#r1053921196

@p0mvn p0mvn changed the title test(twap): add more hand-calculated custom tests for computeGeometricTwap test(twap): edge case tests for geometric twap Dec 21, 2022
@p0mvn
Copy link
Member Author

p0mvn commented Dec 21, 2022

We need to test underflows.

Context:

    Do we also need to test min spot price, since this can get underflow? (or is that a future PR?)

Originally posted by @ValarDragon in #3809 (comment)

@p0mvn
Copy link
Member Author

p0mvn commented Dec 21, 2022

TODO: perform manual CLI test on completion

@p0mvn
Copy link
Member Author

p0mvn commented Jan 7, 2023

Everything here has been complete but the manual test. Tracking manual test here: #3941

@p0mvn p0mvn closed this as completed Jan 7, 2023
@github-project-automation github-project-automation bot moved this from Needs Review 🔍 to Done ✅ in Osmosis Chain Development Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

1 participant