-
Notifications
You must be signed in to change notification settings - Fork 8
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
twap at height NTRN-357 #7
Conversation
62554da
to
a652aef
Compare
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.
code looks fine, though I am not sure how are we going to resolve dependency hell with cosmwasm-std and cw-X libraries.
# Conflicts: # Cargo.lock
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.
I believe there's a lack of tests with a height between two snapshots. Current tests cover only cases with exactly those blocks at which the oracle was updated. But in a real situation, the queries will be done to the arbitrary block that in general lies between snapshots. And what is the expected behavior here: do we need to return the past TWAP calculated or the next one (since the block we get a query for lies in the period of time for which the next TWAP is calculated, right?).
Also, out of scope but maybe we should have a todo for it: if we keep the history anyway, shouldn't we allow updating at arbitrary blocks? I mean for any block we can find the previous snapshot that is more than the update period
far away. Or it will lead to more gas consumption?
…r case for non-existing snapshot
TASK
This is a patched
astroport oracle
contract with necessaryastroport contracts
and also some modifications 4 Neutron needs:PERIOD
const is now parametersince the astroport contract has nothing to integrate with at the moment, the tests are implemented directly in the repository (see integration.rs ) discussed w @swelf19
How to test: you don't need to since you're seeing green check mark in this PR