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: integrate stableswap pallet #612

Merged
merged 107 commits into from
Sep 12, 2023
Merged

feat: integrate stableswap pallet #612

merged 107 commits into from
Sep 12, 2023

Conversation

enthusiastmartin
Copy link
Contributor

@enthusiastmartin enthusiastmartin commented Jun 16, 2023

No description provided.

@github-actions
Copy link

github-actions bot commented Jun 16, 2023

Crate versions that have been updated:

  • runtime-integration-tests: v1.11.0 -> v1.12.0
  • pallet-route-executor: v1.0.5 -> v1.0.6
  • pallet-stableswap: v3.0.0 -> v3.1.0
  • hydradx-runtime: v177.0.0 -> v178.0.0

Runtime version has been increased.

@mrq1911 mrq1911 marked this pull request as draft June 23, 2023 13:49
@codecov
Copy link

codecov bot commented Jul 3, 2023

Codecov Report

Patch coverage: 52.85% and project coverage change: -0.29% ⚠️

Comparison is base (9e73337) 69.50% compared to head (506fa20) 69.22%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #612      +/-   ##
==========================================
- Coverage   69.50%   69.22%   -0.29%     
==========================================
  Files         162      163       +1     
  Lines       12633    12884     +251     
==========================================
+ Hits         8781     8919     +138     
- Misses       3852     3965     +113     
Files Changed Coverage Δ
pallets/route-executor/src/lib.rs 91.52% <0.00%> (ø)
pallets/stableswap/src/types.rs 75.00% <0.00%> (+3.00%) ⬆️
runtime/hydradx/src/lib.rs 3.16% <0.00%> (-0.05%) ⬇️
runtime/hydradx/src/migrations.rs 0.00% <ø> (ø)
runtime/hydradx/src/weights/route_executor.rs 0.00% <0.00%> (ø)
runtime/hydradx/src/weights/stableswap.rs 0.00% <0.00%> (ø)
runtime/hydradx/src/assets.rs 69.13% <38.88%> (-15.00%) ⬇️
pallets/stableswap/src/trade_execution.rs 65.38% <59.77%> (+65.38%) ⬆️
pallets/stableswap/src/lib.rs 83.33% <79.06%> (-0.60%) ⬇️
runtime/hydradx/src/benchmarking/route_executor.rs 99.18% <100.00%> (+0.55%) ⬆️

... and 2 files with indirect coverage changes

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

@enthusiastmartin enthusiastmartin marked this pull request as ready for review July 14, 2023 14:10
runtime/hydradx/src/assets.rs Outdated Show resolved Hide resolved
pallets/stableswap/src/weights.rs Show resolved Hide resolved
@@ -34,7 +34,9 @@ hydradx-traits = { workspace = true }
hydradx-adapters = { workspace = true }
pallet-relaychain-info = { workspace = true }
pallet-ema-oracle = { workspace = true }
pallet-stableswap = { workspace = true }
Copy link
Member

Choose a reason for hiding this comment

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

DCA shoudn't be dependent on stableswap at all

runtime/hydradx/src/assets.rs Outdated Show resolved Hide resolved
runtime/hydradx/src/assets.rs Outdated Show resolved Hide resolved
@@ -1,6 +1,6 @@
[package]
name = "hydradx-traits"
version = "2.6.0"
version = "2.6.1"
Copy link
Member

Choose a reason for hiding this comment

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

bump version not necessary

@@ -179,6 +179,7 @@ pub mod weights;
use crate::traits::DemocracyHooks;
pub use conviction::Conviction;
pub use pallet::*;
pub use sp_std::vec;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

wait ..what? why ?

Copy link
Member

Choose a reason for hiding this comment

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

my question exactly

let (amount_in, _) = Self::calculate_in_amount(pool_id, asset_in, asset_out, amount_out)
.map_err(ExecutorError::Error)?;
if asset_out == pool_id {
//I wanna buy 500 shares, how much luqidity i need provide to get 500 shares
Copy link
Member

Choose a reason for hiding this comment

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

remove comment

Self::add_liquidity_shares(who, pool_id, amount_out, asset_in, max_limit)
.map_err(ExecutorError::Error)
} else if asset_in == pool_id {
let shares_amount = max_limit;
Copy link
Member

Choose a reason for hiding this comment

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

inline

@mrq1911 mrq1911 self-requested a review September 12, 2023 21:45
@mrq1911 mrq1911 merged commit 1de2585 into master Sep 12, 2023
8 checks passed
@jak-pan jak-pan deleted the feat/stableswap-runtime branch February 22, 2024 10:50
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