fn create_pool(currency_id: CurrencyId, deviation_threshold: Rate, balance_ratio: Rate) -> DispatchResult {
		ensure!(
			!LiquidationPoolsData::<T>::contains_key(currency_id),
			Error::<T>::PoolAlreadyCreated
		);
		ensure!(
			Self::is_valid_deviation_threshold(deviation_threshold),
			Error::<T>::NotValidDeviationThresholdValue
		);
		ensure!(
			Self::is_valid_balance_ratio(balance_ratio),
			Error::<T>::NotValidBalanceRatioValue
		);

		LiquidationPoolsData::<T>::insert(
			currency_id,
			LiquidationPoolData {
				deviation_threshold,
				balance_ratio,
				max_ideal_balance: None,
			},
		);
		Ok(())
	}
/// This is a part of a pool creation flow
/// Checks parameters validity and creates storage records for LiquidationPoolsData
This is a part of a pool creation flow
Checks parameters validity and creates storage records for LiquidationPoolsData
This is a part of a pool creation flow Checks parameters validity and creates storage records for LiquidationPoolsData
fn create_pool(currency_id: CurrencyId, deviation_threshold: Rate, balance_ratio: Rate) -> DispatchResult {
		ensure!(
			!LiquidationPoolsData::<T>::contains_key(currency_id),
			Error::<T>::PoolAlreadyCreated
		);
		ensure!(
			Self::is_valid_deviation_threshold(deviation_threshold),
			Error::<T>::NotValidDeviationThresholdValue
		);
		ensure!(
			Self::is_valid_balance_ratio(balance_ratio),
			Error::<T>::NotValidBalanceRatioValue
		);
		LiquidationPoolsData::<T>::insert(
			currency_id,
			LiquidationPoolData {
				deviation_threshold,
				balance_ratio,
				max_ideal_balance: None,
			},
		);
		Ok(())
	}
fn create_pool ( currency_id : CurrencyId , deviation_threshold : Rate , balance_ratio : Rate ) -> DispatchResult { ensure ! ( LiquidationPoolsData T contains_key ( currency_id ) Error T PoolAlreadyCreated ) ; ensure ! ( Self is_valid_deviation_threshold ( deviation_threshold ) Error T NotValidDeviationThresholdValue ) ; ensure ! ( Self is_valid_balance_ratio ( balance_ratio ) Error T NotValidBalanceRatioValue ) ; LiquidationPoolsData :: < T > :: insert ( currency_id , LiquidationPoolData { deviation_threshold , balance_ratio , max_ideal_balance : None , } , ) ; Ok ( ( ) ) }
This is a part of a pool creation flow
Checks parameters validity and creates storage records for LiquidationPoolsData
This is a part of a pool creation flow Checks parameters validity and creates storage records for LiquidationPoolsData
currency_id
CurrencyId
deviation_threshold
Rate
balance_ratio
Rate
currency_id
CurrencyId
deviation_threshold
Rate
balance_ratio
Rate