Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: implement MaxCollateralShare #1329

Merged
merged 7 commits into from
Sep 6, 2022
Merged

feat: implement MaxCollateralShare #1329

merged 7 commits into from
Sep 6, 2022

Conversation

toteki
Copy link
Member

@toteki toteki commented Sep 4, 2022

Description

closes: #1093


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • added appropriate labels to the PR
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@toteki toteki marked this pull request as ready for review September 4, 2022 21:39
@toteki toteki requested review from a team as code owners September 4, 2022 21:39
@codecov-commenter
Copy link

codecov-commenter commented Sep 4, 2022

Codecov Report

Merging #1329 (008fd50) into main (1982eb7) will decrease coverage by 0.01%.
The diff coverage is 54.63%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1329      +/-   ##
==========================================
- Coverage   51.86%   51.85%   -0.02%     
==========================================
  Files          68       69       +1     
  Lines        6677     6754      +77     
==========================================
+ Hits         3463     3502      +39     
- Misses       2947     2979      +32     
- Partials      267      273       +6     
Impacted Files Coverage Δ
x/leverage/keeper/limits.go 15.62% <15.62%> (ø)
x/leverage/keeper/collateral.go 65.45% <64.28%> (+3.48%) ⬆️
x/leverage/keeper/keeper.go 66.80% <87.50%> (+0.56%) ⬆️
x/leverage/keeper/grpc_query.go 61.14% <100.00%> (+0.44%) ⬆️

Copy link
Member

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

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

We decided to implement MaxCollateralShare as a % value

Copy link
Member

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

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

overall looks good. Let's don't calculate GetTotalCollateral twice.

Co-authored-by: Robert Zaremba <robert@zaremba.ch>
Copy link
Member

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

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

pre-approving. Please look at the comments.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Max Collateral Share
4 participants