diff --git a/crates/dex-stable/Cargo.toml b/crates/dex-stable/Cargo.toml index 5a86e19179..c51b52cac5 100644 --- a/crates/dex-stable/Cargo.toml +++ b/crates/dex-stable/Cargo.toml @@ -18,6 +18,7 @@ frame-system = { git = "https://github.com/paritytech/substrate", default-featur sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.31" } sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } # Orml dependencies orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "dc39cfddefb10ef0de23655e2c3dcdab66a19404", default-features = false } @@ -27,7 +28,6 @@ orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-li pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31"} [features] default = ["std"] @@ -42,6 +42,7 @@ std = [ "sp-runtime/std", "sp-std/std", "sp-arithmetic/std", + "pallet-timestamp/std", "orml-tokens/std", ] @@ -50,5 +51,6 @@ runtime-benchmarks = [ "frame-system/runtime-benchmarks", "frame-support/runtime-benchmarks", "sp-runtime/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks" ] try-runtime = [ "frame-support/try-runtime" ] diff --git a/crates/dex-stable/src/benchmarking.rs b/crates/dex-stable/src/benchmarking.rs index 3038c09a23..8831ab78d7 100644 --- a/crates/dex-stable/src/benchmarking.rs +++ b/crates/dex-stable/src/benchmarking.rs @@ -5,6 +5,8 @@ use super::*; use crate::Pallet as StablePallet; +use frame_system::Pallet as System; +use pallet_timestamp::Pallet as Timestamp; use frame_benchmarking::v2::*; use frame_support::assert_ok; @@ -17,6 +19,10 @@ const INITIAL_A_VALUE: Balance = 50; const SWAP_FEE: Balance = 10000000; const ADMIN_FEE: Balance = 0; +fn assert_last_event(generic_event: ::RuntimeEvent) { + System::::assert_last_event(generic_event.into()); +} + pub fn lookup_of_account( who: T::AccountId, ) -> <::Lookup as StaticLookup>::Source { @@ -127,7 +133,13 @@ fn setup_meta_pool_and_add_liquidity( meta_pool_id } -#[benchmarks(where T: Config, T::CurrencyId: From)] +#[benchmarks( + where + T: Config, + T::CurrencyId: From, + T: pallet_timestamp::Config, + +)] pub mod benchmarks { use super::*; @@ -415,6 +427,91 @@ pub mod benchmarks { ); } + #[benchmark] + pub fn update_fee_receiver() { + let caller: T::AccountId = whitelisted_caller(); + let base_pool_id = setup_base_pool::(caller.clone(), base_currencies::(T::PoolCurrencyLimit::get())); + + #[extrinsic_call] + _( + RawOrigin::Root, + base_pool_id.clone(), + lookup_of_account::(caller.clone()).into(), + ); + + assert_last_event::( + Event::UpdateAdminFeeReceiver { + pool_id: base_pool_id, + admin_fee_receiver: caller, + } + .into(), + ); + } + + #[benchmark] + pub fn set_swap_fee() { + let caller: T::AccountId = whitelisted_caller(); + let base_pool_id = setup_base_pool::(caller.clone(), base_currencies::(T::PoolCurrencyLimit::get())); + let new_swap_fee = SWAP_FEE * 2; + + #[extrinsic_call] + _(RawOrigin::Root, base_pool_id, new_swap_fee); + + assert_last_event::( + Event::NewSwapFee { + pool_id: base_pool_id, + new_swap_fee, + } + .into(), + ); + } + + #[benchmark] + pub fn set_admin_fee() { + let caller: T::AccountId = whitelisted_caller(); + let base_pool_id = setup_base_pool::(caller.clone(), base_currencies::(T::PoolCurrencyLimit::get())); + let new_admin_fee = MAX_ADMIN_FEE; + + #[extrinsic_call] + _(RawOrigin::Root, base_pool_id, new_admin_fee); + + assert_last_event::( + Event::NewAdminFee { + pool_id: base_pool_id, + new_admin_fee, + } + .into(), + ); + } + + #[benchmark] + pub fn ramp_a() { + let caller: T::AccountId = whitelisted_caller(); + let base_pool_id = setup_base_pool::(caller.clone(), base_currencies::(T::PoolCurrencyLimit::get())); + + Timestamp::::set_timestamp(Timestamp::::get() + (DAY * 1000).into()); + + #[extrinsic_call] + _(RawOrigin::Root, base_pool_id, 100, (MIN_RAMP_TIME * 2).into()); + } + + #[benchmark] + pub fn stop_ramp_a() { + let caller: T::AccountId = whitelisted_caller(); + let base_pool_id = setup_base_pool::(caller.clone(), base_currencies::(T::PoolCurrencyLimit::get())); + + Timestamp::::set_timestamp(Timestamp::::get() + (DAY * 1000).into()); + assert_ok!(StablePallet::::ramp_a( + RawOrigin::Root.into(), + base_pool_id, + 100, + (MIN_RAMP_TIME * 2).into() + )); + + #[extrinsic_call] + _(RawOrigin::Root, base_pool_id); + } + #[benchmark] pub fn withdraw_admin_fee() { let caller: T::AccountId = whitelisted_caller(); diff --git a/crates/dex-stable/src/default_weights.rs b/crates/dex-stable/src/default_weights.rs index f020265fea..2d3d9e41d8 100644 --- a/crates/dex-stable/src/default_weights.rs +++ b/crates/dex-stable/src/default_weights.rs @@ -2,13 +2,13 @@ //! Autogenerated weights for dex_stable //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-04-27, STEPS: `100`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-07-10, STEPS: `10`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `enterprise`, CPU: `Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz` +//! HOSTNAME: ``, CPU: `Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: -// target/release/interbtc-parachain +// ./target/debug/interbtc-parachain // benchmark // pallet // --pallet @@ -20,11 +20,11 @@ // --execution=wasm // --wasm-execution=compiled // --steps -// 100 -// --repeat // 10 +// --repeat +// 1 // --output -// crates/dex-stable/src/default_weights.rs +// ./crates/dex-stable/src/default_weights.rs // --template // .deploy/default-weight-template.hbs @@ -50,6 +50,11 @@ pub trait WeightInfo { fn swap_pool_from_base() -> Weight; fn swap_pool_to_base() -> Weight; fn swap_meta_pool_underlying() -> Weight; + fn update_fee_receiver() -> Weight; + fn set_swap_fee() -> Weight; + fn set_admin_fee() -> Weight; + fn ramp_a() -> Weight; + fn stop_ramp_a() -> Weight; fn withdraw_admin_fee() -> Weight; } @@ -66,16 +71,14 @@ impl WeightInfo for SubstrateWeight { /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) /// The range of component `b` is `[2, 10]`. /// The range of component `s` is `[0, 50]`. - fn create_base_pool(b: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1257` - // Estimated: `8899` - // Minimum execution time: 46_508_000 picoseconds. - Weight::from_parts(56_808_830, 8899) - // Standard Error: 548_424 - .saturating_add(Weight::from_parts(8_832_018, 0).saturating_mul(b.into())) - // Standard Error: 93_664 - .saturating_add(Weight::from_parts(378_381, 0).saturating_mul(s.into())) + fn create_base_pool(b: u32, _s: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `175` + // Estimated: `4281` + // Minimum execution time: 916_670_000 picoseconds. + Weight::from_parts(919_757_381, 4281) + // Standard Error: 342_208 + .saturating_add(Weight::from_parts(636_884, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -93,14 +96,16 @@ impl WeightInfo for SubstrateWeight { /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) /// The range of component `m` is `[2, 10]`. /// The range of component `s` is `[0, 50]`. - fn create_meta_pool(m: u32, _s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `2535` - // Estimated: `17709` - // Minimum execution time: 85_453_000 picoseconds. - Weight::from_parts(119_901_479, 17709) - // Standard Error: 270_051 - .saturating_add(Weight::from_parts(767_630, 0).saturating_mul(m.into())) + fn create_meta_pool(m: u32, s: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1355` + // Estimated: `7572` + // Minimum execution time: 1_503_250_000 picoseconds. + Weight::from_parts(1_502_944_770, 7572) + // Standard Error: 540_044 + .saturating_add(Weight::from_parts(1_239_121, 0).saturating_mul(m.into())) + // Standard Error: 93_118 + .saturating_add(Weight::from_parts(28_573, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -117,12 +122,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `b` is `[2, 10]`. fn add_liquidity(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2261 + b * (156 ±0)` - // Estimated: `11497 + b * (5180 ±0)` - // Minimum execution time: 138_770_000 picoseconds. - Weight::from_parts(117_368_533, 11497) - // Standard Error: 1_611_993 - .saturating_add(Weight::from_parts(41_756_999, 0).saturating_mul(b.into())) + // Measured: `948 + b * (125 ±0)` + // Estimated: `4281 + b * (5180 ±0)` + // Minimum execution time: 3_210_910_000 picoseconds. + Weight::from_parts(1_441_430_268, 4281) + // Standard Error: 1_354_963 + .saturating_add(Weight::from_parts(890_474_809, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(4_u64)) @@ -139,10 +144,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn swap() -> Weight { // Proof Size summary in bytes: - // Measured: `3545` - // Estimated: `16757` - // Minimum execution time: 167_499_000 picoseconds. - Weight::from_parts(168_870_000, 16757) + // Measured: `2108` + // Estimated: `11350` + // Minimum execution time: 2_124_728_000 picoseconds. + Weight::from_parts(2_124_728_000, 11350) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -157,12 +162,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `b` is `[2, 10]`. fn remove_liquidity(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2268 + b * (254 ±0)` - // Estimated: `10994 + b * (5180 ±0)` - // Minimum execution time: 115_293_000 picoseconds. - Weight::from_parts(107_102_308, 10994) - // Standard Error: 291_001 - .saturating_add(Weight::from_parts(17_781_961, 0).saturating_mul(b.into())) + // Measured: `1057 + b * (192 ±0)` + // Estimated: `4281 + b * (5180 ±0)` + // Minimum execution time: 2_508_427_000 picoseconds. + Weight::from_parts(1_310_215_731, 4281) + // Standard Error: 2_894_576 + .saturating_add(Weight::from_parts(597_251_690, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) @@ -181,10 +186,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn remove_liquidity_one_currency() -> Weight { // Proof Size summary in bytes: - // Measured: `3478` - // Estimated: `16677` - // Minimum execution time: 140_894_000 picoseconds. - Weight::from_parts(142_052_000, 16677) + // Measured: `2207` + // Estimated: `8760` + // Minimum execution time: 2_162_966_000 picoseconds. + Weight::from_parts(2_162_966_000, 8760) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -201,12 +206,12 @@ impl WeightInfo for SubstrateWeight { /// The range of component `b` is `[2, 10]`. fn remove_liquidity_imbalance(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2310 + b * (254 ±0)` - // Estimated: `11497 + b * (5180 ±0)` - // Minimum execution time: 135_935_000 picoseconds. - Weight::from_parts(180_491_462, 11497) - // Standard Error: 891_745 - .saturating_add(Weight::from_parts(16_288_535, 0).saturating_mul(b.into())) + // Measured: `1099 + b * (192 ±0)` + // Estimated: `4281 + b * (5180 ±0)` + // Minimum execution time: 2_578_097_000 picoseconds. + Weight::from_parts(1_363_997_946, 4281) + // Standard Error: 2_737_164 + .saturating_add(Weight::from_parts(605_998_438, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) @@ -227,14 +232,14 @@ impl WeightInfo for SubstrateWeight { /// The range of component `m` is `[2, 10]`. fn add_pool_and_base_pool_liquidity(b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2855 + b * (249 ±0) + m * (148 ±0)` - // Estimated: `17298 + b * (5180 ±0) + m * (5180 ±0)` - // Minimum execution time: 456_171_000 picoseconds. - Weight::from_parts(118_944_947, 17298) - // Standard Error: 60_889 - .saturating_add(Weight::from_parts(27_809_259, 0).saturating_mul(b.into())) - // Standard Error: 60_889 - .saturating_add(Weight::from_parts(32_816_221, 0).saturating_mul(m.into())) + // Measured: `1437 + b * (187 ±0) + m * (121 ±0)` + // Estimated: `7572 + b * (5180 ±0) + m * (5180 ±0)` + // Minimum execution time: 11_621_567_000 picoseconds. + Weight::from_parts(2_534_893_161, 7572) + // Standard Error: 3_088_077 + .saturating_add(Weight::from_parts(728_396_446, 0).saturating_mul(b.into())) + // Standard Error: 3_088_077 + .saturating_add(Weight::from_parts(891_369_077, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(m.into()))) @@ -256,14 +261,14 @@ impl WeightInfo for SubstrateWeight { /// The range of component `m` is `[2, 10]`. fn remove_pool_and_base_pool_liquidity(b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2996 + b * (249 ±0) + m * (246 ±0)` - // Estimated: `19398 + b * (5180 ±0) + m * (5180 ±0)` - // Minimum execution time: 365_549_000 picoseconds. - Weight::from_parts(139_954_949, 19398) - // Standard Error: 49_475 - .saturating_add(Weight::from_parts(19_722_177, 0).saturating_mul(b.into())) - // Standard Error: 49_475 - .saturating_add(Weight::from_parts(19_555_412, 0).saturating_mul(m.into())) + // Measured: `1658 + b * (187 ±0) + m * (187 ±0)` + // Estimated: `7572 + b * (5180 ±0) + m * (5180 ±0)` + // Minimum execution time: 9_573_786_000 picoseconds. + Weight::from_parts(2_455_076_475, 7572) + // Standard Error: 1_898_754 + .saturating_add(Weight::from_parts(595_010_180, 0).saturating_mul(b.into())) + // Standard Error: 1_898_754 + .saturating_add(Weight::from_parts(595_907_886, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(m.into()))) @@ -285,10 +290,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn remove_pool_and_base_pool_liquidity_one_currency() -> Weight { // Proof Size summary in bytes: - // Measured: `5442` - // Estimated: `30261` - // Minimum execution time: 251_896_000 picoseconds. - Weight::from_parts(253_213_000, 30261) + // Measured: `4012` + // Estimated: `13940` + // Minimum execution time: 4_092_900_000 picoseconds. + Weight::from_parts(4_092_900_000, 13940) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(9_u64)) } @@ -304,10 +309,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn swap_pool_from_base() -> Weight { // Proof Size summary in bytes: - // Measured: `6122` - // Estimated: `51048` - // Minimum execution time: 304_620_000 picoseconds. - Weight::from_parts(306_614_000, 51048) + // Measured: `4279` + // Estimated: `39840` + // Minimum execution time: 5_632_323_000 picoseconds. + Weight::from_parts(5_632_323_000, 39840) .saturating_add(T::DbWeight::get().reads(20_u64)) .saturating_add(T::DbWeight::get().writes(9_u64)) } @@ -323,10 +328,10 @@ impl WeightInfo for SubstrateWeight { /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) fn swap_pool_to_base() -> Weight { // Proof Size summary in bytes: - // Measured: `5638` - // Estimated: `30341` - // Minimum execution time: 240_873_000 picoseconds. - Weight::from_parts(242_718_000, 30341) + // Measured: `4042` + // Estimated: `16530` + // Minimum execution time: 4_091_654_000 picoseconds. + Weight::from_parts(4_091_654_000, 16530) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(9_u64)) } @@ -340,23 +345,82 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn swap_meta_pool_underlying() -> Weight { // Proof Size summary in bytes: - // Measured: `3930` - // Estimated: `16757` - // Minimum execution time: 130_616_000 picoseconds. - Weight::from_parts(131_228_000, 16757) + // Measured: `2459` + // Estimated: `11350` + // Minimum execution time: 2_191_031_000 picoseconds. + Weight::from_parts(2_191_031_000, 11350) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: DexStable Pools (r:1 w:1) /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) + fn update_fee_receiver() -> Weight { + // Proof Size summary in bytes: + // Measured: `874` + // Estimated: `4281` + // Minimum execution time: 504_559_000 picoseconds. + Weight::from_parts(504_559_000, 4281) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: DexStable Pools (r:1 w:1) + /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) + fn set_swap_fee() -> Weight { + // Proof Size summary in bytes: + // Measured: `874` + // Estimated: `4281` + // Minimum execution time: 511_753_000 picoseconds. + Weight::from_parts(511_753_000, 4281) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: DexStable Pools (r:1 w:1) + /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) + fn set_admin_fee() -> Weight { + // Proof Size summary in bytes: + // Measured: `874` + // Estimated: `4281` + // Minimum execution time: 502_861_000 picoseconds. + Weight::from_parts(502_861_000, 4281) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: DexStable Pools (r:1 w:1) + /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) + fn ramp_a() -> Weight { + // Proof Size summary in bytes: + // Measured: `968` + // Estimated: `4281` + // Minimum execution time: 640_661_000 picoseconds. + Weight::from_parts(640_661_000, 4281) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: DexStable Pools (r:1 w:1) + /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + fn stop_ramp_a() -> Weight { + // Proof Size summary in bytes: + // Measured: `968` + // Estimated: `4281` + // Minimum execution time: 637_219_000 picoseconds. + Weight::from_parts(637_219_000, 4281) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: DexStable Pools (r:1 w:1) + /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:10 w:0) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) fn withdraw_admin_fee() -> Weight { // Proof Size summary in bytes: - // Measured: `3179` - // Estimated: `29191` - // Minimum execution time: 126_289_000 picoseconds. - Weight::from_parts(127_157_000, 29191) + // Measured: `1843` + // Estimated: `26890` + // Minimum execution time: 2_877_901_000 picoseconds. + Weight::from_parts(2_877_901_000, 26890) .saturating_add(T::DbWeight::get().reads(11_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -374,16 +438,14 @@ impl WeightInfo for () { /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) /// The range of component `b` is `[2, 10]`. /// The range of component `s` is `[0, 50]`. - fn create_base_pool(b: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1257` - // Estimated: `8899` - // Minimum execution time: 46_508_000 picoseconds. - Weight::from_parts(56_808_830, 8899) - // Standard Error: 548_424 - .saturating_add(Weight::from_parts(8_832_018, 0).saturating_mul(b.into())) - // Standard Error: 93_664 - .saturating_add(Weight::from_parts(378_381, 0).saturating_mul(s.into())) + fn create_base_pool(b: u32, _s: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `175` + // Estimated: `4281` + // Minimum execution time: 916_670_000 picoseconds. + Weight::from_parts(919_757_381, 4281) + // Standard Error: 342_208 + .saturating_add(Weight::from_parts(636_884, 0).saturating_mul(b.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -401,14 +463,16 @@ impl WeightInfo for () { /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) /// The range of component `m` is `[2, 10]`. /// The range of component `s` is `[0, 50]`. - fn create_meta_pool(m: u32, _s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `2535` - // Estimated: `17709` - // Minimum execution time: 85_453_000 picoseconds. - Weight::from_parts(119_901_479, 17709) - // Standard Error: 270_051 - .saturating_add(Weight::from_parts(767_630, 0).saturating_mul(m.into())) + fn create_meta_pool(m: u32, s: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1355` + // Estimated: `7572` + // Minimum execution time: 1_503_250_000 picoseconds. + Weight::from_parts(1_502_944_770, 7572) + // Standard Error: 540_044 + .saturating_add(Weight::from_parts(1_239_121, 0).saturating_mul(m.into())) + // Standard Error: 93_118 + .saturating_add(Weight::from_parts(28_573, 0).saturating_mul(s.into())) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -425,12 +489,12 @@ impl WeightInfo for () { /// The range of component `b` is `[2, 10]`. fn add_liquidity(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2261 + b * (156 ±0)` - // Estimated: `11497 + b * (5180 ±0)` - // Minimum execution time: 138_770_000 picoseconds. - Weight::from_parts(117_368_533, 11497) - // Standard Error: 1_611_993 - .saturating_add(Weight::from_parts(41_756_999, 0).saturating_mul(b.into())) + // Measured: `948 + b * (125 ±0)` + // Estimated: `4281 + b * (5180 ±0)` + // Minimum execution time: 3_210_910_000 picoseconds. + Weight::from_parts(1_441_430_268, 4281) + // Standard Error: 1_354_963 + .saturating_add(Weight::from_parts(890_474_809, 0).saturating_mul(b.into())) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(RocksDbWeight::get().writes(4_u64)) @@ -447,10 +511,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn swap() -> Weight { // Proof Size summary in bytes: - // Measured: `3545` - // Estimated: `16757` - // Minimum execution time: 167_499_000 picoseconds. - Weight::from_parts(168_870_000, 16757) + // Measured: `2108` + // Estimated: `11350` + // Minimum execution time: 2_124_728_000 picoseconds. + Weight::from_parts(2_124_728_000, 11350) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -465,12 +529,12 @@ impl WeightInfo for () { /// The range of component `b` is `[2, 10]`. fn remove_liquidity(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2268 + b * (254 ±0)` - // Estimated: `10994 + b * (5180 ±0)` - // Minimum execution time: 115_293_000 picoseconds. - Weight::from_parts(107_102_308, 10994) - // Standard Error: 291_001 - .saturating_add(Weight::from_parts(17_781_961, 0).saturating_mul(b.into())) + // Measured: `1057 + b * (192 ±0)` + // Estimated: `4281 + b * (5180 ±0)` + // Minimum execution time: 2_508_427_000 picoseconds. + Weight::from_parts(1_310_215_731, 4281) + // Standard Error: 2_894_576 + .saturating_add(Weight::from_parts(597_251_690, 0).saturating_mul(b.into())) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(RocksDbWeight::get().writes(3_u64)) @@ -489,10 +553,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn remove_liquidity_one_currency() -> Weight { // Proof Size summary in bytes: - // Measured: `3478` - // Estimated: `16677` - // Minimum execution time: 140_894_000 picoseconds. - Weight::from_parts(142_052_000, 16677) + // Measured: `2207` + // Estimated: `8760` + // Minimum execution time: 2_162_966_000 picoseconds. + Weight::from_parts(2_162_966_000, 8760) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -509,12 +573,12 @@ impl WeightInfo for () { /// The range of component `b` is `[2, 10]`. fn remove_liquidity_imbalance(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2310 + b * (254 ±0)` - // Estimated: `11497 + b * (5180 ±0)` - // Minimum execution time: 135_935_000 picoseconds. - Weight::from_parts(180_491_462, 11497) - // Standard Error: 891_745 - .saturating_add(Weight::from_parts(16_288_535, 0).saturating_mul(b.into())) + // Measured: `1099 + b * (192 ±0)` + // Estimated: `4281 + b * (5180 ±0)` + // Minimum execution time: 2_578_097_000 picoseconds. + Weight::from_parts(1_363_997_946, 4281) + // Standard Error: 2_737_164 + .saturating_add(Weight::from_parts(605_998_438, 0).saturating_mul(b.into())) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(RocksDbWeight::get().writes(3_u64)) @@ -535,14 +599,14 @@ impl WeightInfo for () { /// The range of component `m` is `[2, 10]`. fn add_pool_and_base_pool_liquidity(b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2855 + b * (249 ±0) + m * (148 ±0)` - // Estimated: `17298 + b * (5180 ±0) + m * (5180 ±0)` - // Minimum execution time: 456_171_000 picoseconds. - Weight::from_parts(118_944_947, 17298) - // Standard Error: 60_889 - .saturating_add(Weight::from_parts(27_809_259, 0).saturating_mul(b.into())) - // Standard Error: 60_889 - .saturating_add(Weight::from_parts(32_816_221, 0).saturating_mul(m.into())) + // Measured: `1437 + b * (187 ±0) + m * (121 ±0)` + // Estimated: `7572 + b * (5180 ±0) + m * (5180 ±0)` + // Minimum execution time: 11_621_567_000 picoseconds. + Weight::from_parts(2_534_893_161, 7572) + // Standard Error: 3_088_077 + .saturating_add(Weight::from_parts(728_396_446, 0).saturating_mul(b.into())) + // Standard Error: 3_088_077 + .saturating_add(Weight::from_parts(891_369_077, 0).saturating_mul(m.into())) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(m.into()))) @@ -564,14 +628,14 @@ impl WeightInfo for () { /// The range of component `m` is `[2, 10]`. fn remove_pool_and_base_pool_liquidity(b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2996 + b * (249 ±0) + m * (246 ±0)` - // Estimated: `19398 + b * (5180 ±0) + m * (5180 ±0)` - // Minimum execution time: 365_549_000 picoseconds. - Weight::from_parts(139_954_949, 19398) - // Standard Error: 49_475 - .saturating_add(Weight::from_parts(19_722_177, 0).saturating_mul(b.into())) - // Standard Error: 49_475 - .saturating_add(Weight::from_parts(19_555_412, 0).saturating_mul(m.into())) + // Measured: `1658 + b * (187 ±0) + m * (187 ±0)` + // Estimated: `7572 + b * (5180 ±0) + m * (5180 ±0)` + // Minimum execution time: 9_573_786_000 picoseconds. + Weight::from_parts(2_455_076_475, 7572) + // Standard Error: 1_898_754 + .saturating_add(Weight::from_parts(595_010_180, 0).saturating_mul(b.into())) + // Standard Error: 1_898_754 + .saturating_add(Weight::from_parts(595_907_886, 0).saturating_mul(m.into())) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(m.into()))) @@ -593,10 +657,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn remove_pool_and_base_pool_liquidity_one_currency() -> Weight { // Proof Size summary in bytes: - // Measured: `5442` - // Estimated: `30261` - // Minimum execution time: 251_896_000 picoseconds. - Weight::from_parts(253_213_000, 30261) + // Measured: `4012` + // Estimated: `13940` + // Minimum execution time: 4_092_900_000 picoseconds. + Weight::from_parts(4_092_900_000, 13940) .saturating_add(RocksDbWeight::get().reads(12_u64)) .saturating_add(RocksDbWeight::get().writes(9_u64)) } @@ -612,10 +676,10 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn swap_pool_from_base() -> Weight { // Proof Size summary in bytes: - // Measured: `6122` - // Estimated: `51048` - // Minimum execution time: 304_620_000 picoseconds. - Weight::from_parts(306_614_000, 51048) + // Measured: `4279` + // Estimated: `39840` + // Minimum execution time: 5_632_323_000 picoseconds. + Weight::from_parts(5_632_323_000, 39840) .saturating_add(RocksDbWeight::get().reads(20_u64)) .saturating_add(RocksDbWeight::get().writes(9_u64)) } @@ -631,10 +695,10 @@ impl WeightInfo for () { /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) fn swap_pool_to_base() -> Weight { // Proof Size summary in bytes: - // Measured: `5638` - // Estimated: `30341` - // Minimum execution time: 240_873_000 picoseconds. - Weight::from_parts(242_718_000, 30341) + // Measured: `4042` + // Estimated: `16530` + // Minimum execution time: 4_091_654_000 picoseconds. + Weight::from_parts(4_091_654_000, 16530) .saturating_add(RocksDbWeight::get().reads(12_u64)) .saturating_add(RocksDbWeight::get().writes(9_u64)) } @@ -648,23 +712,82 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn swap_meta_pool_underlying() -> Weight { // Proof Size summary in bytes: - // Measured: `3930` - // Estimated: `16757` - // Minimum execution time: 130_616_000 picoseconds. - Weight::from_parts(131_228_000, 16757) + // Measured: `2459` + // Estimated: `11350` + // Minimum execution time: 2_191_031_000 picoseconds. + Weight::from_parts(2_191_031_000, 11350) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } /// Storage: DexStable Pools (r:1 w:1) /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) + fn update_fee_receiver() -> Weight { + // Proof Size summary in bytes: + // Measured: `874` + // Estimated: `4281` + // Minimum execution time: 504_559_000 picoseconds. + Weight::from_parts(504_559_000, 4281) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: DexStable Pools (r:1 w:1) + /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) + fn set_swap_fee() -> Weight { + // Proof Size summary in bytes: + // Measured: `874` + // Estimated: `4281` + // Minimum execution time: 511_753_000 picoseconds. + Weight::from_parts(511_753_000, 4281) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: DexStable Pools (r:1 w:1) + /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) + fn set_admin_fee() -> Weight { + // Proof Size summary in bytes: + // Measured: `874` + // Estimated: `4281` + // Minimum execution time: 502_861_000 picoseconds. + Weight::from_parts(502_861_000, 4281) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: DexStable Pools (r:1 w:1) + /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) + fn ramp_a() -> Weight { + // Proof Size summary in bytes: + // Measured: `968` + // Estimated: `4281` + // Minimum execution time: 640_661_000 picoseconds. + Weight::from_parts(640_661_000, 4281) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: DexStable Pools (r:1 w:1) + /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + fn stop_ramp_a() -> Weight { + // Proof Size summary in bytes: + // Measured: `968` + // Estimated: `4281` + // Minimum execution time: 637_219_000 picoseconds. + Weight::from_parts(637_219_000, 4281) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: DexStable Pools (r:1 w:1) + /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:10 w:0) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) fn withdraw_admin_fee() -> Weight { // Proof Size summary in bytes: - // Measured: `3179` - // Estimated: `29191` - // Minimum execution time: 126_289_000 picoseconds. - Weight::from_parts(127_157_000, 29191) + // Measured: `1843` + // Estimated: `26890` + // Minimum execution time: 2_877_901_000 picoseconds. + Weight::from_parts(2_877_901_000, 26890) .saturating_add(RocksDbWeight::get().reads(11_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } diff --git a/crates/dex-stable/src/lib.rs b/crates/dex-stable/src/lib.rs index ec6884047b..a0c47c60b0 100644 --- a/crates/dex-stable/src/lib.rs +++ b/crates/dex-stable/src/lib.rs @@ -865,7 +865,7 @@ pub mod pallet { /// - `pool_id`: The id of pool. /// - `fee_receiver`: The new admin fee receiver of this pool. #[pallet::call_index(13)] - #[pallet::weight(1_000_000)] + #[pallet::weight(T::WeightInfo::update_fee_receiver())] #[transactional] pub fn update_fee_receiver( origin: OriginFor, @@ -895,7 +895,7 @@ pub mod pallet { /// - `pool_id`: The id of pool. /// - `new_swap_fee`: The new swap fee of this pool. #[pallet::call_index(14)] - #[pallet::weight(1_000_000)] + #[pallet::weight(T::WeightInfo::set_swap_fee())] #[transactional] pub fn set_swap_fee(origin: OriginFor, pool_id: T::PoolId, new_swap_fee: Number) -> DispatchResult { ensure_root(origin)?; @@ -919,7 +919,7 @@ pub mod pallet { /// - `pool_id`: The id of pool. /// - `new_admin_fee`: The new admin fee of this pool. #[pallet::call_index(15)] - #[pallet::weight(1_000_000)] + #[pallet::weight(T::WeightInfo::set_admin_fee())] #[transactional] pub fn set_admin_fee(origin: OriginFor, pool_id: T::PoolId, new_admin_fee: Number) -> DispatchResult { ensure_root(origin)?; @@ -946,7 +946,7 @@ pub mod pallet { /// - `future_a`: The new A to ramp towards. /// - `future_a_time`: Timestamp when the new A should be reached #[pallet::call_index(16)] - #[pallet::weight(1_000_000)] + #[pallet::weight(T::WeightInfo::ramp_a())] #[transactional] pub fn ramp_a( origin: OriginFor, @@ -1032,7 +1032,7 @@ pub mod pallet { /// /// - `pool_id`: The id of pool. #[pallet::call_index(17)] - #[pallet::weight(1_000_000)] + #[pallet::weight(T::WeightInfo::stop_ramp_a())] #[transactional] pub fn stop_ramp_a(origin: OriginFor, pool_id: T::PoolId) -> DispatchResult { ensure_root(origin)?; diff --git a/parachain/runtime/interlay/src/lib.rs b/parachain/runtime/interlay/src/lib.rs index 454da8eb66..5f67a6138c 100644 --- a/parachain/runtime/interlay/src/lib.rs +++ b/parachain/runtime/interlay/src/lib.rs @@ -1265,7 +1265,7 @@ construct_runtime! { // # Lending & AMM Loans: loans::{Pallet, Call, Storage, Event, Config} = 100, DexGeneral: dex_general::{Pallet, Call, Storage, Event} = 101, - DexStable: dex_stable::{Pallet, Call, Storage, Event} = 102, // note: calls disabled + DexStable: dex_stable::{Pallet, Call, Storage, Event} = 102, DexSwapRouter: dex_swap_router::{Pallet, Call, Event} = 103, } } diff --git a/parachain/runtime/interlay/src/weights/dex_stable.rs b/parachain/runtime/interlay/src/weights/dex_stable.rs index f3e728c078..fd2d52d05e 100644 --- a/parachain/runtime/interlay/src/weights/dex_stable.rs +++ b/parachain/runtime/interlay/src/weights/dex_stable.rs @@ -2,17 +2,17 @@ //! Autogenerated weights for dex_stable //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-07-10, STEPS: `10`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: ``, CPU: `Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: -// target/release/interbtc-parachain +// ./target/debug/interbtc-parachain // benchmark // pallet // --pallet -// * +// dex-stable // --extrinsic // * // --chain @@ -20,11 +20,11 @@ // --execution=wasm // --wasm-execution=compiled // --steps -// 50 -// --repeat // 10 +// --repeat +// 1 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights // --template // .deploy/runtime-weight-template.hbs @@ -50,14 +50,16 @@ impl dex_stable::WeightInfo for WeightInfo { /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) /// The range of component `b` is `[2, 10]`. /// The range of component `s` is `[0, 50]`. - fn create_base_pool (b: u32, _s: u32, ) -> Weight { + fn create_base_pool (b: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `175` - // Estimated: `12859` - // Minimum execution time: 67_494_000 picoseconds. - Weight::from_parts(74_169_342, 12859) - // Standard Error: 139_385 - .saturating_add(Weight::from_parts(181_221, 0).saturating_mul(b.into())) + // Estimated: `4281` + // Minimum execution time: 926_937_000 picoseconds. + Weight::from_parts(892_440_860, 4281) + // Standard Error: 2_385_481 + .saturating_add(Weight::from_parts(4_499_300, 0).saturating_mul(b.into())) + // Standard Error: 411_324 + .saturating_add(Weight::from_parts(458_537, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -75,12 +77,16 @@ impl dex_stable::WeightInfo for WeightInfo { /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) /// The range of component `m` is `[2, 10]`. /// The range of component `s` is `[0, 50]`. - fn create_meta_pool (_m: u32, _s: u32, ) -> Weight { + fn create_meta_pool (m: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `1327` - // Estimated: `23649` - // Minimum execution time: 134_159_000 picoseconds. - Weight::from_parts(150_110_603, 23649) + // Estimated: `7572` + // Minimum execution time: 1_499_976_000 picoseconds. + Weight::from_parts(1_481_261_840, 7572) + // Standard Error: 1_427_994 + .saturating_add(Weight::from_parts(2_331_903, 0).saturating_mul(m.into())) + // Standard Error: 246_226 + .saturating_add(Weight::from_parts(413_815, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -97,12 +103,12 @@ impl dex_stable::WeightInfo for WeightInfo { /// The range of component `b` is `[2, 10]`. fn add_liquidity (b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `956 + b * (121 ±0)` - // Estimated: `16447 + b * (5180 ±0)` - // Minimum execution time: 237_675_000 picoseconds. - Weight::from_parts(128_175_547, 16447) - // Standard Error: 215_431 - .saturating_add(Weight::from_parts(60_226_610, 0).saturating_mul(b.into())) + // Measured: `955 + b * (121 ±0)` + // Estimated: `4281 + b * (5180 ±0)` + // Minimum execution time: 3_243_974_000 picoseconds. + Weight::from_parts(1_456_375_387, 4281) + // Standard Error: 1_551_618 + .saturating_add(Weight::from_parts(895_259_645, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(4_u64)) @@ -120,9 +126,9 @@ impl dex_stable::WeightInfo for WeightInfo { fn swap () -> Weight { // Proof Size summary in bytes: // Measured: `2108` - // Estimated: `20717` - // Minimum execution time: 197_198_000 picoseconds. - Weight::from_parts(210_418_000, 20717) + // Estimated: `11350` + // Minimum execution time: 2_268_129_000 picoseconds. + Weight::from_parts(2_268_129_000, 11350) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -137,12 +143,12 @@ impl dex_stable::WeightInfo for WeightInfo { /// The range of component `b` is `[2, 10]`. fn remove_liquidity (b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1068 + b * (189 ±0)` - // Estimated: `14954 + b * (5180 ±0)` - // Minimum execution time: 185_471_000 picoseconds. - Weight::from_parts(118_533_882, 14954) - // Standard Error: 173_088 - .saturating_add(Weight::from_parts(40_357_974, 0).saturating_mul(b.into())) + // Measured: `1064 + b * (189 ±0)` + // Estimated: `4281 + b * (5180 ±0)` + // Minimum execution time: 2_524_661_000 picoseconds. + Weight::from_parts(1_324_272_155, 4281) + // Standard Error: 2_684_950 + .saturating_add(Weight::from_parts(601_291_454, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) @@ -162,9 +168,9 @@ impl dex_stable::WeightInfo for WeightInfo { fn remove_liquidity_one_currency () -> Weight { // Proof Size summary in bytes: // Measured: `2179` - // Estimated: `21627` - // Minimum execution time: 226_834_000 picoseconds. - Weight::from_parts(238_657_000, 21627) + // Estimated: `8760` + // Minimum execution time: 2_160_817_000 picoseconds. + Weight::from_parts(2_160_817_000, 8760) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -181,12 +187,12 @@ impl dex_stable::WeightInfo for WeightInfo { /// The range of component `b` is `[2, 10]`. fn remove_liquidity_imbalance (b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1110 + b * (189 ±0)` - // Estimated: `16447 + b * (5180 ±0)` - // Minimum execution time: 220_099_000 picoseconds. - Weight::from_parts(129_687_055, 16447) - // Standard Error: 221_855 - .saturating_add(Weight::from_parts(50_310_438, 0).saturating_mul(b.into())) + // Measured: `1106 + b * (189 ±0)` + // Estimated: `4281 + b * (5180 ±0)` + // Minimum execution time: 2_605_230_000 picoseconds. + Weight::from_parts(1_378_223_306, 4281) + // Standard Error: 3_145_876 + .saturating_add(Weight::from_parts(610_722_427, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) @@ -207,14 +213,14 @@ impl dex_stable::WeightInfo for WeightInfo { /// The range of component `m` is `[2, 10]`. fn add_pool_and_base_pool_liquidity (b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1450 + b * (187 ±0) + m * (117 ±0)` - // Estimated: `22248 + b * (5180 ±0) + m * (5180 ±0)` - // Minimum execution time: 846_021_000 picoseconds. - Weight::from_parts(173_499_994, 22248) - // Standard Error: 412_328 - .saturating_add(Weight::from_parts(57_191_578, 0).saturating_mul(b.into())) - // Standard Error: 412_328 - .saturating_add(Weight::from_parts(68_324_553, 0).saturating_mul(m.into())) + // Measured: `1410 + b * (187 ±0) + m * (121 ±0)` + // Estimated: `7572 + b * (5180 ±0) + m * (5180 ±0)` + // Minimum execution time: 11_645_469_000 picoseconds. + Weight::from_parts(2_289_802_814, 7572) + // Standard Error: 4_386_612 + .saturating_add(Weight::from_parts(750_338_420, 0).saturating_mul(b.into())) + // Standard Error: 4_386_612 + .saturating_add(Weight::from_parts(918_351_372, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(m.into()))) @@ -236,14 +242,14 @@ impl dex_stable::WeightInfo for WeightInfo { /// The range of component `m` is `[2, 10]`. fn remove_pool_and_base_pool_liquidity (b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1656 + b * (187 ±0) + m * (184 ±0)` - // Estimated: `23358 + b * (5180 ±0) + m * (5180 ±0)` - // Minimum execution time: 672_125_000 picoseconds. - Weight::from_parts(212_479_051, 23358) - // Standard Error: 333_759 - .saturating_add(Weight::from_parts(40_969_052, 0).saturating_mul(b.into())) - // Standard Error: 333_759 - .saturating_add(Weight::from_parts(40_774_390, 0).saturating_mul(m.into())) + // Measured: `1630 + b * (187 ±0) + m * (187 ±0)` + // Estimated: `7572 + b * (5180 ±0) + m * (5180 ±0)` + // Minimum execution time: 9_647_145_000 picoseconds. + Weight::from_parts(2_035_313_491, 7572) + // Standard Error: 17_444_707 + .saturating_add(Weight::from_parts(636_796_544, 0).saturating_mul(b.into())) + // Standard Error: 17_444_707 + .saturating_add(Weight::from_parts(628_853_533, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(m.into()))) @@ -266,9 +272,9 @@ impl dex_stable::WeightInfo for WeightInfo { fn remove_pool_and_base_pool_liquidity_one_currency () -> Weight { // Proof Size summary in bytes: // Measured: `3983` - // Estimated: `35211` - // Minimum execution time: 452_544_000 picoseconds. - Weight::from_parts(477_481_000, 35211) + // Estimated: `13940` + // Minimum execution time: 4_155_522_000 picoseconds. + Weight::from_parts(4_155_522_000, 13940) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(9_u64)) } @@ -285,9 +291,9 @@ impl dex_stable::WeightInfo for WeightInfo { fn swap_pool_from_base () -> Weight { // Proof Size summary in bytes: // Measured: `4250` - // Estimated: `55998` - // Minimum execution time: 546_831_000 picoseconds. - Weight::from_parts(585_891_000, 55998) + // Estimated: `39840` + // Minimum execution time: 5_762_939_000 picoseconds. + Weight::from_parts(5_762_939_000, 39840) .saturating_add(T::DbWeight::get().reads(20_u64)) .saturating_add(T::DbWeight::get().writes(9_u64)) } @@ -304,9 +310,9 @@ impl dex_stable::WeightInfo for WeightInfo { fn swap_pool_to_base () -> Weight { // Proof Size summary in bytes: // Measured: `4013` - // Estimated: `35291` - // Minimum execution time: 432_172_000 picoseconds. - Weight::from_parts(449_330_000, 35291) + // Estimated: `16530` + // Minimum execution time: 4_159_755_000 picoseconds. + Weight::from_parts(4_159_755_000, 16530) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(9_u64)) } @@ -321,22 +327,81 @@ impl dex_stable::WeightInfo for WeightInfo { fn swap_meta_pool_underlying () -> Weight { // Proof Size summary in bytes: // Measured: `2459` - // Estimated: `20717` - // Minimum execution time: 211_080_000 picoseconds. - Weight::from_parts(220_987_000, 20717) + // Estimated: `11350` + // Minimum execution time: 2_205_825_000 picoseconds. + Weight::from_parts(2_205_825_000, 11350) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: DexStable Pools (r:1 w:1) /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) + fn update_fee_receiver () -> Weight { + // Proof Size summary in bytes: + // Measured: `874` + // Estimated: `4281` + // Minimum execution time: 509_216_000 picoseconds. + Weight::from_parts(509_216_000, 4281) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: DexStable Pools (r:1 w:1) + /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) + fn set_swap_fee () -> Weight { + // Proof Size summary in bytes: + // Measured: `874` + // Estimated: `4281` + // Minimum execution time: 519_106_000 picoseconds. + Weight::from_parts(519_106_000, 4281) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: DexStable Pools (r:1 w:1) + /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) + fn set_admin_fee () -> Weight { + // Proof Size summary in bytes: + // Measured: `874` + // Estimated: `4281` + // Minimum execution time: 511_217_000 picoseconds. + Weight::from_parts(511_217_000, 4281) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: DexStable Pools (r:1 w:1) + /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) + fn ramp_a () -> Weight { + // Proof Size summary in bytes: + // Measured: `968` + // Estimated: `4281` + // Minimum execution time: 644_410_000 picoseconds. + Weight::from_parts(644_410_000, 4281) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: DexStable Pools (r:1 w:1) + /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + fn stop_ramp_a () -> Weight { + // Proof Size summary in bytes: + // Measured: `968` + // Estimated: `4281` + // Minimum execution time: 643_830_000 picoseconds. + Weight::from_parts(643_830_000, 4281) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: DexStable Pools (r:1 w:1) + /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:10 w:0) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) fn withdraw_admin_fee () -> Weight { // Proof Size summary in bytes: // Measured: `1843` - // Estimated: `31171` - // Minimum execution time: 213_205_000 picoseconds. - Weight::from_parts(234_149_000, 31171) + // Estimated: `26890` + // Minimum execution time: 2_884_467_000 picoseconds. + Weight::from_parts(2_884_467_000, 26890) .saturating_add(T::DbWeight::get().reads(11_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } diff --git a/parachain/runtime/kintsugi/src/lib.rs b/parachain/runtime/kintsugi/src/lib.rs index 56ab95ad04..20d6868d61 100644 --- a/parachain/runtime/kintsugi/src/lib.rs +++ b/parachain/runtime/kintsugi/src/lib.rs @@ -1265,7 +1265,7 @@ construct_runtime! { // # Lending & AMM Loans: loans::{Pallet, Call, Storage, Event, Config} = 100, DexGeneral: dex_general::{Pallet, Call, Storage, Event} = 101, - DexStable: dex_stable::{Pallet, Storage, Event} = 102, // note: calls disabled + DexStable: dex_stable::{Pallet, Call, Storage, Event} = 102, DexSwapRouter: dex_swap_router::{Pallet, Call, Event} = 103, } } diff --git a/parachain/runtime/kintsugi/src/weights/dex_stable.rs b/parachain/runtime/kintsugi/src/weights/dex_stable.rs index 5afdee55ad..fb3ff28b75 100644 --- a/parachain/runtime/kintsugi/src/weights/dex_stable.rs +++ b/parachain/runtime/kintsugi/src/weights/dex_stable.rs @@ -2,17 +2,17 @@ //! Autogenerated weights for dex_stable //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-07-10, STEPS: `10`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: ``, CPU: `Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: -// target/release/interbtc-parachain +// ./target/debug/interbtc-parachain // benchmark // pallet // --pallet -// * +// dex-stable // --extrinsic // * // --chain @@ -20,11 +20,11 @@ // --execution=wasm // --wasm-execution=compiled // --steps -// 50 -// --repeat // 10 +// --repeat +// 1 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights // --template // .deploy/runtime-weight-template.hbs @@ -53,11 +53,11 @@ impl dex_stable::WeightInfo for WeightInfo { fn create_base_pool (b: u32, _s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `175` - // Estimated: `12859` - // Minimum execution time: 70_710_000 picoseconds. - Weight::from_parts(79_153_266, 12859) - // Standard Error: 97_793 - .saturating_add(Weight::from_parts(156_753, 0).saturating_mul(b.into())) + // Estimated: `4281` + // Minimum execution time: 923_222_000 picoseconds. + Weight::from_parts(930_939_034, 4281) + // Standard Error: 317_902 + .saturating_add(Weight::from_parts(154_311, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -75,12 +75,16 @@ impl dex_stable::WeightInfo for WeightInfo { /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) /// The range of component `m` is `[2, 10]`. /// The range of component `s` is `[0, 50]`. - fn create_meta_pool (_m: u32, _s: u32, ) -> Weight { + fn create_meta_pool (m: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `1355` - // Estimated: `23649` - // Minimum execution time: 138_657_000 picoseconds. - Weight::from_parts(156_413_835, 23649) + // Estimated: `7572` + // Minimum execution time: 1_510_682_000 picoseconds. + Weight::from_parts(1_509_960_386, 7572) + // Standard Error: 602_158 + .saturating_add(Weight::from_parts(914_689, 0).saturating_mul(m.into())) + // Standard Error: 103_829 + .saturating_add(Weight::from_parts(96_679, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -98,11 +102,11 @@ impl dex_stable::WeightInfo for WeightInfo { fn add_liquidity (b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `948 + b * (125 ±0)` - // Estimated: `16447 + b * (5180 ±0)` - // Minimum execution time: 245_886_000 picoseconds. - Weight::from_parts(130_071_848, 16447) - // Standard Error: 267_886 - .saturating_add(Weight::from_parts(63_633_737, 0).saturating_mul(b.into())) + // Estimated: `4281 + b * (5180 ±0)` + // Minimum execution time: 3_222_842_000 picoseconds. + Weight::from_parts(1_446_309_446, 4281) + // Standard Error: 885_938 + .saturating_add(Weight::from_parts(889_673_438, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(4_u64)) @@ -120,9 +124,9 @@ impl dex_stable::WeightInfo for WeightInfo { fn swap () -> Weight { // Proof Size summary in bytes: // Measured: `2108` - // Estimated: `20717` - // Minimum execution time: 199_432_000 picoseconds. - Weight::from_parts(208_097_000, 20717) + // Estimated: `11350` + // Minimum execution time: 2_137_339_000 picoseconds. + Weight::from_parts(2_137_339_000, 11350) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -138,11 +142,11 @@ impl dex_stable::WeightInfo for WeightInfo { fn remove_liquidity (b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `1057 + b * (192 ±0)` - // Estimated: `14954 + b * (5180 ±0)` - // Minimum execution time: 192_659_000 picoseconds. - Weight::from_parts(114_515_526, 14954) - // Standard Error: 196_120 - .saturating_add(Weight::from_parts(43_396_813, 0).saturating_mul(b.into())) + // Estimated: `4281 + b * (5180 ±0)` + // Minimum execution time: 2_515_350_000 picoseconds. + Weight::from_parts(1_306_368_241, 4281) + // Standard Error: 2_505_739 + .saturating_add(Weight::from_parts(599_062_653, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) @@ -162,9 +166,9 @@ impl dex_stable::WeightInfo for WeightInfo { fn remove_liquidity_one_currency () -> Weight { // Proof Size summary in bytes: // Measured: `2207` - // Estimated: `21627` - // Minimum execution time: 236_573_000 picoseconds. - Weight::from_parts(245_927_000, 21627) + // Estimated: `8760` + // Minimum execution time: 2_167_491_000 picoseconds. + Weight::from_parts(2_167_491_000, 8760) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -182,11 +186,11 @@ impl dex_stable::WeightInfo for WeightInfo { fn remove_liquidity_imbalance (b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `1099 + b * (192 ±0)` - // Estimated: `16447 + b * (5180 ±0)` - // Minimum execution time: 227_301_000 picoseconds. - Weight::from_parts(130_386_588, 16447) - // Standard Error: 230_741 - .saturating_add(Weight::from_parts(53_145_423, 0).saturating_mul(b.into())) + // Estimated: `4281 + b * (5180 ±0)` + // Minimum execution time: 2_586_449_000 picoseconds. + Weight::from_parts(1_361_082_704, 4281) + // Standard Error: 2_175_713 + .saturating_add(Weight::from_parts(608_779_034, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) @@ -207,14 +211,14 @@ impl dex_stable::WeightInfo for WeightInfo { /// The range of component `m` is `[2, 10]`. fn add_pool_and_base_pool_liquidity (b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1475 + b * (187 ±0) + m * (117 ±0)` - // Estimated: `22248 + b * (5180 ±0) + m * (5180 ±0)` - // Minimum execution time: 879_400_000 picoseconds. - Weight::from_parts(236_194_094, 22248) - // Standard Error: 373_884 - .saturating_add(Weight::from_parts(54_398_646, 0).saturating_mul(b.into())) - // Standard Error: 373_884 - .saturating_add(Weight::from_parts(68_730_078, 0).saturating_mul(m.into())) + // Measured: `1437 + b * (187 ±0) + m * (121 ±0)` + // Estimated: `7572 + b * (5180 ±0) + m * (5180 ±0)` + // Minimum execution time: 11_589_457_000 picoseconds. + Weight::from_parts(2_489_097_862, 7572) + // Standard Error: 1_840_926 + .saturating_add(Weight::from_parts(730_145_710, 0).saturating_mul(b.into())) + // Standard Error: 1_840_926 + .saturating_add(Weight::from_parts(896_050_781, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(m.into()))) @@ -236,14 +240,14 @@ impl dex_stable::WeightInfo for WeightInfo { /// The range of component `m` is `[2, 10]`. fn remove_pool_and_base_pool_liquidity (b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1683 + b * (187 ±0) + m * (185 ±0)` - // Estimated: `23358 + b * (5180 ±0) + m * (5180 ±0)` - // Minimum execution time: 704_182_000 picoseconds. - Weight::from_parts(229_726_354, 23358) - // Standard Error: 269_420 - .saturating_add(Weight::from_parts(42_607_261, 0).saturating_mul(b.into())) - // Standard Error: 269_420 - .saturating_add(Weight::from_parts(41_661_494, 0).saturating_mul(m.into())) + // Measured: `1658 + b * (187 ±0) + m * (187 ±0)` + // Estimated: `7572 + b * (5180 ±0) + m * (5180 ±0)` + // Minimum execution time: 9_593_347_000 picoseconds. + Weight::from_parts(2_422_602_274, 7572) + // Standard Error: 3_066_114 + .saturating_add(Weight::from_parts(599_022_504, 0).saturating_mul(b.into())) + // Standard Error: 3_066_114 + .saturating_add(Weight::from_parts(598_545_261, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(m.into()))) @@ -266,9 +270,9 @@ impl dex_stable::WeightInfo for WeightInfo { fn remove_pool_and_base_pool_liquidity_one_currency () -> Weight { // Proof Size summary in bytes: // Measured: `4012` - // Estimated: `35211` - // Minimum execution time: 461_039_000 picoseconds. - Weight::from_parts(487_475_000, 35211) + // Estimated: `13940` + // Minimum execution time: 4_107_621_000 picoseconds. + Weight::from_parts(4_107_621_000, 13940) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(9_u64)) } @@ -285,9 +289,9 @@ impl dex_stable::WeightInfo for WeightInfo { fn swap_pool_from_base () -> Weight { // Proof Size summary in bytes: // Measured: `4279` - // Estimated: `55998` - // Minimum execution time: 552_496_000 picoseconds. - Weight::from_parts(566_962_000, 55998) + // Estimated: `39840` + // Minimum execution time: 5_638_902_000 picoseconds. + Weight::from_parts(5_638_902_000, 39840) .saturating_add(T::DbWeight::get().reads(20_u64)) .saturating_add(T::DbWeight::get().writes(9_u64)) } @@ -304,9 +308,9 @@ impl dex_stable::WeightInfo for WeightInfo { fn swap_pool_to_base () -> Weight { // Proof Size summary in bytes: // Measured: `4042` - // Estimated: `35291` - // Minimum execution time: 436_593_000 picoseconds. - Weight::from_parts(474_538_000, 35291) + // Estimated: `16530` + // Minimum execution time: 4_095_901_000 picoseconds. + Weight::from_parts(4_095_901_000, 16530) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(9_u64)) } @@ -321,22 +325,81 @@ impl dex_stable::WeightInfo for WeightInfo { fn swap_meta_pool_underlying () -> Weight { // Proof Size summary in bytes: // Measured: `2459` - // Estimated: `20717` - // Minimum execution time: 217_761_000 picoseconds. - Weight::from_parts(227_332_000, 20717) + // Estimated: `11350` + // Minimum execution time: 2_196_520_000 picoseconds. + Weight::from_parts(2_196_520_000, 11350) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: DexStable Pools (r:1 w:1) /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) + fn update_fee_receiver () -> Weight { + // Proof Size summary in bytes: + // Measured: `874` + // Estimated: `4281` + // Minimum execution time: 505_835_000 picoseconds. + Weight::from_parts(505_835_000, 4281) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: DexStable Pools (r:1 w:1) + /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) + fn set_swap_fee () -> Weight { + // Proof Size summary in bytes: + // Measured: `874` + // Estimated: `4281` + // Minimum execution time: 516_813_000 picoseconds. + Weight::from_parts(516_813_000, 4281) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: DexStable Pools (r:1 w:1) + /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) + fn set_admin_fee () -> Weight { + // Proof Size summary in bytes: + // Measured: `874` + // Estimated: `4281` + // Minimum execution time: 506_259_000 picoseconds. + Weight::from_parts(506_259_000, 4281) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: DexStable Pools (r:1 w:1) + /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) + fn ramp_a () -> Weight { + // Proof Size summary in bytes: + // Measured: `968` + // Estimated: `4281` + // Minimum execution time: 651_728_000 picoseconds. + Weight::from_parts(651_728_000, 4281) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: DexStable Pools (r:1 w:1) + /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + fn stop_ramp_a () -> Weight { + // Proof Size summary in bytes: + // Measured: `968` + // Estimated: `4281` + // Minimum execution time: 643_370_000 picoseconds. + Weight::from_parts(643_370_000, 4281) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: DexStable Pools (r:1 w:1) + /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:10 w:0) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) fn withdraw_admin_fee () -> Weight { // Proof Size summary in bytes: // Measured: `1843` - // Estimated: `31171` - // Minimum execution time: 220_923_000 picoseconds. - Weight::from_parts(223_759_000, 31171) + // Estimated: `26890` + // Minimum execution time: 2_877_773_000 picoseconds. + Weight::from_parts(2_877_773_000, 26890) .saturating_add(T::DbWeight::get().reads(11_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) }