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: implement MaxSupply #1319

Merged
merged 56 commits into from
Sep 7, 2022
Merged

feat: implement MaxSupply #1319

merged 56 commits into from
Sep 7, 2022

Conversation

toteki
Copy link
Member

@toteki toteki commented Aug 31, 2022

Description

This implements one of the token safety parameters on the leverage checklist.

closes: #1227


Author Checklist

  • 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

@codecov-commenter
Copy link

codecov-commenter commented Sep 1, 2022

Codecov Report

Merging #1319 (2bd1d57) into main (e9782df) will decrease coverage by 0.00%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1319      +/-   ##
==========================================
- Coverage   52.09%   52.09%   -0.01%     
==========================================
  Files          69       69              
  Lines        6816     6828      +12     
==========================================
+ Hits         3551     3557       +6     
- Misses       2988     2992       +4     
- Partials      277      279       +2     
Impacted Files Coverage Δ
x/leverage/keeper/keeper.go 65.92% <50.00%> (-0.75%) ⬇️

Base automatically changed from adam/tests to main September 1, 2022 15:00
@toteki toteki changed the title DNM: implement various token limits feat: implement MaxSupply Sep 1, 2022
@toteki
Copy link
Member Author

toteki commented Sep 1, 2022

Note: this will stay draft while we decide if MaxSupply will remain a flat amount, or be changed to a share of USD value.

Edit: R4R - keeping the simple version for v3

@toteki toteki marked this pull request as ready for review September 2, 2022 18:26
@toteki toteki requested review from a team as code owners September 2, 2022 18:26
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.

Let's use share value with a minimum total collateral to trigger the limitation (can be hardcoded in v3 as 500k I would say - in other words, the MaxSupply check will be triggered only if TotalAllSuply is >= 500k USD)

x/leverage/fixtures/token.go Outdated Show resolved Hide resolved
x/leverage/keeper/keeper_test.go Outdated Show resolved Hide resolved
x/leverage/keeper/keeper_test.go Outdated Show resolved Hide resolved
toteki and others added 4 commits September 6, 2022 13:07
Co-authored-by: Robert Zaremba <robert@zaremba.ch>
Co-authored-by: Robert Zaremba <robert@zaremba.ch>
@toteki toteki requested a review from a team as a code owner September 6, 2022 20:42
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.

Following our discussion, we won't use that functionality. We can:

  • leave this PR in draft
  • or merge and add appropriate comments in the code
    Do as you prefer.

@mergify mergify bot merged commit 5cbf948 into main Sep 7, 2022
@mergify mergify bot deleted the adam/limits branch September 7, 2022 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Limit token supply (token.MaxSupply)
4 participants