Trait pallet_asset_conversion::pallet::Config
source · pub trait Config: Config {
Show 19 associated items
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>;
type Balance: Balance;
type HigherPrecisionBalance: IntegerSquareRoot + One + Ensure + Unsigned + From<u32> + From<Self::Balance> + TryInto<Self::Balance>;
type AssetKind: Parameter + MaxEncodedLen;
type Assets: Inspect<Self::AccountId, AssetId = Self::AssetKind, Balance = Self::Balance> + Mutate<Self::AccountId> + AccountTouch<Self::AssetKind, Self::AccountId, Balance = Self::Balance> + Balanced<Self::AccountId> + Refund<Self::AccountId, AssetId = Self::AssetKind>;
type PoolId: Parameter + MaxEncodedLen + Ord;
type PoolLocator: PoolLocator<Self::AccountId, Self::AssetKind, Self::PoolId>;
type PoolAssetId: AssetId + PartialOrd + Incrementable + From<u32>;
type PoolAssets: Inspect<Self::AccountId, AssetId = Self::PoolAssetId, Balance = Self::Balance> + Create<Self::AccountId> + Mutate<Self::AccountId> + AccountTouch<Self::PoolAssetId, Self::AccountId, Balance = Self::Balance> + Refund<Self::AccountId, AssetId = Self::PoolAssetId>;
type LPFee: Get<u32>;
type PoolSetupFee: Get<Self::Balance>;
type PoolSetupFeeAsset: Get<Self::AssetKind>;
type PoolSetupFeeTarget: OnUnbalanced<CreditOf<Self>>;
type LiquidityWithdrawalFee: Get<Permill>;
type MintMinLiquidity: Get<Self::Balance>;
type MaxSwapPathLength: Get<u32>;
type PalletId: Get<PalletId>;
type WeightInfo: WeightInfo;
type BenchmarkHelper: BenchmarkHelper<Self::AssetKind>;
}
Expand description
Configuration trait of this pallet.
The main purpose of this trait is to act as an interface between this pallet and the runtime in which it is embedded in. A type, function, or constant in this trait is essentially left to be configured by the runtime that includes this pallet.
Consequently, a runtime that wants to include this pallet must implement this trait.
Required Associated Types§
sourcetype RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>
Overarching event type.
sourcetype HigherPrecisionBalance: IntegerSquareRoot + One + Ensure + Unsigned + From<u32> + From<Self::Balance> + TryInto<Self::Balance>
type HigherPrecisionBalance: IntegerSquareRoot + One + Ensure + Unsigned + From<u32> + From<Self::Balance> + TryInto<Self::Balance>
A type used for calculations concerning the Balance
type to avoid possible overflows.
sourcetype AssetKind: Parameter + MaxEncodedLen
type AssetKind: Parameter + MaxEncodedLen
Type of asset class, sourced from Config::Assets
, utilized to offer liquidity to a
pool.
sourcetype Assets: Inspect<Self::AccountId, AssetId = Self::AssetKind, Balance = Self::Balance> + Mutate<Self::AccountId> + AccountTouch<Self::AssetKind, Self::AccountId, Balance = Self::Balance> + Balanced<Self::AccountId> + Refund<Self::AccountId, AssetId = Self::AssetKind>
type Assets: Inspect<Self::AccountId, AssetId = Self::AssetKind, Balance = Self::Balance> + Mutate<Self::AccountId> + AccountTouch<Self::AssetKind, Self::AccountId, Balance = Self::Balance> + Balanced<Self::AccountId> + Refund<Self::AccountId, AssetId = Self::AssetKind>
Registry of assets utilized for providing liquidity to pools.
sourcetype PoolLocator: PoolLocator<Self::AccountId, Self::AssetKind, Self::PoolId>
type PoolLocator: PoolLocator<Self::AccountId, Self::AssetKind, Self::PoolId>
Provides means to resolve the Config::PoolId
and it’s AccountId
from a pair
of Config::AssetKind
s.
Examples: crate::types::WithFirstAsset
, crate::types::Ascending
.
sourcetype PoolAssetId: AssetId + PartialOrd + Incrementable + From<u32>
type PoolAssetId: AssetId + PartialOrd + Incrementable + From<u32>
Asset class for the lp tokens from Self::PoolAssets
.
sourcetype PoolAssets: Inspect<Self::AccountId, AssetId = Self::PoolAssetId, Balance = Self::Balance> + Create<Self::AccountId> + Mutate<Self::AccountId> + AccountTouch<Self::PoolAssetId, Self::AccountId, Balance = Self::Balance> + Refund<Self::AccountId, AssetId = Self::PoolAssetId>
type PoolAssets: Inspect<Self::AccountId, AssetId = Self::PoolAssetId, Balance = Self::Balance> + Create<Self::AccountId> + Mutate<Self::AccountId> + AccountTouch<Self::PoolAssetId, Self::AccountId, Balance = Self::Balance> + Refund<Self::AccountId, AssetId = Self::PoolAssetId>
Registry for the lp tokens. Ideally only this pallet should have create permissions on the assets.
sourcetype LPFee: Get<u32>
type LPFee: Get<u32>
A % the liquidity providers will take of every swap. Represents 10ths of a percent.
sourcetype PoolSetupFee: Get<Self::Balance>
type PoolSetupFee: Get<Self::Balance>
A one-time fee to setup the pool.
sourcetype PoolSetupFeeAsset: Get<Self::AssetKind>
type PoolSetupFeeAsset: Get<Self::AssetKind>
Asset class from Config::Assets
used to pay the Config::PoolSetupFee
.
sourcetype PoolSetupFeeTarget: OnUnbalanced<CreditOf<Self>>
type PoolSetupFeeTarget: OnUnbalanced<CreditOf<Self>>
Handler for the Config::PoolSetupFee
.
sourcetype LiquidityWithdrawalFee: Get<Permill>
type LiquidityWithdrawalFee: Get<Permill>
A fee to withdraw the liquidity.
sourcetype MintMinLiquidity: Get<Self::Balance>
type MintMinLiquidity: Get<Self::Balance>
The minimum LP token amount that could be minted. Ameliorates rounding errors.
sourcetype MaxSwapPathLength: Get<u32>
type MaxSwapPathLength: Get<u32>
The max number of hops in a swap.
sourcetype WeightInfo: WeightInfo
type WeightInfo: WeightInfo
Weight information for extrinsics in this pallet.
sourcetype BenchmarkHelper: BenchmarkHelper<Self::AssetKind>
type BenchmarkHelper: BenchmarkHelper<Self::AssetKind>
The benchmarks need a way to create asset ids from u32s.