fn create_pool(
		currency_id: CurrencyId,
		max_attempts: u8,
		min_partial_liquidation_sum: Balance,
		threshold: Rate,
		liquidation_fee: Rate,
	) -> DispatchResult {
		ensure!(
			!RiskManagerParams::<T>::contains_key(currency_id),
			Error::<T>::PoolAlreadyCreated
		);
		ensure!(
			Self::is_valid_liquidation_fee(liquidation_fee),
			Error::<T>::InvalidLiquidationIncentiveValue
		);

		RiskManagerParams::<T>::insert(
			currency_id,
			RiskManagerData {
				max_attempts,
				min_partial_liquidation_sum,
				threshold,
				liquidation_fee,
			},
		);

		Ok(())
	}
/// This is a part of a pool creation flow
/// Creates storage records for RiskManagerParams
This is a part of a pool creation flow
Creates storage records for RiskManagerParams
This is a part of a pool creation flow Creates storage records for RiskManagerParams
fn create_pool(
		currency_id: CurrencyId,
		max_attempts: u8,
		min_partial_liquidation_sum: Balance,
		threshold: Rate,
		liquidation_fee: Rate,
	) -> DispatchResult {
		ensure!(
			!RiskManagerParams::<T>::contains_key(currency_id),
			Error::<T>::PoolAlreadyCreated
		);
		ensure!(
			Self::is_valid_liquidation_fee(liquidation_fee),
			Error::<T>::InvalidLiquidationIncentiveValue
		);
		RiskManagerParams::<T>::insert(
			currency_id,
			RiskManagerData {
				max_attempts,
				min_partial_liquidation_sum,
				threshold,
				liquidation_fee,
			},
		);
		Ok(())
	}
fn create_pool ( currency_id : CurrencyId , max_attempts : u8 , min_partial_liquidation_sum : Balance , threshold : Rate , liquidation_fee : Rate , ) -> DispatchResult { ensure ! ( RiskManagerParams T contains_key ( currency_id ) Error T PoolAlreadyCreated ) ; ensure ! ( Self is_valid_liquidation_fee ( liquidation_fee ) Error T InvalidLiquidationIncentiveValue ) ; RiskManagerParams :: < T > :: insert ( currency_id , RiskManagerData { max_attempts , min_partial_liquidation_sum , threshold , liquidation_fee , } , ) ; Ok ( ( ) ) }
This is a part of a pool creation flow
Creates storage records for RiskManagerParams
This is a part of a pool creation flow Creates storage records for RiskManagerParams
currency_id
CurrencyId
max_attempts
u8
min_partial_liquidation_sum
Balance
threshold
Rate
liquidation_fee
Rate
currency_id
CurrencyId
max_attempts
u8
min_partial_liquidation_sum
Balance
threshold
Rate
liquidation_fee
Rate