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

feat(oracle): add twap to oracle and unwire pricefeed #1120

Merged
merged 21 commits into from
Jan 3, 2023

Conversation

matthiasmatt
Copy link
Contributor

@matthiasmatt matthiasmatt commented Dec 20, 2022

Description

Replace the pricefeed with the oracle module. Updated every tests and uses cases of pricefeed to use the oracle logic.

Purpose

Removing pricefeed and adding twap in oracle makes us reduce our codebase by 15k lines of code

@matthiasmatt matthiasmatt changed the title wip: add twap to oracle and unwire pricefeed feat(oracle): add twap to oracle and unwire pricefeed Dec 27, 2022
@matthiasmatt matthiasmatt marked this pull request as ready for review December 27, 2022 20:05
@matthiasmatt matthiasmatt requested a review from a team as a code owner December 27, 2022 20:05
Copy link
Contributor

@NibiruHeisenberg NibiruHeisenberg left a comment

Choose a reason for hiding this comment

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

Overall, much cleaner in test setup. Just some minor comments.

x/oracle/keeper/keeper.go Show resolved Hide resolved
x/oracle/keeper/keeper.go Show resolved Hide resolved
x/oracle/keeper/querier.go Outdated Show resolved Hide resolved
x/oracle/keeper/querier_test.go Show resolved Hide resolved
x/perp/client/cli/cli_test.go Outdated Show resolved Hide resolved
x/stablecoin/keeper/collateral_ratio.go Show resolved Hide resolved
x/oracle/keeper/querier_test.go Outdated Show resolved Hide resolved
@matthiasmatt matthiasmatt enabled auto-merge (squash) January 3, 2023 22:55
@matthiasmatt matthiasmatt merged commit 602af8a into master Jan 3, 2023
@matthiasmatt matthiasmatt deleted the mat/add-oracle-twap branch January 3, 2023 23:08
Unique-Divine added a commit that referenced this pull request Jan 6, 2023
* chore: re-run linter

* test(oracle): stop the tyrannical behavior of tally_fuzz_test.go

* test(oracle): try assert.NotPanics for keys of length 0

* test(oracle): try assert.NotPanics for keys of length 0

* feat,test(common): Create StringSet for easy set management

* test(oracle): Increase coverage and end the collections panics in
GetWhitelistedPairs

* fix(oracle): small bug in TestFuzz_PickReferencePair

* test,feat(common): address PR feedback and add a more generic version fo CombineErrors

* linter

* feat(oracle): add twap to oracle and unwire pricefeed (#1120)

* unwire pricefeed and add twap

* refactor(perp): Remove unnecessary panics | #1 (#1126)

* remove unnecessary panics in x/perp

* change log

* chore: re-run linter

* test(oracle): stop the tyrannical behavior of tally_fuzz_test.go

* test(oracle): try assert.NotPanics for keys of length 0

* feat,test(common): Create StringSet for easy set management

* test(oracle): Increase coverage and end the collections panics in
GetWhitelistedPairs

* fix(oracle): small bug in TestFuzz_PickReferencePair

* test,feat(common): address PR feedback and add a more generic version fo CombineErrors

* linter

* Update x/common/error_test.go

Co-authored-by: NibiruHeisenberg <101130700+NibiruHeisenberg@users.noreply.github.com>

Co-authored-by: NibiruHeisenberg <101130700+NibiruHeisenberg@users.noreply.github.com>

* fix: distribution module account name (#1131)

* refactor(dex): remove unnecessary panics

* refactor(stablecoin): remove unnecessary panics

Co-authored-by: Matthias <97468149+matthiasmatt@users.noreply.github.com>
Co-authored-by: NibiruHeisenberg <101130700+NibiruHeisenberg@users.noreply.github.com>
Unique-Divine added a commit that referenced this pull request Jan 10, 2023
* remove unnecessary panics in x/perp

* refactor(dex): remove panics in liquidity.go

* change log

* chore: change log

* refactor: remove panics from x/dex (#1133)

* chore: re-run linter

* test(oracle): stop the tyrannical behavior of tally_fuzz_test.go

* test(oracle): try assert.NotPanics for keys of length 0

* test(oracle): try assert.NotPanics for keys of length 0

* feat,test(common): Create StringSet for easy set management

* test(oracle): Increase coverage and end the collections panics in
GetWhitelistedPairs

* fix(oracle): small bug in TestFuzz_PickReferencePair

* test,feat(common): address PR feedback and add a more generic version fo CombineErrors

* linter

* feat(oracle): add twap to oracle and unwire pricefeed (#1120)

* unwire pricefeed and add twap

* refactor(perp): Remove unnecessary panics | #1 (#1126)

* remove unnecessary panics in x/perp

* change log

* chore: re-run linter

* test(oracle): stop the tyrannical behavior of tally_fuzz_test.go

* test(oracle): try assert.NotPanics for keys of length 0

* feat,test(common): Create StringSet for easy set management

* test(oracle): Increase coverage and end the collections panics in
GetWhitelistedPairs

* fix(oracle): small bug in TestFuzz_PickReferencePair

* test,feat(common): address PR feedback and add a more generic version fo CombineErrors

* linter

* Update x/common/error_test.go

Co-authored-by: NibiruHeisenberg <101130700+NibiruHeisenberg@users.noreply.github.com>

Co-authored-by: NibiruHeisenberg <101130700+NibiruHeisenberg@users.noreply.github.com>

* fix: distribution module account name (#1131)

* refactor(dex): remove unnecessary panics

* refactor(stablecoin): remove unnecessary panics

Co-authored-by: Matthias <97468149+matthiasmatt@users.noreply.github.com>
Co-authored-by: NibiruHeisenberg <101130700+NibiruHeisenberg@users.noreply.github.com>

Co-authored-by: Matthias <97468149+matthiasmatt@users.noreply.github.com>
Co-authored-by: NibiruHeisenberg <101130700+NibiruHeisenberg@users.noreply.github.com>
k-yang added a commit that referenced this pull request Jan 11, 2023
…sible form public fns (#1134)

* remove unnecessary panics in x/perp

* refactor(dex): remove panics in liquidity.go

* change log

* chore: change log

* chore: re-run linter

* test(oracle): stop the tyrannical behavior of tally_fuzz_test.go

* test(oracle): try assert.NotPanics for keys of length 0

* test(oracle): try assert.NotPanics for keys of length 0

* feat,test(common): Create StringSet for easy set management

* test(oracle): Increase coverage and end the collections panics in
GetWhitelistedPairs

* fix(oracle): small bug in TestFuzz_PickReferencePair

* test,feat(common): address PR feedback and add a more generic version fo CombineErrors

* linter

* refactor(dex): remove unnecessary panics

* refactor(stablecoin): remove unnecessary panics

* refactor(perp): make calls of public fns from vpool less dangerous in
x/perp

* checkpoint #wip vpool

* fix changelog issue from merge conflict

* refactor: remove panics from x/dex (#1133)

* chore: re-run linter

* test(oracle): stop the tyrannical behavior of tally_fuzz_test.go

* test(oracle): try assert.NotPanics for keys of length 0

* test(oracle): try assert.NotPanics for keys of length 0

* feat,test(common): Create StringSet for easy set management

* test(oracle): Increase coverage and end the collections panics in
GetWhitelistedPairs

* fix(oracle): small bug in TestFuzz_PickReferencePair

* test,feat(common): address PR feedback and add a more generic version fo CombineErrors

* linter

* feat(oracle): add twap to oracle and unwire pricefeed (#1120)

* unwire pricefeed and add twap

* refactor(perp): Remove unnecessary panics | #1 (#1126)

* remove unnecessary panics in x/perp

* change log

* chore: re-run linter

* test(oracle): stop the tyrannical behavior of tally_fuzz_test.go

* test(oracle): try assert.NotPanics for keys of length 0

* feat,test(common): Create StringSet for easy set management

* test(oracle): Increase coverage and end the collections panics in
GetWhitelistedPairs

* fix(oracle): small bug in TestFuzz_PickReferencePair

* test,feat(common): address PR feedback and add a more generic version fo CombineErrors

* linter

* Update x/common/error_test.go

Co-authored-by: NibiruHeisenberg <101130700+NibiruHeisenberg@users.noreply.github.com>

Co-authored-by: NibiruHeisenberg <101130700+NibiruHeisenberg@users.noreply.github.com>

* fix: distribution module account name (#1131)

* refactor(dex): remove unnecessary panics

* refactor(stablecoin): remove unnecessary panics

Co-authored-by: Matthias <97468149+matthiasmatt@users.noreply.github.com>
Co-authored-by: NibiruHeisenberg <101130700+NibiruHeisenberg@users.noreply.github.com>

* test,refactor(vpool): make it impossible to write invalid pools into
state.

* refactor: Make it impossible to cause panics in vpool from public fns in
the perp module

* chore(CHANGELOG)

Co-authored-by: Matthias <97468149+matthiasmatt@users.noreply.github.com>
Co-authored-by: NibiruHeisenberg <101130700+NibiruHeisenberg@users.noreply.github.com>
Co-authored-by: Kevin Yang <5478483+k-yang@users.noreply.github.com>
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.

None yet

2 participants