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

chore: add LP mint calculation for stableswap pools #383

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

kerber0x
Copy link
Contributor

Description and Motivation

This PR fixes the LP mint calculation when providing liquidity for stableswap pairs.

Related Issues


Checklist:

  • I have read Migaloo's contribution guidelines.
  • My pull request has a sound title and description (not something vague like Update index.md)
  • All existing and new tests are passing.
  • I updated/added relevant documentation.
  • The code is formatted properly cargo fmt --all --.
  • Clippy doesn't report any issues cargo clippy -- -D warnings.
  • I have regenerated the schemas if needed cargo schema.

Copy link

codecov bot commented Dec 12, 2024

Codecov Report

Attention: Patch coverage is 22.50000% with 62 lines in your changes missing coverage. Please review.

Project coverage is 92.98%. Comparing base (06cca15) to head (595ed83).

Files with missing lines Patch % Lines
...ity_hub/pool-network/terraswap_pair/src/helpers.rs 0.00% 45 Missing ⚠️
...ty_hub/pool-network/terraswap_pair/src/commands.rs 51.42% 17 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #383      +/-   ##
==========================================
- Coverage   93.21%   92.98%   -0.23%     
==========================================
  Files         219      219              
  Lines       24867    24931      +64     
==========================================
+ Hits        23179    23182       +3     
- Misses       1688     1749      +61     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@0xFable 0xFable left a comment

Choose a reason for hiding this comment

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

Reviewed against the 3pool impl.
LGTM. The n_coins addition to compute_next_d is helpful for making it clear

@kerber0x
Copy link
Contributor Author

Reviewed against the 3pool impl. LGTM. The n_coins addition to compute_next_d is helpful for making it clear

Yeah essentially removed the 3rd parameter from the 3pool and created the n_coins constant.

@kerber0x kerber0x merged commit b8358ed into main Dec 13, 2024
6 of 7 checks passed
@kerber0x kerber0x deleted the feat/stableswap-lp branch December 13, 2024 16:45
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.

2 participants