Skip to content

Commit

Permalink
Merge pull request #729 from galacticcouncil/unleached-fees
Browse files Browse the repository at this point in the history
feat: unleashed dynamic fees
  • Loading branch information
mrq1911 committed Dec 24, 2023
2 parents 564553c + 111e117 commit 748c5a8
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "runtime-integration-tests"
version = "1.16.4"
version = "1.16.5"
description = "Integration tests"
authors = ["GalacticCouncil"]
edition = "2021"
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/src/dca.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down Expand Up @@ -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);
});
}
Expand Down
2 changes: 1 addition & 1 deletion runtime/hydradx/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hydradx-runtime"
version = "195.0.0"
version = "196.0.0"
authors = ["GalacticCouncil"]
edition = "2021"
license = "Apache 2.0"
Expand Down
16 changes: 8 additions & 8 deletions runtime/hydradx/src/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -763,17 +763,17 @@ impl pallet_otc::Config for Runtime {
// Dynamic fees
parameter_types! {
pub AssetFeeParams: FeeParams<Permill> = 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<Permill> = 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(1u32,1000u32), // 0.1%
decay: FixedU128::from_rational(5,1000000), // 0.0005%
amplification: FixedU128::one(), // 1
};

pub const DynamicFeesOraclePeriod: OraclePeriod = OraclePeriod::Short;
Expand Down
2 changes: 1 addition & 1 deletion runtime/hydradx/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 748c5a8

Please sign in to comment.