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(perp): Add user discounts #1594

Merged
merged 17 commits into from
Sep 29, 2023
Merged

feat(perp): Add user discounts #1594

merged 17 commits into from
Sep 29, 2023

Conversation

testinginprod
Copy link
Collaborator

@testinginprod testinginprod commented Sep 19, 2023

Description

Applies fee discounts based on the trader volume in the previous 30days.

Purpose

@testinginprod testinginprod requested a review from a team as a code owner September 19, 2023 10:41
@testinginprod testinginprod marked this pull request as draft September 19, 2023 10:44
@testinginprod testinginprod marked this pull request as ready for review September 19, 2023 10:57

repeated Discount global_discount = 8 [ (gogoproto.nullable) = false ];

repeated CustomDiscount custom_discounts = 9 [ (gogoproto.nullable) = false ];
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this proto breakage should be fine since unreleased, so we can group dnr genesis

@testinginprod testinginprod marked this pull request as draft September 19, 2023 13:03
@testinginprod testinginprod marked this pull request as ready for review September 20, 2023 08:47
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 15 Code Smells

No Coverage information No Coverage information
30.9% 30.9% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@codecov
Copy link

codecov bot commented Sep 25, 2023

Codecov Report

Merging #1594 (85d58c3) into master (0c31eaf) will increase coverage by 0.31%.
The diff coverage is 90.75%.

@@            Coverage Diff             @@
##           master    #1594      +/-   ##
==========================================
+ Coverage   71.21%   71.53%   +0.31%     
==========================================
  Files         186      186              
  Lines       14493    14588      +95     
==========================================
+ Hits        10321    10435     +114     
+ Misses       3520     3505      -15     
+ Partials      652      648       -4     
Files Coverage Δ
x/perp/v2/keeper/keeper.go 92.42% <100.00%> (+1.35%) ⬆️
x/perp/v2/module/genesis.go 98.03% <100.00%> (+23.41%) ⬆️
x/perp/v2/keeper/clearing_house.go 77.41% <25.00%> (-0.08%) ⬇️
x/perp/v2/keeper/dnr.go 89.47% <88.57%> (+22.03%) ⬆️

@testinginprod testinginprod enabled auto-merge (squash) September 28, 2023 08:44
@testinginprod testinginprod merged commit 6e534c9 into master Sep 29, 2023
@testinginprod testinginprod deleted the tip/dnr/discounts branch September 29, 2023 07:05
Unique-Divine pushed a commit that referenced this pull request Sep 29, 2023
* add discounts

* impl genesis

* fix test

* make test more robust

* galaxy brain int encoding fix

* test and optimise

* lint

* CHANGELOG.md

* do merge

* clarify fee variable names in applyDiscountAndRebate func

* refactor dnr_test.go as per PR review

* add genesis tests

---------

Co-authored-by: unknown unknown <unknown@unknown>
Co-authored-by: godismercilex <[email protected]>
Co-authored-by: Jonathan Gimeno <[email protected]>
Unique-Divine added a commit that referenced this pull request Sep 29, 2023
test(tokenfactory): more CLI test coverage

feat(perp): Add user discounts (#1594)

* add discounts

* impl genesis

* fix test

* make test more robust

* galaxy brain int encoding fix

* test and optimise

* lint

* CHANGELOG.md

* do merge

* clarify fee variable names in applyDiscountAndRebate func

* refactor dnr_test.go as per PR review

* add genesis tests

---------

Co-authored-by: unknown unknown <unknown@unknown>
Co-authored-by: godismercilex <[email protected]>
Co-authored-by: Jonathan Gimeno <[email protected]>

feat(perp): Add user discounts (#1594)

* add discounts

* impl genesis

* fix test

* make test more robust

* galaxy brain int encoding fix

* test and optimise

* lint

* CHANGELOG.md

* do merge

* clarify fee variable names in applyDiscountAndRebate func

* refactor dnr_test.go as per PR review

* add genesis tests

---------

Co-authored-by: unknown unknown <unknown@unknown>
Co-authored-by: godismercilex <[email protected]>
Co-authored-by: Jonathan Gimeno <[email protected]>
jgimeno added a commit that referenced this pull request Oct 3, 2023
…ModuleParams (#1607)

* (proto): add some txs and events for token factory

* #wip msg handlers impl

* fix grpc query test

* test(tokenfactory): validate basic and msg server tests

* test(tokenfactory): update module params

* fix(tokenfactory): changelog, linter, put blank CLi commands instead of
panic

* test(tokenfactory): add case for if the denom is not registered in ChangeAdmin

* token factory CLI tests and queries with tests

* test(tokenfactory/types): more coverage

* combo squashed commit: Resolves strange proto break error

test(tokenfactory): more CLI test coverage

feat(perp): Add user discounts (#1594)

* add discounts

* impl genesis

* fix test

* make test more robust

* galaxy brain int encoding fix

* test and optimise

* lint

* CHANGELOG.md

* do merge

* clarify fee variable names in applyDiscountAndRebate func

* refactor dnr_test.go as per PR review

* add genesis tests

---------

Co-authored-by: unknown unknown <unknown@unknown>
Co-authored-by: godismercilex <[email protected]>
Co-authored-by: Jonathan Gimeno <[email protected]>

feat(perp): Add user discounts (#1594)

* add discounts

* impl genesis

* fix test

* make test more robust

* galaxy brain int encoding fix

* test and optimise

* lint

* CHANGELOG.md

* do merge

* clarify fee variable names in applyDiscountAndRebate func

* refactor dnr_test.go as per PR review

* add genesis tests

---------

Co-authored-by: unknown unknown <unknown@unknown>
Co-authored-by: godismercilex <[email protected]>
Co-authored-by: Jonathan Gimeno <[email protected]>

* ci(proto-lint): should refer to the PR, not just the last commit

* ci(proto-lint): supply with github token in buf setup b/c rate limits

---------

Co-authored-by: unknown unknown <unknown@unknown>
Co-authored-by: godismercilex <[email protected]>
Co-authored-by: Jonathan Gimeno <[email protected]>
Co-authored-by: Matthias <[email protected]>
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.

4 participants