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: stableswap gradual amplification change #629

Merged
merged 22 commits into from
Jul 6, 2023

Conversation

enthusiastmartin
Copy link
Contributor

This PR introduces gradual change of amplification for stableswap pool.

@github-actions
Copy link

github-actions bot commented Jul 4, 2023

Crate versions that have been updated:

  • hydra-dx-math: v7.3.0 -> v7.4.0
  • pallet-stableswap: v1.3.0 -> v2.0.0

Runtime version has not been increased.

@codecov
Copy link

codecov bot commented Jul 4, 2023

Codecov Report

Patch coverage: 91.26% and project coverage change: +0.22 🎉

Comparison is base (d897478) 64.94% compared to head (e574d29) 65.17%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #629      +/-   ##
==========================================
+ Coverage   64.94%   65.17%   +0.22%     
==========================================
  Files         131      131              
  Lines        9559     9647      +88     
==========================================
+ Hits         6208     6287      +79     
- Misses       3351     3360       +9     
Impacted Files Coverage Δ
pallets/stableswap/src/types.rs 100.00% <ø> (ø)
pallets/stableswap/src/lib.rs 85.10% <83.33%> (-1.15%) ⬇️
math/src/stableswap/math.rs 96.40% <100.00%> (+0.20%) ⬆️
pallets/stableswap/src/benchmarks.rs 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

pallets/stableswap/src/lib.rs Outdated Show resolved Hide resolved
pallets/stableswap/src/lib.rs Show resolved Hide resolved
pallets/stableswap/src/lib.rs Outdated Show resolved Hide resolved
math/src/stableswap/math.rs Outdated Show resolved Hide resolved
pallets/stableswap/src/lib.rs Show resolved Hide resolved
);
ensure!(
pool.final_amplification.get() != final_amplification,
Error::<T>::SameAmplification
Copy link
Member

Choose a reason for hiding this comment

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

what if you want to speed up or slow down ramp up? this check seems not very effective as it could be bypassed by just changing final amp by 1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this just ensures that you dont set the same value as there is now as it does not make any change

Copy link
Member

@mrq1911 mrq1911 Jul 5, 2023

Choose a reason for hiding this comment

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

you can still change it however with the same final amp, as you can set different end block therefore slow down or hasten the change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes. now it is different - this was a case when you had to wait for previous change to finish.

now it makes sense to ensure that the new final amplification != initial ampfliciation, isnt it ?

@enthusiastmartin enthusiastmartin marked this pull request as ready for review July 5, 2023 07:43
@enthusiastmartin enthusiastmartin merged commit 371a6f4 into master Jul 6, 2023
8 checks passed
@enthusiastmartin enthusiastmartin deleted the feat/stableswap-amplification-rework branch July 6, 2023 07:17
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