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

x/twap: make get arithmetic twap not interpolate geometric parameters #7113

Open
ValarDragon opened this issue Dec 13, 2023 · 0 comments · May be fixed by #9027
Open

x/twap: make get arithmetic twap not interpolate geometric parameters #7113

ValarDragon opened this issue Dec 13, 2023 · 0 comments · May be fixed by #9027

Comments

@ValarDragon
Copy link
Member

Background

Many osmosis contracts frequently query the arithmetic twap. Right now they are paying a lot in cpu time for interpolating geometric twap records which they are not even using.

We should make arithmetic twap apis not interpolate a geometric twap.

NOTE: this is low priority in terms of optimization, all iavl v1 experimentation should take far more precedence.

Suggested Design

Make an enum for twap strategy (right now it's an interface, make an additional enum)

Thread it to getInterpolatedRecord. Make that only update the relevant entries.

Acceptance Criteria

State machine compatible fix, that makes get arithmetic twap not compute any logs. We can find this out by looking at benchmarks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Triage 🔍
Development

Successfully merging a pull request may close this issue.

1 participant