diff --git a/Cargo.lock b/Cargo.lock index 3290d4860d..2b635e5c60 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4412,9 +4412,12 @@ dependencies = [ "democracy", "dex-general", "dex-general-rpc-runtime-api", + "dex-stable", "dex-stable-rpc-runtime-api", + "dex-swap-router", "escrow", "escrow-rpc-runtime-api", + "farming", "fee", "frame-benchmarking", "frame-executive", @@ -4428,6 +4431,7 @@ dependencies = [ "interbtc-primitives", "issue", "issue-rpc-runtime-api", + "loans", "loans-rpc-runtime-api", "mocktopus", "nomination", diff --git a/crates/loans/src/lib.rs b/crates/loans/src/lib.rs index 0ec78e4ce6..e5099356c9 100644 --- a/crates/loans/src/lib.rs +++ b/crates/loans/src/lib.rs @@ -34,7 +34,7 @@ use frame_support::{ log, pallet_prelude::*, require_transactional, - traits::{tokens::fungibles::Inspect, OnRuntimeUpgrade, UnixTime}, + traits::{tokens::fungibles::Inspect, UnixTime}, transactional, PalletId, }; use frame_system::pallet_prelude::*; diff --git a/parachain/runtime/interlay/Cargo.toml b/parachain/runtime/interlay/Cargo.toml index b1a826fe66..94c6efbb3f 100644 --- a/parachain/runtime/interlay/Cargo.toml +++ b/parachain/runtime/interlay/Cargo.toml @@ -98,9 +98,13 @@ annuity = { path = "../../../crates/annuity", default-features = false } supply = { path = "../../../crates/supply", default-features = false } collator-selection = { path = "../../../crates/collator-selection", default-features = false } clients-info = { path = "../../../crates/clients-info", default-features = false } +loans = { path = "../../../crates/loans", default-features = false } traits = { path = "../../../crates/traits", default-features = false } +farming = { path = "../../../crates/farming", default-features = false } tx-pause = { path = "../../../crates/tx-pause", default-features = false } dex-general = { path = "../../../crates/dex-general", default-features = false } +dex-stable = { path = "../../../crates/dex-stable", default-features = false } +dex-swap-router = { path = "../../../crates/dex-swap-router", default-features = false } primitives = { package = "interbtc-primitives", path = "../../../primitives", default-features = false } @@ -208,9 +212,13 @@ std = [ "currency/std", "democracy/std", "dex-general/std", + "dex-stable/std", + "dex-swap-router/std", "escrow/std", + "farming/std", "fee/std", "issue/std", + "loans/std", "nomination/std", "oracle/std", "redeem/std", @@ -273,9 +281,14 @@ runtime-benchmarks = [ "clients-info/runtime-benchmarks", "collator-selection/runtime-benchmarks", "democracy/runtime-benchmarks", + "dex-general/runtime-benchmarks", + "dex-stable/runtime-benchmarks", + "dex-swap-router/runtime-benchmarks", "escrow/runtime-benchmarks", + "farming/runtime-benchmarks", "fee/runtime-benchmarks", "issue/runtime-benchmarks", + "loans/runtime-benchmarks", "nomination/runtime-benchmarks", "oracle/runtime-benchmarks", "redeem/runtime-benchmarks", @@ -328,8 +341,12 @@ try-runtime = [ "nomination/try-runtime", "clients-info/try-runtime", "tx-pause/try-runtime", + "loans/try-runtime", "democracy/try-runtime", "dex-general/try-runtime", + "dex-stable/try-runtime", + "dex-swap-router/try-runtime", + "farming/try-runtime", "pallet-collective/try-runtime", "pallet-membership/try-runtime", "pallet-authorship/try-runtime", diff --git a/parachain/runtime/interlay/src/dex.rs b/parachain/runtime/interlay/src/dex.rs new file mode 100644 index 0000000000..0b240d8a7d --- /dev/null +++ b/parachain/runtime/interlay/src/dex.rs @@ -0,0 +1,127 @@ +use super::{ + parameter_types, weights, Balance, CurrencyId, DexGeneral, DexStable, OnRuntimeUpgrade, PalletId, Rate, Runtime, + RuntimeEvent, StablePoolId, Timestamp, Tokens, Weight, +}; +use sp_runtime::traits::Zero; + +#[cfg(feature = "try-runtime")] +use frame_support::ensure; + +pub use dex_general::{AssetBalance, GenerateLpAssetId, PairInfo, ValidateAsset}; +pub use dex_stable::traits::{StablePoolLpCurrencyIdGenerate, ValidateCurrency}; + +parameter_types! { + pub const DexGeneralPalletId: PalletId = PalletId(*b"dex/genr"); + pub const DexStablePalletId: PalletId = PalletId(*b"dex/stbl"); + pub const CurrencyLimit: u32 = 10; + pub const StringLimit: u32 = 50; + pub const MaxBootstrapRewards: u32 = 1000; + pub const MaxBootstrapLimits:u32 = 1000; +} + +pub struct PairLpIdentity; +impl GenerateLpAssetId for PairLpIdentity { + fn generate_lp_asset_id(asset_0: CurrencyId, asset_1: CurrencyId) -> Option { + CurrencyId::join_lp_token(asset_0, asset_1) + } +} + +pub struct DexGeneralVerifyPairAsset; +impl ValidateAsset for DexGeneralVerifyPairAsset { + fn validate_asset(currency_id: &CurrencyId) -> bool { + currency_id.is_lp_token() + } +} + +impl dex_general::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type MultiCurrency = Tokens; + type PalletId = DexGeneralPalletId; + type AssetId = CurrencyId; + type EnsurePairAsset = DexGeneralVerifyPairAsset; + type LpGenerate = PairLpIdentity; + type WeightInfo = weights::dex_general::WeightInfo; + type MaxBootstrapRewards = MaxBootstrapRewards; + type MaxBootstrapLimits = MaxBootstrapLimits; +} + +pub struct PoolLpGenerate; +impl StablePoolLpCurrencyIdGenerate for PoolLpGenerate { + fn generate_by_pool_id(pool_id: StablePoolId) -> CurrencyId { + CurrencyId::StableLpToken(pool_id) + } +} + +pub struct DexStableVerifyPoolAsset; +impl ValidateCurrency for DexStableVerifyPoolAsset { + fn validate_pooled_currency(_currencies: &[CurrencyId]) -> bool { + true + } + + fn validate_pool_lp_currency(currency_id: CurrencyId) -> bool { + if Tokens::total_issuance(currency_id) > 0 { + return false; + } + true + } +} + +impl dex_stable::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type CurrencyId = CurrencyId; + type MultiCurrency = Tokens; + type PoolId = StablePoolId; + type TimeProvider = Timestamp; + type EnsurePoolAsset = DexStableVerifyPoolAsset; + type LpGenerate = PoolLpGenerate; + type PoolCurrencyLimit = CurrencyLimit; + type PoolCurrencySymbolLimit = StringLimit; + type PalletId = DexStablePalletId; + type WeightInfo = weights::dex_stable::WeightInfo; +} + +impl dex_swap_router::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type StablePoolId = StablePoolId; + type Balance = Balance; + type CurrencyId = CurrencyId; + type GeneralAmm = DexGeneral; + type StableAmm = DexStable; + type GeneralWeightInfo = weights::dex_general::WeightInfo; + type StableWeightInfo = weights::dex_stable::WeightInfo; + type WeightInfo = weights::dex_swap_router::WeightInfo; +} + +pub struct SetLoansExchangeRates; +impl OnRuntimeUpgrade for SetLoansExchangeRates { + fn on_runtime_upgrade() -> Weight { + let min_exchange_rate = loans::MinExchangeRate::::get(); + if min_exchange_rate.is_zero() { + loans::MinExchangeRate::::put(Rate::from_inner(loans::DEFAULT_MIN_EXCHANGE_RATE)); + } + let max_exchange_rate = loans::MaxExchangeRate::::get(); + if max_exchange_rate.is_zero() { + loans::MaxExchangeRate::::put(Rate::from_inner(loans::DEFAULT_MAX_EXCHANGE_RATE)); + } + ::DbWeight::get().reads_writes(2, 2) + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(_state: sp_std::vec::Vec) -> Result<(), &'static str> { + let min_exchange_rate = loans::MinExchangeRate::::get(); + let max_exchange_rate = loans::MaxExchangeRate::::get(); + ensure!( + !min_exchange_rate.is_zero(), + "Minimum lending exchange rate must be greater than zero" + ); + ensure!( + !max_exchange_rate.is_zero(), + "Minimum lending exchange rate must be greater than zero" + ); + ensure!( + min_exchange_rate.lt(&max_exchange_rate), + "Minimum lending exchange rate must be greater than the maximum exchange rate" + ); + Ok(()) + } +} diff --git a/parachain/runtime/interlay/src/lib.rs b/parachain/runtime/interlay/src/lib.rs index cc86e5ed81..bb66094a6b 100644 --- a/parachain/runtime/interlay/src/lib.rs +++ b/parachain/runtime/interlay/src/lib.rs @@ -25,7 +25,7 @@ use frame_system::{ limits::{BlockLength, BlockWeights}, EnsureRoot, RawOrigin, }; -pub use orml_asset_registry::AssetMetadata; +use loans::{OnSlashHook, PostDeposit, PostTransfer, PreDeposit, PreTransfer}; use orml_asset_registry::SequentialId; use orml_traits::{currency::MutationHooks, parameter_type_with_key}; use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment}; @@ -66,6 +66,7 @@ pub use sp_runtime::{FixedU128, Perbill, Permill}; pub use btc_relay::{bitcoin, Call as BtcRelayCall, TARGET_SPACING}; pub use constants::{currency::*, time::*}; pub use oracle_rpc_runtime_api::BalanceWrapper; +pub use orml_asset_registry::AssetMetadata; pub use security::StatusCode; pub use primitives::{ @@ -82,6 +83,8 @@ pub mod constants; pub mod weights; pub mod xcm_config; +mod dex; + type VaultId = primitives::VaultId; impl_opaque_keys! { @@ -611,6 +614,8 @@ parameter_types! { pub const TreasuryPalletId: PalletId = PalletId(*b"mod/trsy"); pub const CollatorPotId: PalletId = PalletId(*b"col/slct"); pub const VaultRegistryPalletId: PalletId = PalletId(*b"mod/vreg"); + pub const LoansPalletId: PalletId = PalletId(*b"mod/loan"); + pub const FarmingPalletId: PalletId = PalletId(*b"mod/farm"); } parameter_types! { @@ -628,6 +633,10 @@ parameter_types! { pub CollatorSelectionAccount: AccountId = CollatorPotId::get().into_account_truncating(); // wd9yNSwR5jsJWJrtHcnS8Wf6D5zF2dbQhxwRuvAzg9jefbhuM pub VaultRegistryAccount: AccountId = VaultRegistryPalletId::get().into_account_truncating(); + // wd9yNSwR5jsJWJZ6yzpWRRhe59Z8xLQvZpxrPF7ux76mKaBZ6 + pub LoansAccount: AccountId = LoansPalletId::get().into_account_truncating(); + // wd9yNSwR5jsJWJNMKfkcteintFoTp4aBvKN8fa2x7KHMbc6sv + pub FarmingAccount: AccountId = FarmingPalletId::get().into_account_truncating(); } pub fn get_all_module_accounts() -> Vec { @@ -639,6 +648,10 @@ pub fn get_all_module_accounts() -> Vec { TreasuryAccount::get(), CollatorSelectionAccount::get(), VaultRegistryAccount::get(), + LoansAccount::get(), + Loans::incentive_reward_account_id(), + Loans::reward_account_id(), + FarmingAccount::get(), ] } @@ -659,18 +672,18 @@ parameter_type_with_key! { }; } -// TODO!: Set `OnSlash`, and Pre/Post hooks before the lending launch on interlay pub struct CurrencyHooks(PhantomData); -impl MutationHooks for CurrencyHooks +impl + MutationHooks::Balance> for CurrencyHooks where T::AccountId: From, { type OnDust = orml_tokens::TransferDust; - type OnSlash = (); - type PreDeposit = (); - type PostDeposit = (); - type PreTransfer = (); - type PostTransfer = (); + type OnSlash = OnSlashHook; + type PreDeposit = PreDeposit; + type PostDeposit = PostDeposit; + type PreTransfer = PreTransfer; + type PostTransfer = PostTransfer; type OnNewTokenAccount = (); type OnKilledTokenAccount = (); } @@ -680,7 +693,7 @@ impl orml_tokens::Config for Runtime { type Balance = Balance; type Amount = primitives::Amount; type CurrencyId = CurrencyId; - type WeightInfo = (); + type WeightInfo = weights::orml_tokens::WeightInfo; type ExistentialDeposits = ExistentialDeposits; type CurrencyHooks = CurrencyHooks; type MaxLocks = MaxLocks; @@ -904,19 +917,39 @@ impl reward::Config for Runtime { type MaxRewardCurrencies = ConstU32<10>; } +type FarmingRewardsInstance = reward::Instance4; + +impl reward::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type SignedFixedPoint = SignedFixedPoint; + type PoolId = CurrencyId; + type StakeId = AccountId; + type CurrencyId = CurrencyId; + type GetNativeCurrencyId = GetNativeCurrencyId; + type GetWrappedCurrencyId = GetWrappedCurrencyId; + type MaxRewardCurrencies = ConstU32<10>; +} + +parameter_types! { + pub const RewardPeriod: BlockNumber = MINUTES; +} + +impl farming::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type FarmingPalletId = FarmingPalletId; + type TreasuryAccountId = TreasuryAccount; + type RewardPeriod = RewardPeriod; + type RewardPools = FarmingRewards; + type MultiCurrency = Tokens; + type WeightInfo = weights::farming::WeightInfo; +} + impl security::Config for Runtime { type RuntimeEvent = RuntimeEvent; type WeightInfo = weights::security::WeightInfo; type MaxErrors = ConstU32<1>; } -pub struct CurrencyConvert; -impl currency::CurrencyConversion, CurrencyId> for CurrencyConvert { - fn convert(amount: ¤cy::Amount, to: CurrencyId) -> Result, DispatchError> { - Oracle::convert(amount, to) - } -} - impl currency::Config for Runtime { type SignedInner = SignedInner; type SignedFixedPoint = SignedFixedPoint; @@ -925,7 +958,7 @@ impl currency::Config for Runtime { type GetNativeCurrencyId = GetNativeCurrencyId; type GetRelayChainCurrencyId = GetRelayChainCurrencyId; type GetWrappedCurrencyId = GetWrappedCurrencyId; - type CurrencyConversion = CurrencyConvert; + type CurrencyConversion = currency::CurrencyConvert; } impl staking::Config for Runtime { @@ -1147,6 +1180,18 @@ impl tx_pause::Config for Runtime { type WeightInfo = weights::tx_pause::WeightInfo; } +impl loans::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type PalletId = LoansPalletId; + type ReserveOrigin = EnsureRoot; + type UpdateOrigin = EnsureRoot; + type WeightInfo = weights::loans::WeightInfo; + type UnixTime = Timestamp; + type RewardAssetId = GetNativeCurrencyId; + type ReferenceAssetId = GetWrappedCurrencyId; + type OnExchangeRateChange = vault_registry::PoolManager; +} + construct_runtime! { pub enum Runtime where Block = Block, @@ -1181,6 +1226,8 @@ construct_runtime! { VaultStaking: staking::{Pallet, Storage, Event} = 42, VaultCapacity: reward::::{Pallet, Storage, Event} = 43, + Farming: farming::{Pallet, Call, Storage, Event} = 44, + FarmingRewards: reward::::{Pallet, Storage, Event} = 45, // # Bitcoin SPV BTCRelay: btc_relay::{Pallet, Call, Config, Storage, Event} = 50, @@ -1220,6 +1267,12 @@ construct_runtime! { XTokens: orml_xtokens::{Pallet, Storage, Call, Event} = 94, UnknownTokens: orml_unknown_tokens::{Pallet, Storage, Event} = 95, + + // # 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, + DexSwapRouter: dex_swap_router::{Pallet, Call, Event} = 103, } } @@ -1255,38 +1308,12 @@ pub type Executive = frame_executive::Executive< Runtime, AllPalletsWithSystem, ( - reward::migration::v1::MigrateToV1, - vault_registry::migration::vault_capacity::RewardsMigration< - Runtime, - VaultCapacityInstance, - VaultRewardsInstance, - >, - democracy::migrations::v1::Migration, - SudoMigrationCheck, orml_asset_registry::Migration, orml_unknown_tokens::Migration, + dex::SetLoansExchangeRates, ), >; -pub struct SudoMigrationCheck; - -impl OnRuntimeUpgrade for SudoMigrationCheck { - fn on_runtime_upgrade() -> Weight { - use frame_support::storage::migration::take_storage_value; - take_storage_value::(b"Sudo", b"Key", &[]); - Default::default() - } - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, &'static str> { - Ok(Vec::new()) - } - #[cfg(feature = "try-runtime")] - fn post_upgrade(_state: Vec) -> Result<(), &'static str> { - assert!(pallet_sudo::Pallet::::key().is_none()); - Ok(()) - } -} - #[cfg(feature = "runtime-benchmarks")] #[macro_use] extern crate frame_benchmarking; @@ -1301,23 +1328,28 @@ mod benches { [clients_info, ClientsInfo] [collator_selection, CollatorSelection] [democracy, Democracy] + [dex_general, DexGeneral] + [dex_stable, DexStable] + [dex_swap_router, DexSwapRouter] [escrow, Escrow] + [farming, Farming] [fee, Fee] [issue, Issue] - // [nomination, Nomination] + [loans, Loans] + [nomination, Nomination] [oracle, Oracle] - // [redeem, Redeem] + [redeem, Redeem] [replace, Replace] [security, Security] [supply, Supply] [tx_pause, TxPause] - // [vault_registry, VaultRegistry] + [vault_registry, VaultRegistry] // Other [cumulus_pallet_xcmp_queue, XcmpQueue] [frame_system, frame_system_benchmarking::Pallet::] [orml_asset_registry, runtime_common::benchmarking::orml_asset_registry::Pallet::] - // [orml_tokens, runtime_common::benchmarking::orml_tokens::Pallet::] + [orml_tokens, runtime_common::benchmarking::orml_tokens::Pallet::] [orml_vesting, runtime_common::benchmarking::orml_vesting::Pallet::] [pallet_collective, TechnicalCommittee] [pallet_identity, Identity] @@ -1456,116 +1488,133 @@ impl_runtime_apis! { AccountId, Balance, > for Runtime { - fn get_account_liquidity(_account: AccountId) -> Result<(Liquidity, Shortfall), DispatchError> { - Err(DispatchError::Other("RPC Endpoint Not Implemented")) + fn get_account_liquidity(account: AccountId) -> Result<(Liquidity, Shortfall), DispatchError> { + Loans::get_account_liquidity(&account) + .and_then(|liquidity| liquidity.to_rpc_tuple()) } - fn get_market_status(_asset_id: CurrencyId) -> Result<(Rate, Rate, Rate, Ratio, Balance, Balance, FixedU128), DispatchError> { - Err(DispatchError::Other("RPC Endpoint Not Implemented")) + fn get_market_status(asset_id: CurrencyId) -> Result<(Rate, Rate, Rate, Ratio, Balance, Balance, FixedU128), DispatchError> { + Loans::get_market_status(asset_id) } - fn get_liquidation_threshold_liquidity(_account: AccountId) -> Result<(Liquidity, Shortfall), DispatchError> { - Err(DispatchError::Other("RPC Endpoint Not Implemented")) + fn get_liquidation_threshold_liquidity(account: AccountId) -> Result<(Liquidity, Shortfall), DispatchError> { + Loans::get_account_liquidation_threshold_liquidity(&account) + .and_then(|liquidity| liquidity.to_rpc_tuple()) } } impl dex_general_rpc_runtime_api::DexGeneralApi for Runtime { fn get_pair_by_asset_id( - _asset_0: CurrencyId, - _asset_1: CurrencyId + asset_0: CurrencyId, + asset_1: CurrencyId ) -> Option> { - Default::default() + DexGeneral::get_pair_by_asset_id(asset_0, asset_1) } fn get_amount_in_price( - _supply: dex_general::AssetBalance, - _path: Vec + supply: dex_general::AssetBalance, + path: Vec ) -> dex_general::AssetBalance { - Default::default() + DexGeneral::desired_in_amount(supply, path) } fn get_amount_out_price( - _supply: dex_general::AssetBalance, - _path: Vec + supply: dex_general::AssetBalance, + path: Vec ) -> dex_general::AssetBalance { - Default::default() + DexGeneral::supply_out_amount(supply, path) } fn get_estimate_lptoken( - _asset_0: CurrencyId, - _asset_1: CurrencyId, - _amount_0_desired: dex_general::AssetBalance, - _amount_1_desired: dex_general::AssetBalance, - _amount_0_min: dex_general::AssetBalance, - _amount_1_min: dex_general::AssetBalance, - ) -> dex_general::AssetBalance { - Default::default() + asset_0: CurrencyId, + asset_1: CurrencyId, + amount_0_desired: dex_general::AssetBalance, + amount_1_desired: dex_general::AssetBalance, + amount_0_min: dex_general::AssetBalance, + amount_1_min: dex_general::AssetBalance, + ) -> dex_general::AssetBalance{ + DexGeneral::get_estimate_lptoken( + asset_0, + asset_1, + amount_0_desired, + amount_1_desired, + amount_0_min, + amount_1_min + ) } fn calculate_remove_liquidity( - _asset_0: CurrencyId, - _asset_1: CurrencyId, - _amount: dex_general::AssetBalance, + asset_0: CurrencyId, + asset_1: CurrencyId, + amount: dex_general::AssetBalance, ) -> Option<(dex_general::AssetBalance, dex_general::AssetBalance)> { - Default::default() + DexGeneral::calculate_remove_liquidity( + asset_0, + asset_1, + amount, + ) } } impl dex_stable_rpc_runtime_api::DexStableApi for Runtime { - fn get_virtual_price(_pool_id: StablePoolId) -> Balance { - Default::default() + fn get_virtual_price(pool_id: StablePoolId) -> Balance { + DexStable::get_virtual_price(pool_id) } - fn get_a(_pool_id: StablePoolId) -> Balance { - Default::default() + fn get_a(pool_id: StablePoolId) -> Balance { + DexStable::get_a(pool_id) } - fn get_a_precise(_pool_id: StablePoolId) -> Balance { - Default::default() + fn get_a_precise(pool_id: StablePoolId) -> Balance { + DexStable::get_a(pool_id) * 100 } - fn get_currencies(_pool_id: StablePoolId) -> Vec { - Default::default() + fn get_currencies(pool_id: StablePoolId) -> Vec { + DexStable::get_currencies(pool_id) } - fn get_currency(_pool_id: StablePoolId, _index: u32) -> Option { - Default::default() + fn get_currency(pool_id: StablePoolId, index: u32) -> Option { + DexStable::get_currency(pool_id, index) } - fn get_lp_currency(_pool_id: StablePoolId) -> Option { - Default::default() + fn get_lp_currency(pool_id: StablePoolId) -> Option { + DexStable::get_lp_currency(pool_id) } - fn get_currency_precision_multipliers(_pool_id: StablePoolId) -> Vec { - Default::default() + fn get_currency_precision_multipliers(pool_id: StablePoolId) -> Vec { + DexStable::get_currency_precision_multipliers(pool_id) } - fn get_currency_balances(_pool_id: StablePoolId) -> Vec { - Default::default() + fn get_currency_balances(pool_id: StablePoolId) -> Vec { + DexStable::get_currency_balances(pool_id) } - fn get_number_of_currencies(_pool_id: StablePoolId) -> u32 { - Default::default() + fn get_number_of_currencies(pool_id: StablePoolId) -> u32 { + DexStable::get_number_of_currencies(pool_id) } - fn get_admin_balances(_pool_id: StablePoolId) -> Vec { - Default::default() + fn get_admin_balances(pool_id: StablePoolId) -> Vec { + DexStable::get_admin_balances(pool_id) } - fn calculate_currency_amount(_pool_id: StablePoolId, _amounts: Vec, _deposit: bool) -> Balance { - Default::default() + fn calculate_currency_amount(pool_id: StablePoolId, amounts: Vec, deposit: bool) -> Balance { + use dex_stable::traits::StableAmmApi; + DexStable::stable_amm_calculate_currency_amount(pool_id, &amounts, deposit).unwrap_or_default() } - fn calculate_swap(_pool_id: StablePoolId, _in_index: u32, _out_index: u32, _in_amount: Balance) -> Balance { - Default::default() + fn calculate_swap(pool_id: StablePoolId, in_index: u32, out_index: u32, in_amount: Balance) -> Balance { + use dex_stable::traits::StableAmmApi; + DexStable::stable_amm_calculate_swap_amount(pool_id, in_index as usize, out_index as usize, in_amount).unwrap_or_default() } - fn calculate_remove_liquidity(_pool_id: StablePoolId, _amount: Balance) -> Vec { - Default::default() + fn calculate_remove_liquidity(pool_id: StablePoolId, amount: Balance) -> Vec { + use dex_stable::traits::StableAmmApi; + DexStable::stable_amm_calculate_remove_liquidity(pool_id, amount).unwrap_or_default() } - fn calculate_remove_liquidity_one_currency(_pool_id: StablePoolId, _amount: Balance, _index: u32) -> Balance { - Default::default() + fn calculate_remove_liquidity_one_currency(pool_id: StablePoolId, amount: Balance, index: u32) -> Balance { + use dex_stable::traits::StableAmmApi; + DexStable::stable_amm_calculate_remove_liquidity_one_currency(pool_id, amount, index).unwrap_or_default() } } @@ -1591,9 +1640,9 @@ impl_runtime_apis! { ) -> Result, sp_runtime::RuntimeString> { use frame_benchmarking::{Benchmarking, BenchmarkBatch, TrackedStorageKey}; impl frame_system_benchmarking::Config for Runtime {} - // impl runtime_common::benchmarking::orml_tokens::Config for Runtime {} - impl runtime_common::benchmarking::orml_vesting::Config for Runtime {} - impl runtime_common::benchmarking::orml_asset_registry::Config for Runtime {} + impl runtime_common::benchmarking::orml_tokens::Config for Runtime {} + impl runtime_common::benchmarking::orml_vesting::Config for Runtime {} + impl runtime_common::benchmarking::orml_asset_registry::Config for Runtime {} use frame_support::traits::WhitelistedStorageKeys; let mut whitelist: Vec = AllPalletsWithSystem::whitelisted_storage_keys(); @@ -1729,8 +1778,10 @@ impl_runtime_apis! { Ok(balance) } - fn compute_farming_reward(_account_id: AccountId, _pool_currency_id: CurrencyId, _reward_currency_id: CurrencyId) -> Result, DispatchError> { - Err(DispatchError::Other("RPC Endpoint Not Implemented")) + fn compute_farming_reward(account_id: AccountId, pool_currency_id: CurrencyId, reward_currency_id: CurrencyId) -> Result, DispatchError> { + let amount = >::compute_reward(&pool_currency_id, &account_id, reward_currency_id)?; + let balance = BalanceWrapper:: { amount }; + Ok(balance) } fn compute_vault_reward(vault_id: VaultId, currency_id: CurrencyId) -> Result, DispatchError> { @@ -1759,11 +1810,15 @@ impl_runtime_apis! { } fn estimate_farming_reward( - _account_id: AccountId, - _pool_currency_id: CurrencyId, - _reward_currency_id: CurrencyId, + account_id: AccountId, + pool_currency_id: CurrencyId, + reward_currency_id: CurrencyId, ) -> Result, DispatchError> { - Err(DispatchError::Other("RPC Endpoint Not Implemented")) + >::withdraw_reward(&pool_currency_id, &account_id, reward_currency_id)?; + >::distribute_reward(&pool_currency_id, reward_currency_id, Farming::total_rewards(&pool_currency_id, &reward_currency_id))?; + let amount = >::compute_reward(&pool_currency_id, &account_id, reward_currency_id)?; + let balance = BalanceWrapper:: { amount }; + Ok(balance) } fn estimate_vault_reward_rate( diff --git a/parachain/runtime/interlay/src/weights/dex_general.rs b/parachain/runtime/interlay/src/weights/dex_general.rs new file mode 100644 index 0000000000..38c6ba1376 --- /dev/null +++ b/parachain/runtime/interlay/src/weights/dex_general.rs @@ -0,0 +1,299 @@ + +//! Autogenerated weights for dex_general +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-05-04, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `enterprise`, CPU: `Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 + +// Executed Command: +// ./target/release/interbtc-parachain +// benchmark +// pallet +// --pallet +// dex-general +// --extrinsic +// * +// --chain +// interlay-dev +// --execution=wasm +// --wasm-execution=compiled +// --steps +// 2 +// --repeat +// 1 +// --output +// parachain/runtime/interlay/src/weights/ +// --template +// .deploy/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weights for dex_general using the Substrate node and recommended hardware. +pub struct WeightInfo(PhantomData); + +impl dex_general::WeightInfo for WeightInfo { + + /// Storage: DexGeneral FeeMeta (r:1 w:1) + /// Proof: DexGeneral FeeMeta (max_values: Some(1), max_size: Some(34), added: 529, mode: MaxEncodedLen) + fn set_fee_receiver () -> Weight { + // Proof Size summary in bytes: + // Measured: `787` + // Estimated: `529` + // Minimum execution time: 20_892_000 picoseconds. + Weight::from_parts(20_892_000, 529) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: DexGeneral FeeMeta (r:1 w:1) + /// Proof: DexGeneral FeeMeta (max_values: Some(1), max_size: Some(34), added: 529, mode: MaxEncodedLen) + fn set_fee_point () -> Weight { + // Proof Size summary in bytes: + // Measured: `787` + // Estimated: `529` + // Minimum execution time: 19_540_000 picoseconds. + Weight::from_parts(19_540_000, 529) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: DexGeneral PairStatuses (r:1 w:1) + /// Proof: DexGeneral PairStatuses (max_values: None, max_size: Some(163), added: 2638, mode: MaxEncodedLen) + /// Storage: DexGeneral LiquidityPairs (r:0 w:1) + /// Proof: DexGeneral LiquidityPairs (max_values: None, max_size: Some(50), added: 2525, mode: MaxEncodedLen) + fn create_pair () -> Weight { + // Proof Size summary in bytes: + // Measured: `1030` + // Estimated: `2638` + // Minimum execution time: 40_153_000 picoseconds. + Weight::from_parts(40_153_000, 2638) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// Storage: DexGeneral PairStatuses (r:1 w:1) + /// Proof: DexGeneral PairStatuses (max_values: None, max_size: Some(163), added: 2638, mode: MaxEncodedLen) + /// Storage: DexGeneral BootstrapLimits (r:0 w:1) + /// Proof: DexGeneral BootstrapLimits (max_values: None, max_size: Some(27032), added: 29507, mode: MaxEncodedLen) + /// Storage: DexGeneral BootstrapRewards (r:0 w:1) + /// Proof: DexGeneral BootstrapRewards (max_values: None, max_size: Some(27032), added: 29507, mode: MaxEncodedLen) + /// The range of component `r` is `[1, 10]`. + /// The range of component `l` is `[1, 10]`. + fn bootstrap_create (r: u32, _l: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1030` + // Estimated: `2638` + // Minimum execution time: 47_762_000 picoseconds. + Weight::from_parts(56_331_944, 2638) + // Standard Error: 105_173 + .saturating_add(Weight::from_parts(187_277, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: DexGeneral BootstrapLimits (r:1 w:0) + /// Proof: DexGeneral BootstrapLimits (max_values: None, max_size: Some(27032), added: 29507, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:4 w:4) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: DexGeneral PairStatuses (r:1 w:1) + /// Proof: DexGeneral PairStatuses (max_values: None, max_size: Some(163), added: 2638, mode: MaxEncodedLen) + /// Storage: DexGeneral BootstrapPersonalSupply (r:1 w:1) + /// Proof: DexGeneral BootstrapPersonalSupply (max_values: None, max_size: Some(102), added: 2577, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn bootstrap_contribute () -> Weight { + // Proof Size summary in bytes: + // Measured: `1981` + // Estimated: `47685` + // Minimum execution time: 120_919_000 picoseconds. + Weight::from_parts(120_919_000, 47685) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(7_u64)) + } + /// Storage: DexGeneral PairStatuses (r:1 w:0) + /// Proof: DexGeneral PairStatuses (max_values: None, max_size: Some(163), added: 2638, mode: MaxEncodedLen) + /// Storage: DexGeneral BootstrapPersonalSupply (r:1 w:1) + /// Proof: DexGeneral BootstrapPersonalSupply (max_values: None, max_size: Some(102), added: 2577, mode: MaxEncodedLen) + /// Storage: DexGeneral BootstrapEndStatus (r:1 w:0) + /// Proof: DexGeneral BootstrapEndStatus (max_values: None, max_size: Some(163), added: 2638, mode: MaxEncodedLen) + /// Storage: DexGeneral LiquidityPairs (r:1 w:0) + /// Proof: DexGeneral LiquidityPairs (max_values: None, max_size: Some(50), added: 2525, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:2 w:2) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:0) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: DexGeneral BootstrapRewards (r:1 w:0) + /// Proof: DexGeneral BootstrapRewards (max_values: None, max_size: Some(27032), added: 29507, mode: MaxEncodedLen) + fn bootstrap_claim () -> Weight { + // Proof Size summary in bytes: + // Measured: `3224` + // Estimated: `47668` + // Minimum execution time: 116_556_000 picoseconds. + Weight::from_parts(116_556_000, 47668) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: DexGeneral PairStatuses (r:1 w:1) + /// Proof: DexGeneral PairStatuses (max_values: None, max_size: Some(163), added: 2638, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:5 w:5) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: System Account (r:2 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: Tokens TotalIssuance (r:1 w:1) + /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: DexGeneral LiquidityPairs (r:0 w:1) + /// Proof: DexGeneral LiquidityPairs (max_values: None, max_size: Some(50), added: 2525, mode: MaxEncodedLen) + /// Storage: DexGeneral BootstrapEndStatus (r:0 w:1) + /// Proof: DexGeneral BootstrapEndStatus (max_values: None, max_size: Some(163), added: 2638, mode: MaxEncodedLen) + fn bootstrap_end () -> Weight { + // Proof Size summary in bytes: + // Measured: `2134` + // Estimated: `23304` + // Minimum execution time: 144_995_000 picoseconds. + Weight::from_parts(144_995_000, 23304) + .saturating_add(T::DbWeight::get().reads(9_u64)) + .saturating_add(T::DbWeight::get().writes(10_u64)) + } + /// Storage: DexGeneral PairStatuses (r:1 w:1) + /// Proof: DexGeneral PairStatuses (max_values: None, max_size: Some(163), added: 2638, mode: MaxEncodedLen) + /// Storage: DexGeneral BootstrapRewards (r:1 w:1) + /// Proof: DexGeneral BootstrapRewards (max_values: None, max_size: Some(27032), added: 29507, mode: MaxEncodedLen) + /// Storage: DexGeneral BootstrapLimits (r:0 w:1) + /// Proof: DexGeneral BootstrapLimits (max_values: None, max_size: Some(27032), added: 29507, mode: MaxEncodedLen) + /// The range of component `r` is `[1, 10]`. + /// The range of component `l` is `[1, 10]`. + fn bootstrap_update (_r: u32, _l: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1311 + r * (24 ±0)` + // Estimated: `32145` + // Minimum execution time: 49_763_000 picoseconds. + Weight::from_parts(50_255_944, 32145) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: DexGeneral PairStatuses (r:1 w:1) + /// Proof: DexGeneral PairStatuses (max_values: None, max_size: Some(163), added: 2638, mode: MaxEncodedLen) + /// Storage: DexGeneral BootstrapPersonalSupply (r:1 w:1) + /// Proof: DexGeneral BootstrapPersonalSupply (max_values: None, max_size: Some(102), added: 2577, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:4 w:4) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:0) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn bootstrap_refund () -> Weight { + // Proof Size summary in bytes: + // Measured: `2348` + // Estimated: `18178` + // Minimum execution time: 98_309_000 picoseconds. + Weight::from_parts(98_309_000, 18178) + .saturating_add(T::DbWeight::get().reads(7_u64)) + .saturating_add(T::DbWeight::get().writes(6_u64)) + } + /// Storage: DexGeneral PairStatuses (r:1 w:1) + /// Proof: DexGeneral PairStatuses (max_values: None, max_size: Some(163), added: 2638, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:5 w:5) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: DexGeneral LiquidityPairs (r:1 w:0) + /// Proof: DexGeneral LiquidityPairs (max_values: None, max_size: Some(50), added: 2525, mode: MaxEncodedLen) + /// Storage: DexGeneral KLast (r:1 w:1) + /// Proof: DexGeneral KLast (max_values: None, max_size: Some(62), added: 2537, mode: MaxEncodedLen) + /// Storage: DexGeneral FeeMeta (r:1 w:0) + /// Proof: DexGeneral FeeMeta (max_values: Some(1), max_size: Some(34), added: 529, mode: MaxEncodedLen) + /// Storage: Tokens TotalIssuance (r:1 w:1) + /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn add_liquidity () -> Weight { + // Proof Size summary in bytes: + // Measured: `2046` + // Estimated: `26292` + // Minimum execution time: 158_774_000 picoseconds. + Weight::from_parts(158_774_000, 26292) + .saturating_add(T::DbWeight::get().reads(11_u64)) + .saturating_add(T::DbWeight::get().writes(9_u64)) + } + /// Storage: DexGeneral PairStatuses (r:1 w:1) + /// Proof: DexGeneral PairStatuses (max_values: None, max_size: Some(163), added: 2638, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:5 w:5) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: DexGeneral LiquidityPairs (r:1 w:0) + /// Proof: DexGeneral LiquidityPairs (max_values: None, max_size: Some(50), added: 2525, mode: MaxEncodedLen) + /// Storage: DexGeneral KLast (r:1 w:1) + /// Proof: DexGeneral KLast (max_values: None, max_size: Some(62), added: 2537, mode: MaxEncodedLen) + /// Storage: DexGeneral FeeMeta (r:1 w:0) + /// Proof: DexGeneral FeeMeta (max_values: Some(1), max_size: Some(34), added: 529, mode: MaxEncodedLen) + /// Storage: Tokens TotalIssuance (r:1 w:1) + /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:0) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn remove_liquidity () -> Weight { + // Proof Size summary in bytes: + // Measured: `2554` + // Estimated: `26292` + // Minimum execution time: 142_640_000 picoseconds. + Weight::from_parts(142_640_000, 26292) + .saturating_add(T::DbWeight::get().reads(11_u64)) + .saturating_add(T::DbWeight::get().writes(8_u64)) + } + /// Storage: Tokens Accounts (r:20 w:20) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: DexGeneral PairStatuses (r:9 w:0) + /// Proof: DexGeneral PairStatuses (max_values: None, max_size: Some(163), added: 2638, mode: MaxEncodedLen) + /// Storage: System Account (r:9 w:0) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// The range of component `a` is `[2, 10]`. + fn swap_exact_assets_for_assets (_a: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1137 + a * (584 ±0)` + // Estimated: `98969` + // Minimum execution time: 111_355_000 picoseconds. + Weight::from_parts(433_383_000, 98969) + .saturating_add(T::DbWeight::get().reads(38_u64)) + .saturating_add(T::DbWeight::get().writes(20_u64)) + } + /// Storage: Tokens Accounts (r:20 w:20) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: DexGeneral PairStatuses (r:9 w:0) + /// Proof: DexGeneral PairStatuses (max_values: None, max_size: Some(163), added: 2638, mode: MaxEncodedLen) + /// Storage: System Account (r:9 w:0) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// The range of component `a` is `[2, 10]`. + fn swap_assets_for_exact_assets (_a: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1137 + a * (584 ±0)` + // Estimated: `98969` + // Minimum execution time: 109_186_000 picoseconds. + Weight::from_parts(420_990_000, 98969) + .saturating_add(T::DbWeight::get().reads(38_u64)) + .saturating_add(T::DbWeight::get().writes(20_u64)) + } + /// Storage: DexGeneral BootstrapRewards (r:1 w:1) + /// Proof: DexGeneral BootstrapRewards (max_values: None, max_size: Some(27032), added: 29507, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:20 w:20) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// The range of component `r` is `[1, 10]`. + fn bootstrap_charge_reward (_r: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1581 + r * (124 ±0)` + // Estimated: `83910` + // Minimum execution time: 82_890_000 picoseconds. + Weight::from_parts(325_065_000, 83910) + .saturating_add(T::DbWeight::get().reads(22_u64)) + .saturating_add(T::DbWeight::get().writes(22_u64)) + } + /// Storage: DexGeneral BootstrapRewards (r:1 w:1) + /// Proof: DexGeneral BootstrapRewards (max_values: None, max_size: Some(27032), added: 29507, mode: MaxEncodedLen) + fn bootstrap_withdraw_reward () -> Weight { + // Proof Size summary in bytes: + // Measured: `1162` + // Estimated: `29507` + // Minimum execution time: 42_204_000 picoseconds. + Weight::from_parts(42_204_000, 29507) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } +} \ No newline at end of file diff --git a/parachain/runtime/interlay/src/weights/dex_stable.rs b/parachain/runtime/interlay/src/weights/dex_stable.rs new file mode 100644 index 0000000000..699762a37b --- /dev/null +++ b/parachain/runtime/interlay/src/weights/dex_stable.rs @@ -0,0 +1,332 @@ + +//! Autogenerated weights for dex_stable +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-05-04, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `enterprise`, CPU: `Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 + +// Executed Command: +// ./target/release/interbtc-parachain +// benchmark +// pallet +// --pallet +// dex-stable +// --extrinsic +// * +// --chain +// interlay-dev +// --execution=wasm +// --wasm-execution=compiled +// --steps +// 2 +// --repeat +// 1 +// --output +// parachain/runtime/interlay/src/weights/ +// --template +// .deploy/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weights for dex_stable using the Substrate node and recommended hardware. +pub struct WeightInfo(PhantomData); + +impl dex_stable::WeightInfo for WeightInfo { + + /// Storage: DexStable NextPoolId (r:1 w:1) + /// Proof: DexStable NextPoolId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: DexStable LpCurrencies (r:1 w:1) + /// Proof: DexStable LpCurrencies (max_values: None, max_size: Some(31), added: 2506, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: DexStable Pools (r:1 w:1) + /// 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: 61_773_000 picoseconds. + Weight::from_parts(69_038_000, 8899) + // Standard Error: 46_938 + .saturating_add(Weight::from_parts(29_100, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + } + /// Storage: DexStable LpCurrencies (r:2 w:1) + /// Proof: DexStable LpCurrencies (max_values: None, max_size: Some(31), added: 2506, mode: MaxEncodedLen) + /// Storage: DexStable NextPoolId (r:1 w:1) + /// Proof: DexStable NextPoolId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: DexStable Pools (r:2 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) + /// Storage: Tokens TotalIssuance (r:1 w:0) + /// 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: `2507` + // Estimated: `17709` + // Minimum execution time: 89_028_000 picoseconds. + Weight::from_parts(86_987_875, 17709) + // Standard Error: 110_742 + .saturating_add(Weight::from_parts(210_312, 0).saturating_mul(m.into())) + // Standard Error: 17_718 + .saturating_add(Weight::from_parts(32_390, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + } + /// Storage: DexStable Pools (r:1 w:1) + /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) + /// Storage: Tokens TotalIssuance (r:1 w:1) + /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:21 w:21) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// The range of component `b` is `[2, 10]`. + fn add_liquidity (_b: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `2268 + b * (152 ±0)` + // Estimated: `63297` + // Minimum execution time: 146_367_000 picoseconds. + Weight::from_parts(381_522_000, 63297) + .saturating_add(T::DbWeight::get().reads(25_u64)) + .saturating_add(T::DbWeight::get().writes(24_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:4 w:4) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:0) + /// 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: 125_644_000 picoseconds. + Weight::from_parts(125_644_000, 16757) + .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) + /// Storage: Tokens TotalIssuance (r:1 w:1) + /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:21 w:21) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:0) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// The range of component `b` is `[2, 10]`. + fn remove_liquidity (_b: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `2273 + b * (251 ±0)` + // Estimated: `62794` + // Minimum execution time: 154_708_000 picoseconds. + Weight::from_parts(275_171_000, 62794) + .saturating_add(T::DbWeight::get().reads(24_u64)) + .saturating_add(T::DbWeight::get().writes(23_u64)) + } + /// Storage: DexStable Pools (r:1 w:1) + /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) + /// Storage: Tokens TotalIssuance (r:1 w:1) + /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:3 w:3) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:0) + /// 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: `3450` + // Estimated: `16677` + // Minimum execution time: 142_733_000 picoseconds. + Weight::from_parts(142_733_000, 16677) + .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) + /// Storage: Tokens TotalIssuance (r:1 w:1) + /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:21 w:21) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:0) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// The range of component `b` is `[2, 10]`. + fn remove_liquidity_imbalance (_b: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `2315 + b * (251 ±0)` + // Estimated: `63297` + // Minimum execution time: 139_687_000 picoseconds. + Weight::from_parts(330_129_000, 63297) + .saturating_add(T::DbWeight::get().reads(25_u64)) + .saturating_add(T::DbWeight::get().writes(23_u64)) + } + /// Storage: DexStable Pools (r:2 w:2) + /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) + /// Storage: Tokens TotalIssuance (r:2 w:2) + /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:41 w:41) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// The range of component `b` is `[2, 10]`. + /// 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: `2774 + b * (249 ±0) + m * (152 ±0)` + // Estimated: `17298 + b * (5180 ±0) + m * (5180 ±0)` + // Minimum execution time: 496_925_000 picoseconds. + Weight::from_parts(23_438_000, 17298) + // Standard Error: 15_295_091 + .saturating_add(Weight::from_parts(43_299_125, 0).saturating_mul(b.into())) + // Standard Error: 15_295_091 + .saturating_add(Weight::from_parts(38_688_875, 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()))) + .saturating_add(T::DbWeight::get().writes(6_u64)) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(b.into()))) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(m.into()))) + .saturating_add(Weight::from_parts(0, 5180).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 5180).saturating_mul(m.into())) + } + /// Storage: DexStable Pools (r:2 w:2) + /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:41 w:41) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: Tokens TotalIssuance (r:2 w:2) + /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: System Account (r:2 w:0) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// The range of component `b` is `[2, 10]`. + /// 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: `2913 + b * (249 ±0) + m * (251 ±0)` + // Estimated: `19398 + b * (5180 ±0) + m * (5180 ±0)` + // Minimum execution time: 495_188_000 picoseconds. + Weight::from_parts(60_541_250, 19398) + // Standard Error: 19_414_665 + .saturating_add(Weight::from_parts(48_154_312, 0).saturating_mul(b.into())) + // Standard Error: 19_414_665 + .saturating_add(Weight::from_parts(33_833_812, 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()))) + .saturating_add(T::DbWeight::get().writes(5_u64)) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(b.into()))) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(m.into()))) + .saturating_add(Weight::from_parts(0, 5180).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 5180).saturating_mul(m.into())) + } + /// Storage: DexStable Pools (r:2 w:2) + /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:5 w:5) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: Tokens TotalIssuance (r:2 w:2) + /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: System Account (r:2 w:0) + /// 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: `5413` + // Estimated: `30261` + // Minimum execution time: 634_682_000 picoseconds. + Weight::from_parts(634_682_000, 30261) + .saturating_add(T::DbWeight::get().reads(12_u64)) + .saturating_add(T::DbWeight::get().writes(9_u64)) + } + /// Storage: DexStable Pools (r:2 w:2) + /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) + /// Storage: Tokens TotalIssuance (r:1 w:1) + /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:15 w:6) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:0) + /// 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: `6093` + // Estimated: `51048` + // Minimum execution time: 755_259_000 picoseconds. + Weight::from_parts(755_259_000, 51048) + .saturating_add(T::DbWeight::get().reads(20_u64)) + .saturating_add(T::DbWeight::get().writes(9_u64)) + } + /// Storage: DexStable Pools (r:2 w:2) + /// Proof: DexStable Pools (max_values: None, max_size: Some(816), added: 3291, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:6 w:6) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: System Account (r:2 w:0) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: Tokens TotalIssuance (r:1 w:1) + /// 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: `5609` + // Estimated: `30341` + // Minimum execution time: 588_626_000 picoseconds. + Weight::from_parts(588_626_000, 30341) + .saturating_add(T::DbWeight::get().reads(12_u64)) + .saturating_add(T::DbWeight::get().writes(9_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) + /// Storage: Tokens Accounts (r:4 w:4) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:0) + /// 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: 321_330_000 picoseconds. + Weight::from_parts(321_330_000, 16757) + .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) + /// 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: 333_271_000 picoseconds. + Weight::from_parts(333_271_000, 29191) + .saturating_add(T::DbWeight::get().reads(11_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } +} \ No newline at end of file diff --git a/parachain/runtime/interlay/src/weights/dex_swap_router.rs b/parachain/runtime/interlay/src/weights/dex_swap_router.rs new file mode 100644 index 0000000000..c2b18afaaf --- /dev/null +++ b/parachain/runtime/interlay/src/weights/dex_swap_router.rs @@ -0,0 +1,51 @@ + +//! Autogenerated weights for dex_swap_router +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-05-22, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `enterprise`, CPU: `Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 + +// Executed Command: +// ./target/release/interbtc-parachain +// benchmark +// pallet +// --pallet +// dex-swap-router +// --extrinsic +// * +// --chain +// interlay-dev +// --execution=wasm +// --wasm-execution=compiled +// --steps +// 2 +// --repeat +// 1 +// --output +// parachain/runtime/interlay/src/weights/ +// --template +// .deploy/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weights for dex_swap_router using the Substrate node and recommended hardware. +pub struct WeightInfo(PhantomData); + +impl dex_swap_router::WeightInfo for WeightInfo { + + /// The range of component `a` is `[2, 10]`. + fn validate_routes (_a: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 791_000 picoseconds. + Weight::from_parts(1_458_000, 0) + } +} \ No newline at end of file diff --git a/parachain/runtime/interlay/src/weights/farming.rs b/parachain/runtime/interlay/src/weights/farming.rs new file mode 100644 index 0000000000..3fb9b33258 --- /dev/null +++ b/parachain/runtime/interlay/src/weights/farming.rs @@ -0,0 +1,151 @@ + +//! Autogenerated weights for farming +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-05-04, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `enterprise`, CPU: `Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 + +// Executed Command: +// ./target/release/interbtc-parachain +// benchmark +// pallet +// --pallet +// farming +// --extrinsic +// * +// --chain +// interlay-dev +// --execution=wasm +// --wasm-execution=compiled +// --steps +// 2 +// --repeat +// 1 +// --output +// parachain/runtime/interlay/src/weights/ +// --template +// .deploy/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weights for farming using the Substrate node and recommended hardware. +pub struct WeightInfo(PhantomData); + +impl farming::WeightInfo for WeightInfo { + + /// Storage: Farming RewardSchedules (r:5 w:0) + /// Proof: Farming RewardSchedules (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) + /// Storage: FarmingRewards TotalStake (r:2 w:0) + /// Proof: FarmingRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// The range of component `c` is `[1, 4]`. + fn on_initialize (_c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1153 + c * (38 ±0)` + // Estimated: `17781` + // Minimum execution time: 41_211_000 picoseconds. + Weight::from_parts(68_374_000, 17781) + .saturating_add(T::DbWeight::get().reads(7_u64)) + } + /// Storage: Tokens Accounts (r:2 w:2) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: Farming RewardSchedules (r:1 w:1) + /// Proof: Farming RewardSchedules (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) + fn update_reward_schedule () -> Weight { + // Proof Size summary in bytes: + // Measured: `1705` + // Estimated: `10332` + // Minimum execution time: 84_033_000 picoseconds. + Weight::from_parts(84_033_000, 10332) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + } + /// Storage: Tokens Accounts (r:2 w:2) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:0) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: Farming RewardSchedules (r:0 w:1) + /// Proof: Farming RewardSchedules (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) + fn remove_reward_schedule () -> Weight { + // Proof Size summary in bytes: + // Measured: `1755` + // Estimated: `7783` + // Minimum execution time: 70_634_000 picoseconds. + Weight::from_parts(70_634_000, 7783) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: FarmingRewards RewardCurrencies (r:1 w:0) + /// Proof: FarmingRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:1 w:1) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: FarmingRewards Stake (r:1 w:1) + /// Proof: FarmingRewards Stake (max_values: None, max_size: Some(75), added: 2550, mode: MaxEncodedLen) + /// Storage: FarmingRewards TotalStake (r:1 w:1) + /// Proof: FarmingRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: FarmingRewards RewardTally (r:4 w:4) + /// Proof: FarmingRewards RewardTally (max_values: None, max_size: Some(102), added: 2577, mode: MaxEncodedLen) + /// Storage: FarmingRewards RewardPerToken (r:4 w:0) + /// Proof: FarmingRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) + /// The range of component `c` is `[1, 4]`. + fn deposit (_c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1702 + c * (70 ±0)` + // Estimated: `30759` + // Minimum execution time: 79_837_000 picoseconds. + Weight::from_parts(109_013_000, 30759) + .saturating_add(T::DbWeight::get().reads(12_u64)) + .saturating_add(T::DbWeight::get().writes(7_u64)) + } + /// Storage: FarmingRewards RewardCurrencies (r:1 w:0) + /// Proof: FarmingRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:1 w:1) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: FarmingRewards Stake (r:1 w:1) + /// Proof: FarmingRewards Stake (max_values: None, max_size: Some(75), added: 2550, mode: MaxEncodedLen) + /// Storage: FarmingRewards TotalStake (r:1 w:1) + /// Proof: FarmingRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: FarmingRewards RewardTally (r:4 w:4) + /// Proof: FarmingRewards RewardTally (max_values: None, max_size: Some(102), added: 2577, mode: MaxEncodedLen) + /// Storage: FarmingRewards RewardPerToken (r:4 w:0) + /// Proof: FarmingRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) + /// The range of component `c` is `[1, 4]`. + fn withdraw (_c: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `1702 + c * (70 ±0)` + // Estimated: `30759` + // Minimum execution time: 76_083_000 picoseconds. + Weight::from_parts(102_982_000, 30759) + .saturating_add(T::DbWeight::get().reads(12_u64)) + .saturating_add(T::DbWeight::get().writes(7_u64)) + } + /// Storage: FarmingRewards Stake (r:1 w:0) + /// Proof: FarmingRewards Stake (max_values: None, max_size: Some(75), added: 2550, mode: MaxEncodedLen) + /// Storage: FarmingRewards RewardPerToken (r:1 w:0) + /// Proof: FarmingRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) + /// Storage: FarmingRewards RewardTally (r:1 w:1) + /// Proof: FarmingRewards RewardTally (max_values: None, max_size: Some(102), added: 2577, mode: MaxEncodedLen) + /// Storage: FarmingRewards TotalRewards (r:1 w:1) + /// Proof: FarmingRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:2 w:2) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:0) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn claim () -> Weight { + // Proof Size summary in bytes: + // Measured: `2228` + // Estimated: `17973` + // Minimum execution time: 104_159_000 picoseconds. + Weight::from_parts(104_159_000, 17973) + .saturating_add(T::DbWeight::get().reads(7_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + } +} \ No newline at end of file diff --git a/parachain/runtime/interlay/src/weights/loans.rs b/parachain/runtime/interlay/src/weights/loans.rs new file mode 100644 index 0000000000..c721a8c508 --- /dev/null +++ b/parachain/runtime/interlay/src/weights/loans.rs @@ -0,0 +1,640 @@ + +//! Autogenerated weights for loans +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-05-04, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `enterprise`, CPU: `Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 + +// Executed Command: +// ./target/release/interbtc-parachain +// benchmark +// pallet +// --pallet +// loans +// --extrinsic +// * +// --chain +// interlay-dev +// --execution=wasm +// --wasm-execution=compiled +// --steps +// 2 +// --repeat +// 1 +// --output +// parachain/runtime/interlay/src/weights/ +// --template +// .deploy/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weights for loans using the Substrate node and recommended hardware. +pub struct WeightInfo(PhantomData); + +impl loans::WeightInfo for WeightInfo { + + /// Storage: Loans Markets (r:2 w:1) + /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) + /// Storage: Loans UnderlyingAssetId (r:1 w:1) + /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + /// Storage: Loans MinExchangeRate (r:1 w:0) + /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: Loans ExchangeRate (r:0 w:1) + /// Proof: Loans ExchangeRate (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans BorrowIndex (r:0 w:1) + /// Proof: Loans BorrowIndex (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + fn add_market () -> Weight { + // Proof Size summary in bytes: + // Measured: `1215` + // Estimated: `8294` + // Minimum execution time: 64_718_000 picoseconds. + Weight::from_parts(64_718_000, 8294) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + } + /// Storage: Loans Markets (r:1 w:1) + /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) + fn activate_market () -> Weight { + // Proof Size summary in bytes: + // Measured: `1512` + // Estimated: `2635` + // Minimum execution time: 46_802_000 picoseconds. + Weight::from_parts(46_802_000, 2635) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Loans Markets (r:1 w:1) + /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) + fn update_rate_model () -> Weight { + // Proof Size summary in bytes: + // Measured: `1512` + // Estimated: `2635` + // Minimum execution time: 49_885_000 picoseconds. + Weight::from_parts(49_885_000, 2635) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Loans Markets (r:1 w:1) + /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) + fn update_market () -> Weight { + // Proof Size summary in bytes: + // Measured: `1512` + // Estimated: `2635` + // Minimum execution time: 46_076_000 picoseconds. + Weight::from_parts(46_076_000, 2635) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Loans UnderlyingAssetId (r:1 w:1) + /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + /// Storage: Loans Markets (r:1 w:1) + /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) + fn force_update_market () -> Weight { + // Proof Size summary in bytes: + // Measured: `1523` + // Estimated: `5148` + // Minimum execution time: 52_475_000 picoseconds. + Weight::from_parts(52_475_000, 5148) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// Storage: Tokens Accounts (r:2 w:2) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn add_reward () -> Weight { + // Proof Size summary in bytes: + // Measured: `1737` + // Estimated: `7783` + // Minimum execution time: 81_987_000 picoseconds. + Weight::from_parts(81_987_000, 7783) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: Loans Markets (r:2 w:0) + /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplySpeed (r:1 w:1) + /// Proof: Loans RewardSupplySpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans RewardBorrowSpeed (r:1 w:1) + /// Proof: Loans RewardBorrowSpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplyState (r:1 w:1) + /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) + /// Storage: Loans RewardBorrowState (r:1 w:1) + /// Proof: Loans RewardBorrowState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) + fn update_market_reward_speed () -> Weight { + // Proof Size summary in bytes: + // Measured: `1526` + // Estimated: `15350` + // Minimum execution time: 70_988_000 picoseconds. + Weight::from_parts(70_988_000, 15350) + .saturating_add(T::DbWeight::get().reads(6_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + } + /// Storage: Loans Markets (r:2 w:0) + /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplyState (r:1 w:1) + /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplySpeed (r:1 w:0) + /// Proof: Loans RewardSupplySpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Tokens TotalIssuance (r:1 w:0) + /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplierIndex (r:1 w:1) + /// Proof: Loans RewardSupplierIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Loans RewardAccrued (r:1 w:1) + /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:3 w:2) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: Loans RewardBorrowState (r:1 w:1) + /// Proof: Loans RewardBorrowState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) + /// Storage: Loans RewardBorrowSpeed (r:1 w:0) + /// Proof: Loans RewardBorrowSpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans TotalBorrows (r:1 w:0) + /// Proof: Loans TotalBorrows (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans BorrowIndex (r:1 w:0) + /// Proof: Loans BorrowIndex (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans RewardBorrowerIndex (r:1 w:1) + /// Proof: Loans RewardBorrowerIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Loans AccountBorrows (r:1 w:0) + /// Proof: Loans AccountBorrows (max_values: None, max_size: Some(107), added: 2582, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:0) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn claim_reward () -> Weight { + // Proof Size summary in bytes: + // Measured: `3190` + // Estimated: `43522` + // Minimum execution time: 170_808_000 picoseconds. + Weight::from_parts(170_808_000, 43522) + .saturating_add(T::DbWeight::get().reads(17_u64)) + .saturating_add(T::DbWeight::get().writes(7_u64)) + } + /// Storage: Loans RewardSupplyState (r:1 w:1) + /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplySpeed (r:1 w:0) + /// Proof: Loans RewardSupplySpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans Markets (r:1 w:0) + /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) + /// Storage: Tokens TotalIssuance (r:1 w:0) + /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplierIndex (r:1 w:1) + /// Proof: Loans RewardSupplierIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Loans RewardAccrued (r:1 w:1) + /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:3 w:2) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: Loans RewardBorrowState (r:1 w:1) + /// Proof: Loans RewardBorrowState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) + /// Storage: Loans RewardBorrowSpeed (r:1 w:0) + /// Proof: Loans RewardBorrowSpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans TotalBorrows (r:1 w:0) + /// Proof: Loans TotalBorrows (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans BorrowIndex (r:1 w:0) + /// Proof: Loans BorrowIndex (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans RewardBorrowerIndex (r:1 w:1) + /// Proof: Loans RewardBorrowerIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Loans AccountBorrows (r:1 w:0) + /// Proof: Loans AccountBorrows (max_values: None, max_size: Some(107), added: 2582, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:0) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn claim_reward_for_market () -> Weight { + // Proof Size summary in bytes: + // Measured: `3190` + // Estimated: `40887` + // Minimum execution time: 156_390_000 picoseconds. + Weight::from_parts(156_390_000, 40887) + .saturating_add(T::DbWeight::get().reads(16_u64)) + .saturating_add(T::DbWeight::get().writes(7_u64)) + } + /// Storage: Loans Markets (r:2 w:0) + /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:3 w:3) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: Loans LastAccruedInterestTime (r:1 w:1) + /// Proof: Loans LastAccruedInterestTime (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplyState (r:1 w:1) + /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplySpeed (r:1 w:0) + /// Proof: Loans RewardSupplySpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplierIndex (r:1 w:1) + /// Proof: Loans RewardSupplierIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Loans RewardAccrued (r:1 w:1) + /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + /// Storage: Loans UnderlyingAssetId (r:1 w:0) + /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + /// Storage: Tokens TotalIssuance (r:1 w:1) + /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: Loans TotalBorrows (r:1 w:0) + /// Proof: Loans TotalBorrows (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans TotalReserves (r:1 w:0) + /// Proof: Loans TotalReserves (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans MinExchangeRate (r:1 w:0) + /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: Loans AccountDeposits (r:1 w:0) + /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + fn mint () -> Weight { + // Proof Size summary in bytes: + // Measured: `2578` + // Estimated: `41937` + // Minimum execution time: 222_425_000 picoseconds. + Weight::from_parts(222_425_000, 41937) + .saturating_add(T::DbWeight::get().reads(18_u64)) + .saturating_add(T::DbWeight::get().writes(9_u64)) + } + /// Storage: Loans Markets (r:2 w:0) + /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: Loans LastAccruedInterestTime (r:1 w:1) + /// Proof: Loans LastAccruedInterestTime (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Loans TotalBorrows (r:1 w:1) + /// Proof: Loans TotalBorrows (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:2 w:2) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:0) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: Loans TotalReserves (r:1 w:0) + /// Proof: Loans TotalReserves (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Security ParachainStatus (r:1 w:0) + /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: Oracle Aggregate (r:1 w:0) + /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) + /// Storage: Loans AccountDeposits (r:1 w:0) + /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Loans UnderlyingAssetId (r:1 w:0) + /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + /// Storage: Tokens TotalIssuance (r:1 w:0) + /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Loans MinExchangeRate (r:1 w:0) + /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: Loans MaxExchangeRate (r:1 w:0) + /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: Loans AccountBorrows (r:1 w:1) + /// Proof: Loans AccountBorrows (max_values: None, max_size: Some(107), added: 2582, mode: MaxEncodedLen) + /// Storage: Loans RewardBorrowState (r:1 w:1) + /// Proof: Loans RewardBorrowState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) + /// Storage: Loans RewardBorrowSpeed (r:1 w:0) + /// Proof: Loans RewardBorrowSpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans RewardBorrowerIndex (r:1 w:1) + /// Proof: Loans RewardBorrowerIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Loans RewardAccrued (r:1 w:1) + /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + /// Storage: Loans BorrowIndex (r:1 w:0) + /// Proof: Loans BorrowIndex (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + fn borrow () -> Weight { + // Proof Size summary in bytes: + // Measured: `3270` + // Estimated: `47973` + // Minimum execution time: 222_834_000 picoseconds. + Weight::from_parts(222_834_000, 47973) + .saturating_add(T::DbWeight::get().reads(22_u64)) + .saturating_add(T::DbWeight::get().writes(8_u64)) + } + /// Storage: Loans Markets (r:2 w:0) + /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) + /// Storage: Loans UnderlyingAssetId (r:1 w:0) + /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: Loans LastAccruedInterestTime (r:1 w:1) + /// Proof: Loans LastAccruedInterestTime (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Tokens TotalIssuance (r:1 w:1) + /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:3 w:3) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:0) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: Loans TotalBorrows (r:1 w:0) + /// Proof: Loans TotalBorrows (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans TotalReserves (r:1 w:0) + /// Proof: Loans TotalReserves (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans MinExchangeRate (r:1 w:0) + /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: Loans MaxExchangeRate (r:1 w:0) + /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: Loans AccountDeposits (r:1 w:0) + /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplyState (r:1 w:1) + /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplySpeed (r:1 w:0) + /// Proof: Loans RewardSupplySpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplierIndex (r:1 w:1) + /// Proof: Loans RewardSupplierIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Loans RewardAccrued (r:1 w:1) + /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + fn redeem () -> Weight { + // Proof Size summary in bytes: + // Measured: `3074` + // Estimated: `42448` + // Minimum execution time: 254_883_000 picoseconds. + Weight::from_parts(254_883_000, 42448) + .saturating_add(T::DbWeight::get().reads(19_u64)) + .saturating_add(T::DbWeight::get().writes(8_u64)) + } + /// Storage: Loans Markets (r:2 w:0) + /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:3 w:3) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: Loans UnderlyingAssetId (r:1 w:0) + /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: Loans LastAccruedInterestTime (r:1 w:1) + /// Proof: Loans LastAccruedInterestTime (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Tokens TotalIssuance (r:1 w:1) + /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:0) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: Loans TotalBorrows (r:1 w:0) + /// Proof: Loans TotalBorrows (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans TotalReserves (r:1 w:0) + /// Proof: Loans TotalReserves (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans MinExchangeRate (r:1 w:0) + /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: Loans MaxExchangeRate (r:1 w:0) + /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: Loans AccountDeposits (r:1 w:0) + /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplyState (r:1 w:1) + /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplySpeed (r:1 w:0) + /// Proof: Loans RewardSupplySpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplierIndex (r:1 w:1) + /// Proof: Loans RewardSupplierIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Loans RewardAccrued (r:1 w:1) + /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + fn redeem_all () -> Weight { + // Proof Size summary in bytes: + // Measured: `3074` + // Estimated: `42448` + // Minimum execution time: 253_754_000 picoseconds. + Weight::from_parts(253_754_000, 42448) + .saturating_add(T::DbWeight::get().reads(19_u64)) + .saturating_add(T::DbWeight::get().writes(8_u64)) + } + /// Storage: Loans Markets (r:2 w:0) + /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: Loans LastAccruedInterestTime (r:1 w:1) + /// Proof: Loans LastAccruedInterestTime (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Loans AccountBorrows (r:1 w:1) + /// Proof: Loans AccountBorrows (max_values: None, max_size: Some(107), added: 2582, mode: MaxEncodedLen) + /// Storage: Loans BorrowIndex (r:1 w:0) + /// Proof: Loans BorrowIndex (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans RewardBorrowState (r:1 w:1) + /// Proof: Loans RewardBorrowState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) + /// Storage: Loans RewardBorrowSpeed (r:1 w:0) + /// Proof: Loans RewardBorrowSpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans RewardBorrowerIndex (r:1 w:1) + /// Proof: Loans RewardBorrowerIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Loans RewardAccrued (r:1 w:1) + /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:2 w:2) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: Loans TotalBorrows (r:1 w:1) + /// Proof: Loans TotalBorrows (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + fn repay_borrow () -> Weight { + // Proof Size summary in bytes: + // Measured: `3042` + // Estimated: `31226` + // Minimum execution time: 145_768_000 picoseconds. + Weight::from_parts(145_768_000, 31226) + .saturating_add(T::DbWeight::get().reads(13_u64)) + .saturating_add(T::DbWeight::get().writes(8_u64)) + } + /// Storage: Loans Markets (r:2 w:0) + /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: Loans LastAccruedInterestTime (r:1 w:1) + /// Proof: Loans LastAccruedInterestTime (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Loans AccountBorrows (r:1 w:1) + /// Proof: Loans AccountBorrows (max_values: None, max_size: Some(107), added: 2582, mode: MaxEncodedLen) + /// Storage: Loans BorrowIndex (r:1 w:0) + /// Proof: Loans BorrowIndex (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans RewardBorrowState (r:1 w:1) + /// Proof: Loans RewardBorrowState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) + /// Storage: Loans RewardBorrowSpeed (r:1 w:0) + /// Proof: Loans RewardBorrowSpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans RewardBorrowerIndex (r:1 w:1) + /// Proof: Loans RewardBorrowerIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Loans RewardAccrued (r:1 w:1) + /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:2 w:2) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: Loans TotalBorrows (r:1 w:1) + /// Proof: Loans TotalBorrows (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + fn repay_borrow_all () -> Weight { + // Proof Size summary in bytes: + // Measured: `3042` + // Estimated: `31226` + // Minimum execution time: 159_901_000 picoseconds. + Weight::from_parts(159_901_000, 31226) + .saturating_add(T::DbWeight::get().reads(13_u64)) + .saturating_add(T::DbWeight::get().writes(8_u64)) + } + /// Storage: Loans Markets (r:2 w:0) + /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:1 w:1) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: Loans UnderlyingAssetId (r:1 w:0) + /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + /// Storage: Loans AccountDeposits (r:1 w:1) + /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + fn deposit_all_collateral () -> Weight { + // Proof Size summary in bytes: + // Measured: `2133` + // Estimated: `12939` + // Minimum execution time: 89_073_000 picoseconds. + Weight::from_parts(89_073_000, 12939) + .saturating_add(T::DbWeight::get().reads(5_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// Storage: Loans Markets (r:2 w:0) + /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) + /// Storage: Loans AccountDeposits (r:1 w:1) + /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Loans UnderlyingAssetId (r:1 w:0) + /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: Loans LastAccruedInterestTime (r:1 w:1) + /// Proof: Loans LastAccruedInterestTime (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Tokens TotalIssuance (r:1 w:0) + /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:2 w:1) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:0) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: Loans TotalBorrows (r:1 w:0) + /// Proof: Loans TotalBorrows (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans TotalReserves (r:1 w:0) + /// Proof: Loans TotalReserves (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans MinExchangeRate (r:1 w:0) + /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: Loans MaxExchangeRate (r:1 w:0) + /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: Security ParachainStatus (r:1 w:0) + /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: Oracle Aggregate (r:1 w:0) + /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) + /// Storage: Loans AccountBorrows (r:1 w:0) + /// Proof: Loans AccountBorrows (max_values: None, max_size: Some(107), added: 2582, mode: MaxEncodedLen) + fn withdraw_all_collateral () -> Weight { + // Proof Size summary in bytes: + // Measured: `3200` + // Estimated: `35310` + // Minimum execution time: 201_533_000 picoseconds. + Weight::from_parts(201_533_000, 35310) + .saturating_add(T::DbWeight::get().reads(17_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: Loans LastAccruedInterestTime (r:2 w:2) + /// Proof: Loans LastAccruedInterestTime (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Loans Markets (r:3 w:0) + /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) + /// Storage: Loans AccountDeposits (r:4 w:1) + /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Loans UnderlyingAssetId (r:1 w:0) + /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + /// Storage: Tokens TotalIssuance (r:1 w:0) + /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:6 w:5) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: System Account (r:4 w:2) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: Loans TotalBorrows (r:2 w:1) + /// Proof: Loans TotalBorrows (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans TotalReserves (r:1 w:0) + /// Proof: Loans TotalReserves (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans MinExchangeRate (r:1 w:0) + /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: Loans MaxExchangeRate (r:1 w:0) + /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: Security ParachainStatus (r:1 w:0) + /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: Oracle Aggregate (r:2 w:0) + /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) + /// Storage: Loans AccountBorrows (r:3 w:1) + /// Proof: Loans AccountBorrows (max_values: None, max_size: Some(107), added: 2582, mode: MaxEncodedLen) + /// Storage: Loans BorrowIndex (r:1 w:0) + /// Proof: Loans BorrowIndex (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans RewardBorrowState (r:1 w:1) + /// Proof: Loans RewardBorrowState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) + /// Storage: Loans RewardBorrowSpeed (r:1 w:0) + /// Proof: Loans RewardBorrowSpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans RewardBorrowerIndex (r:1 w:1) + /// Proof: Loans RewardBorrowerIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Loans RewardAccrued (r:3 w:3) + /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplyState (r:1 w:1) + /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplySpeed (r:1 w:0) + /// Proof: Loans RewardSupplySpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplierIndex (r:3 w:3) + /// Proof: Loans RewardSupplierIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + fn liquidate_borrow () -> Weight { + // Proof Size summary in bytes: + // Measured: `4893` + // Estimated: `107002` + // Minimum execution time: 653_649_000 picoseconds. + Weight::from_parts(653_649_000, 107002) + .saturating_add(T::DbWeight::get().reads(45_u64)) + .saturating_add(T::DbWeight::get().writes(21_u64)) + } + /// Storage: Loans Markets (r:2 w:0) + /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: Loans LastAccruedInterestTime (r:1 w:1) + /// Proof: Loans LastAccruedInterestTime (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Loans UnderlyingAssetId (r:1 w:0) + /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + /// Storage: Tokens TotalIssuance (r:1 w:1) + /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:4 w:4) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: System Account (r:2 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: Loans TotalBorrows (r:1 w:0) + /// Proof: Loans TotalBorrows (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans TotalReserves (r:1 w:0) + /// Proof: Loans TotalReserves (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans MinExchangeRate (r:1 w:0) + /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: Loans MaxExchangeRate (r:1 w:0) + /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: Loans AccountDeposits (r:1 w:0) + /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplyState (r:1 w:1) + /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplySpeed (r:1 w:0) + /// Proof: Loans RewardSupplySpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplierIndex (r:1 w:1) + /// Proof: Loans RewardSupplierIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Loans RewardAccrued (r:1 w:1) + /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + fn reduce_incentive_reserves () -> Weight { + // Proof Size summary in bytes: + // Measured: `4066` + // Estimated: `47641` + // Minimum execution time: 359_799_000 picoseconds. + Weight::from_parts(359_799_000, 47641) + .saturating_add(T::DbWeight::get().reads(21_u64)) + .saturating_add(T::DbWeight::get().writes(10_u64)) + } + /// Storage: Loans Markets (r:2 w:0) + /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: Loans LastAccruedInterestTime (r:1 w:1) + /// Proof: Loans LastAccruedInterestTime (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:2 w:2) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: Loans TotalReserves (r:1 w:1) + /// Proof: Loans TotalReserves (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + fn add_reserves () -> Weight { + // Proof Size summary in bytes: + // Measured: `2402` + // Estimated: `18584` + // Minimum execution time: 125_902_000 picoseconds. + Weight::from_parts(125_902_000, 18584) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(5_u64)) + } + /// Storage: Loans Markets (r:2 w:0) + /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) + /// Storage: Timestamp Now (r:1 w:0) + /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: Loans LastAccruedInterestTime (r:1 w:1) + /// Proof: Loans LastAccruedInterestTime (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Loans TotalReserves (r:1 w:1) + /// Proof: Loans TotalReserves (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:2 w:2) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:0) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn reduce_reserves () -> Weight { + // Proof Size summary in bytes: + // Measured: `2563` + // Estimated: `18584` + // Minimum execution time: 113_321_000 picoseconds. + Weight::from_parts(113_321_000, 18584) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + } +} \ No newline at end of file diff --git a/parachain/runtime/interlay/src/weights/mod.rs b/parachain/runtime/interlay/src/weights/mod.rs index c7396d97bf..9c557d49d7 100644 --- a/parachain/runtime/interlay/src/weights/mod.rs +++ b/parachain/runtime/interlay/src/weights/mod.rs @@ -6,14 +6,20 @@ pub mod clients_info; pub mod collator_selection; pub mod cumulus_pallet_xcmp_queue; pub mod democracy; +pub mod dex_general; +pub mod dex_stable; +pub mod dex_swap_router; pub mod escrow; pub mod extrinsic_weights; +pub mod farming; pub mod fee; pub mod frame_system; pub mod issue; +pub mod loans; pub mod nomination; pub mod oracle; pub mod orml_asset_registry; +pub mod orml_tokens; pub mod orml_vesting; pub mod pallet_collective; pub mod pallet_identity; diff --git a/parachain/runtime/interlay/src/weights/orml_tokens.rs b/parachain/runtime/interlay/src/weights/orml_tokens.rs new file mode 100644 index 0000000000..02c1b86915 --- /dev/null +++ b/parachain/runtime/interlay/src/weights/orml_tokens.rs @@ -0,0 +1,164 @@ + +//! Autogenerated weights for orml_tokens +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-05-04, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `enterprise`, CPU: `Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 + +// Executed Command: +// ./target/release/interbtc-parachain +// benchmark +// pallet +// --pallet +// orml-tokens +// --extrinsic +// * +// --chain +// interlay-dev +// --execution=wasm +// --wasm-execution=compiled +// --steps +// 2 +// --repeat +// 1 +// --output +// parachain/runtime/interlay/src/weights/ +// --template +// .deploy/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weights for orml_tokens using the Substrate node and recommended hardware. +pub struct WeightInfo(PhantomData); + +impl orml_tokens::WeightInfo for WeightInfo { + + /// Storage: Loans UnderlyingAssetId (r:1 w:0) + /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplyState (r:1 w:1) + /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplySpeed (r:1 w:0) + /// Proof: Loans RewardSupplySpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans Markets (r:2 w:0) + /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) + /// Storage: Tokens TotalIssuance (r:1 w:0) + /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplierIndex (r:2 w:2) + /// Proof: Loans RewardSupplierIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Loans RewardAccrued (r:2 w:2) + /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:2 w:2) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: Loans AccountDeposits (r:1 w:1) + /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + fn transfer () -> Weight { + // Proof Size summary in bytes: + // Measured: `3037` + // Estimated: `33289` + // Minimum execution time: 168_223_000 picoseconds. + Weight::from_parts(168_223_000, 33289) + .saturating_add(T::DbWeight::get().reads(13_u64)) + .saturating_add(T::DbWeight::get().writes(8_u64)) + } + /// Storage: Tokens Accounts (r:2 w:2) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: Loans UnderlyingAssetId (r:1 w:0) + /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplyState (r:1 w:1) + /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplySpeed (r:1 w:0) + /// Proof: Loans RewardSupplySpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans Markets (r:2 w:0) + /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) + /// Storage: Tokens TotalIssuance (r:1 w:0) + /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplierIndex (r:2 w:2) + /// Proof: Loans RewardSupplierIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Loans RewardAccrued (r:2 w:2) + /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + /// Storage: Loans AccountDeposits (r:1 w:1) + /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + fn transfer_all () -> Weight { + // Proof Size summary in bytes: + // Measured: `3037` + // Estimated: `33289` + // Minimum execution time: 173_374_000 picoseconds. + Weight::from_parts(173_374_000, 33289) + .saturating_add(T::DbWeight::get().reads(13_u64)) + .saturating_add(T::DbWeight::get().writes(8_u64)) + } + /// Storage: Loans UnderlyingAssetId (r:1 w:0) + /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplyState (r:1 w:1) + /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplySpeed (r:1 w:0) + /// Proof: Loans RewardSupplySpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans Markets (r:2 w:0) + /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) + /// Storage: Tokens TotalIssuance (r:1 w:0) + /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplierIndex (r:2 w:2) + /// Proof: Loans RewardSupplierIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Loans RewardAccrued (r:2 w:2) + /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:2 w:2) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: Loans AccountDeposits (r:1 w:1) + /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + fn transfer_keep_alive () -> Weight { + // Proof Size summary in bytes: + // Measured: `2715` + // Estimated: `33289` + // Minimum execution time: 162_413_000 picoseconds. + Weight::from_parts(162_413_000, 33289) + .saturating_add(T::DbWeight::get().reads(13_u64)) + .saturating_add(T::DbWeight::get().writes(8_u64)) + } + /// Storage: Loans UnderlyingAssetId (r:1 w:0) + /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplyState (r:1 w:1) + /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplySpeed (r:1 w:0) + /// Proof: Loans RewardSupplySpeed (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans Markets (r:2 w:0) + /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) + /// Storage: Tokens TotalIssuance (r:1 w:0) + /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + /// Storage: Loans RewardSupplierIndex (r:2 w:2) + /// Proof: Loans RewardSupplierIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Loans RewardAccrued (r:2 w:2) + /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:2 w:2) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: Loans AccountDeposits (r:1 w:1) + /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + fn force_transfer () -> Weight { + // Proof Size summary in bytes: + // Measured: `3037` + // Estimated: `33289` + // Minimum execution time: 166_386_000 picoseconds. + Weight::from_parts(166_386_000, 33289) + .saturating_add(T::DbWeight::get().reads(13_u64)) + .saturating_add(T::DbWeight::get().writes(8_u64)) + } + /// Storage: Tokens Accounts (r:1 w:1) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: Tokens TotalIssuance (r:1 w:1) + /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) + fn set_balance () -> Weight { + // Proof Size summary in bytes: + // Measured: `1323` + // Estimated: `5100` + // Minimum execution time: 60_959_000 picoseconds. + Weight::from_parts(60_959_000, 5100) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } +} \ No newline at end of file diff --git a/parachain/runtime/kintsugi/src/dex.rs b/parachain/runtime/kintsugi/src/dex.rs index e310adf305..23fcd11ce8 100644 --- a/parachain/runtime/kintsugi/src/dex.rs +++ b/parachain/runtime/kintsugi/src/dex.rs @@ -85,5 +85,5 @@ impl dex_swap_router::Config for Runtime { type StableAmm = DexStable; type GeneralWeightInfo = weights::dex_general::WeightInfo; type StableWeightInfo = weights::dex_stable::WeightInfo; - type WeightInfo = (); + type WeightInfo = weights::dex_swap_router::WeightInfo; } diff --git a/parachain/runtime/kintsugi/src/lib.rs b/parachain/runtime/kintsugi/src/lib.rs index 18f635b341..194c7bfeda 100644 --- a/parachain/runtime/kintsugi/src/lib.rs +++ b/parachain/runtime/kintsugi/src/lib.rs @@ -1497,7 +1497,7 @@ impl_runtime_apis! { impl frame_system_benchmarking::Config for Runtime {} impl runtime_common::benchmarking::orml_tokens::Config for Runtime {} impl runtime_common::benchmarking::orml_vesting::Config for Runtime {} - impl runtime_common::benchmarking::orml_asset_registry::Config for Runtime {} + impl runtime_common::benchmarking::orml_asset_registry::Config for Runtime {} use frame_support::traits::WhitelistedStorageKeys; let mut whitelist: Vec = AllPalletsWithSystem::whitelisted_storage_keys(); diff --git a/parachain/runtime/kintsugi/src/weights/dex_swap_router.rs b/parachain/runtime/kintsugi/src/weights/dex_swap_router.rs new file mode 100644 index 0000000000..dd6cf08525 --- /dev/null +++ b/parachain/runtime/kintsugi/src/weights/dex_swap_router.rs @@ -0,0 +1,51 @@ + +//! Autogenerated weights for dex_swap_router +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-05-22, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `enterprise`, CPU: `Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 + +// Executed Command: +// ./target/release/interbtc-parachain +// benchmark +// pallet +// --pallet +// dex-swap-router +// --extrinsic +// * +// --chain +// kintsugi-dev +// --execution=wasm +// --wasm-execution=compiled +// --steps +// 2 +// --repeat +// 1 +// --output +// parachain/runtime/kintsugi/src/weights/ +// --template +// .deploy/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weights for dex_swap_router using the Substrate node and recommended hardware. +pub struct WeightInfo(PhantomData); + +impl dex_swap_router::WeightInfo for WeightInfo { + + /// The range of component `a` is `[2, 10]`. + fn validate_routes (_a: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 672_000 picoseconds. + Weight::from_parts(1_102_000, 0) + } +} \ No newline at end of file diff --git a/parachain/runtime/kintsugi/src/weights/mod.rs b/parachain/runtime/kintsugi/src/weights/mod.rs index 60dcc1daf6..9c557d49d7 100644 --- a/parachain/runtime/kintsugi/src/weights/mod.rs +++ b/parachain/runtime/kintsugi/src/weights/mod.rs @@ -8,6 +8,7 @@ pub mod cumulus_pallet_xcmp_queue; pub mod democracy; pub mod dex_general; pub mod dex_stable; +pub mod dex_swap_router; pub mod escrow; pub mod extrinsic_weights; pub mod farming; diff --git a/parachain/runtime/testnet-interlay/src/dex.rs b/parachain/runtime/testnet-interlay/src/dex.rs index 234376bbc0..23fcd11ce8 100644 --- a/parachain/runtime/testnet-interlay/src/dex.rs +++ b/parachain/runtime/testnet-interlay/src/dex.rs @@ -8,7 +8,7 @@ pub use dex_stable::traits::{StablePoolLpCurrencyIdGenerate, ValidateCurrency}; parameter_types! { pub const DexGeneralPalletId: PalletId = PalletId(*b"dex/genr"); - pub const DexStablePalletId: PalletId = PalletId(*b"dex/stab"); + pub const DexStablePalletId: PalletId = PalletId(*b"dex/stbl"); pub const CurrencyLimit: u32 = 10; pub const StringLimit: u32 = 50; pub const MaxBootstrapRewards: u32 = 1000; @@ -85,5 +85,5 @@ impl dex_swap_router::Config for Runtime { type StableAmm = DexStable; type GeneralWeightInfo = weights::dex_general::WeightInfo; type StableWeightInfo = weights::dex_stable::WeightInfo; - type WeightInfo = (); + type WeightInfo = weights::dex_swap_router::WeightInfo; } diff --git a/parachain/runtime/testnet-interlay/src/weights/dex_swap_router.rs b/parachain/runtime/testnet-interlay/src/weights/dex_swap_router.rs new file mode 100644 index 0000000000..540ed57ab4 --- /dev/null +++ b/parachain/runtime/testnet-interlay/src/weights/dex_swap_router.rs @@ -0,0 +1,51 @@ + +//! Autogenerated weights for dex_swap_router +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-05-22, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `enterprise`, CPU: `Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-testnet-latest"), DB CACHE: 1024 + +// Executed Command: +// ./target/release/interbtc-parachain +// benchmark +// pallet +// --pallet +// dex-swap-router +// --extrinsic +// * +// --chain +// interlay-testnet-latest +// --execution=wasm +// --wasm-execution=compiled +// --steps +// 2 +// --repeat +// 1 +// --output +// parachain/runtime/testnet-interlay/src/weights/ +// --template +// .deploy/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weights for dex_swap_router using the Substrate node and recommended hardware. +pub struct WeightInfo(PhantomData); + +impl dex_swap_router::WeightInfo for WeightInfo { + + /// The range of component `a` is `[2, 10]`. + fn validate_routes (_a: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_379_000 picoseconds. + Weight::from_parts(3_618_000, 0) + } +} \ No newline at end of file diff --git a/parachain/runtime/testnet-interlay/src/weights/mod.rs b/parachain/runtime/testnet-interlay/src/weights/mod.rs index 124f9f9021..6816f008fd 100644 --- a/parachain/runtime/testnet-interlay/src/weights/mod.rs +++ b/parachain/runtime/testnet-interlay/src/weights/mod.rs @@ -8,6 +8,7 @@ pub mod cumulus_pallet_xcmp_queue; pub mod democracy; pub mod dex_general; pub mod dex_stable; +pub mod dex_swap_router; pub mod escrow; pub mod extrinsic_weights; pub mod farming; diff --git a/parachain/runtime/testnet-kintsugi/src/dex.rs b/parachain/runtime/testnet-kintsugi/src/dex.rs index e310adf305..23fcd11ce8 100644 --- a/parachain/runtime/testnet-kintsugi/src/dex.rs +++ b/parachain/runtime/testnet-kintsugi/src/dex.rs @@ -85,5 +85,5 @@ impl dex_swap_router::Config for Runtime { type StableAmm = DexStable; type GeneralWeightInfo = weights::dex_general::WeightInfo; type StableWeightInfo = weights::dex_stable::WeightInfo; - type WeightInfo = (); + type WeightInfo = weights::dex_swap_router::WeightInfo; } diff --git a/parachain/runtime/testnet-kintsugi/src/weights/dex_swap_router.rs b/parachain/runtime/testnet-kintsugi/src/weights/dex_swap_router.rs new file mode 100644 index 0000000000..b5ba2ab614 --- /dev/null +++ b/parachain/runtime/testnet-kintsugi/src/weights/dex_swap_router.rs @@ -0,0 +1,51 @@ + +//! Autogenerated weights for dex_swap_router +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-05-22, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `enterprise`, CPU: `Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-testnet-latest"), DB CACHE: 1024 + +// Executed Command: +// ./target/release/interbtc-parachain +// benchmark +// pallet +// --pallet +// dex-swap-router +// --extrinsic +// * +// --chain +// kintsugi-testnet-latest +// --execution=wasm +// --wasm-execution=compiled +// --steps +// 2 +// --repeat +// 1 +// --output +// parachain/runtime/testnet-kintsugi/src/weights/ +// --template +// .deploy/runtime-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weights for dex_swap_router using the Substrate node and recommended hardware. +pub struct WeightInfo(PhantomData); + +impl dex_swap_router::WeightInfo for WeightInfo { + + /// The range of component `a` is `[2, 10]`. + fn validate_routes (_a: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_284_000 picoseconds. + Weight::from_parts(4_077_000, 0) + } +} \ No newline at end of file diff --git a/parachain/runtime/testnet-kintsugi/src/weights/mod.rs b/parachain/runtime/testnet-kintsugi/src/weights/mod.rs index 124f9f9021..6816f008fd 100644 --- a/parachain/runtime/testnet-kintsugi/src/weights/mod.rs +++ b/parachain/runtime/testnet-kintsugi/src/weights/mod.rs @@ -8,6 +8,7 @@ pub mod cumulus_pallet_xcmp_queue; pub mod democracy; pub mod dex_general; pub mod dex_stable; +pub mod dex_swap_router; pub mod escrow; pub mod extrinsic_weights; pub mod farming; diff --git a/parachain/src/chain_spec/interlay.rs b/parachain/src/chain_spec/interlay.rs index c9a7591fe9..774e9e051d 100644 --- a/parachain/src/chain_spec/interlay.rs +++ b/parachain/src/chain_spec/interlay.rs @@ -1,4 +1,6 @@ use super::*; +use kintsugi_runtime::LoansConfig; +use primitives::Rate; pub const PARA_ID: u32 = 2032; @@ -236,5 +238,9 @@ fn interlay_mainnet_genesis( safe_xcm_version: Some(3), }, sudo: Default::default(), + loans: LoansConfig { + max_exchange_rate: Rate::from_inner(loans::DEFAULT_MAX_EXCHANGE_RATE), + min_exchange_rate: Rate::from_inner(loans::DEFAULT_MIN_EXCHANGE_RATE), + }, } }