From 18cd345ab6bc58419c92dd368efd04cacaffd344 Mon Sep 17 00:00:00 2001 From: mrq Date: Fri, 22 Dec 2023 23:49:51 +0100 Subject: [PATCH 1/6] unleached dynamic fees --- Cargo.lock | 2 +- runtime/hydradx/Cargo.toml | 2 +- runtime/hydradx/src/assets.rs | 16 ++++++++-------- runtime/hydradx/src/lib.rs | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a6d3f8bb3..2e57b3b44 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4222,7 +4222,7 @@ dependencies = [ [[package]] name = "hydradx-runtime" -version = "195.0.0" +version = "196.0.0" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", diff --git a/runtime/hydradx/Cargo.toml b/runtime/hydradx/Cargo.toml index ad6abbe45..5ac51b258 100644 --- a/runtime/hydradx/Cargo.toml +++ b/runtime/hydradx/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hydradx-runtime" -version = "195.0.0" +version = "196.0.0" authors = ["GalacticCouncil"] edition = "2021" license = "Apache 2.0" diff --git a/runtime/hydradx/src/assets.rs b/runtime/hydradx/src/assets.rs index e50166310..995cb7334 100644 --- a/runtime/hydradx/src/assets.rs +++ b/runtime/hydradx/src/assets.rs @@ -763,17 +763,17 @@ impl pallet_otc::Config for Runtime { // Dynamic fees parameter_types! { pub AssetFeeParams: FeeParams = FeeParams{ - min_fee: Permill::from_rational(25u32,10000u32), - max_fee: Permill::from_rational(4u32,1000u32), - decay: FixedU128::from_rational(5,1000000), - amplification: FixedU128::one(), + min_fee: Permill::from_rational(25u32,10000u32), // 0.25% + max_fee: Permill::from_rational(5u32,100u32), // 5% + decay: FixedU128::from_rational(1,100000), // 0.001% + amplification: FixedU128::from(2), // 2 }; pub ProtocolFeeParams: FeeParams = FeeParams{ - min_fee: Permill::from_rational(5u32,10000u32), - max_fee: Permill::from_rational(1u32,1000u32), - decay: FixedU128::from_rational(5,1000000), - amplification: FixedU128::one(), + min_fee: Permill::from_rational(5u32,10000u32), // 0.05% + max_fee: Permill::from_rational(25u32,10000u32), // 0.25% + decay: FixedU128::from_rational(1,100000), // 0.001% + amplification: FixedU128::from(2), // 2 }; pub const DynamicFeesOraclePeriod: OraclePeriod = OraclePeriod::Short; diff --git a/runtime/hydradx/src/lib.rs b/runtime/hydradx/src/lib.rs index e30cc3940..eb975f2b9 100644 --- a/runtime/hydradx/src/lib.rs +++ b/runtime/hydradx/src/lib.rs @@ -99,7 +99,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("hydradx"), impl_name: create_runtime_str!("hydradx"), authoring_version: 1, - spec_version: 195, + spec_version: 196, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, From b9ecb9defaec39ceb590022ac09c6119c12871b4 Mon Sep 17 00:00:00 2001 From: mrq Date: Sat, 23 Dec 2023 00:09:57 +0100 Subject: [PATCH 2/6] protocol fees stays the same --- runtime/hydradx/src/assets.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/hydradx/src/assets.rs b/runtime/hydradx/src/assets.rs index 995cb7334..9373cc780 100644 --- a/runtime/hydradx/src/assets.rs +++ b/runtime/hydradx/src/assets.rs @@ -771,9 +771,9 @@ parameter_types! { pub ProtocolFeeParams: FeeParams = FeeParams{ min_fee: Permill::from_rational(5u32,10000u32), // 0.05% - max_fee: Permill::from_rational(25u32,10000u32), // 0.25% - decay: FixedU128::from_rational(1,100000), // 0.001% - amplification: FixedU128::from(2), // 2 + max_fee: Permill::from_rational(1u32,1000u32), // 0.1% + decay: FixedU128::from_rational(5,1000000), // 0.0005% + amplification: FixedU128::one(), // 2 }; pub const DynamicFeesOraclePeriod: OraclePeriod = OraclePeriod::Short; From ba0f32d43699667e44166de340f42f27df7d00d4 Mon Sep 17 00:00:00 2001 From: mrq Date: Sat, 23 Dec 2023 01:01:32 +0100 Subject: [PATCH 3/6] fixed integration tests --- integration-tests/src/dca.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration-tests/src/dca.rs b/integration-tests/src/dca.rs index 4d2799d0d..873377509 100644 --- a/integration-tests/src/dca.rs +++ b/integration-tests/src/dca.rs @@ -2868,7 +2868,7 @@ mod with_onchain_route { assert!(fee > 57 * UNITS / 10); assert_balance!(ALICE.into(), stable_asset_1, alice_init_stable_balance - dca_budget); - assert_balance!(ALICE.into(), HDX, alice_init_hdx_balance + 237185260073197); + assert!(Currencies::free_balance(HDX, &ALICE.into()) > alice_init_hdx_balance); assert_reserved_balance!(&ALICE.into(), stable_asset_1, dca_budget - amount_to_sell - fee); }); @@ -2990,7 +2990,7 @@ mod with_onchain_route { assert!(fee < 38 * UNITS / 10); assert!(fee > 37 * UNITS / 10); - assert_balance!(ALICE.into(), HDX, alice_init_hdx_balance + 278060378846663); + assert!(Currencies::free_balance(HDX, &ALICE.into()) > alice_init_hdx_balance); assert_reserved_balance!(&ALICE.into(), DOT, dca_budget - amount_to_sell - fee); }); } From b47c95199597dfef98005e5c8ed9be2b2c560a3f Mon Sep 17 00:00:00 2001 From: mrq Date: Sat, 23 Dec 2023 01:05:06 +0100 Subject: [PATCH 4/6] bumped versions --- integration-tests/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 0d1881a3a..3b27d4281 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "runtime-integration-tests" -version = "1.16.4" +version = "1.16.5" description = "Integration tests" authors = ["GalacticCouncil"] edition = "2021" From 51e90af1f6e63b4bc0c8134785b47f3dd33861d9 Mon Sep 17 00:00:00 2001 From: mrq Date: Sat, 23 Dec 2023 01:11:53 +0100 Subject: [PATCH 5/6] comment fixed --- runtime/hydradx/src/assets.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/hydradx/src/assets.rs b/runtime/hydradx/src/assets.rs index 9373cc780..7149e9068 100644 --- a/runtime/hydradx/src/assets.rs +++ b/runtime/hydradx/src/assets.rs @@ -765,15 +765,15 @@ parameter_types! { pub AssetFeeParams: FeeParams = FeeParams{ min_fee: Permill::from_rational(25u32,10000u32), // 0.25% max_fee: Permill::from_rational(5u32,100u32), // 5% - decay: FixedU128::from_rational(1,100000), // 0.001% - amplification: FixedU128::from(2), // 2 + decay: FixedU128::from_rational(1,100000), // 0.001% + amplification: FixedU128::from(2), // 2 }; pub ProtocolFeeParams: FeeParams = FeeParams{ min_fee: Permill::from_rational(5u32,10000u32), // 0.05% max_fee: Permill::from_rational(1u32,1000u32), // 0.1% decay: FixedU128::from_rational(5,1000000), // 0.0005% - amplification: FixedU128::one(), // 2 + amplification: FixedU128::one(), // 1 }; pub const DynamicFeesOraclePeriod: OraclePeriod = OraclePeriod::Short; From 111e117ea4c78ea97c24dd9a9d1e22a0bc61a407 Mon Sep 17 00:00:00 2001 From: mrq Date: Sat, 23 Dec 2023 04:44:57 +0100 Subject: [PATCH 6/6] lockfile updated --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 2e57b3b44..bec8b75d5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10768,7 +10768,7 @@ dependencies = [ [[package]] name = "runtime-integration-tests" -version = "1.16.4" +version = "1.16.5" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue",