pub trait Config: Config {
Show 21 associated items type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>; type Currency: InspectFungible<Self::AccountId, Balance = Self::Balance> + MutateFungible<Self::AccountId>; type Balance: Balance; type AssetBalance: Balance; type HigherPrecisionBalance: IntegerSquareRoot + One + Ensure + Unsigned + From<u32> + From<Self::AssetBalance> + From<Self::Balance> + TryInto<Self::AssetBalance> + TryInto<Self::Balance>; type AssetId: AssetId; type MultiAssetId: AssetId + Ord + From<Self::AssetId>; type MultiAssetIdConverter: MultiAssetIdConverter<Self::MultiAssetId, Self::AssetId>; type PoolAssetId: AssetId + PartialOrd + Incrementable + From<u32>; type Assets: Inspect<Self::AccountId, AssetId = Self::AssetId, Balance = Self::AssetBalance> + Mutate<Self::AccountId> + AccountTouch<Self::AssetId, Self::AccountId> + ContainsPair<Self::AssetId, Self::AccountId>; type PoolAssets: Inspect<Self::AccountId, AssetId = Self::PoolAssetId, Balance = Self::AssetBalance> + Create<Self::AccountId> + Mutate<Self::AccountId> + AccountTouch<Self::PoolAssetId, Self::AccountId>; type LPFee: Get<u32>; type PoolSetupFee: Get<Self::Balance>; type PoolSetupFeeReceiver: Get<Self::AccountId>; type LiquidityWithdrawalFee: Get<Permill>; type MintMinLiquidity: Get<Self::AssetBalance>; type MaxSwapPathLength: Get<u32>; type PalletId: Get<PalletId>; type AllowMultiAssetPools: Get<bool>; type WeightInfo: WeightInfo; type BenchmarkHelper: BenchmarkHelper<Self::AssetId, Self::MultiAssetId>;
}
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§

source

type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>

Overarching event type.

source

type Currency: InspectFungible<Self::AccountId, Balance = Self::Balance> + MutateFungible<Self::AccountId>

Currency type that this works on.

source

type Balance: Balance

The Currency::Balance type of the native currency.

source

type AssetBalance: Balance

The type used to describe the amount of fractions converted into assets.

source

type HigherPrecisionBalance: IntegerSquareRoot + One + Ensure + Unsigned + From<u32> + From<Self::AssetBalance> + From<Self::Balance> + TryInto<Self::AssetBalance> + TryInto<Self::Balance>

A type used for conversions between Balance and AssetBalance.

source

type AssetId: AssetId

Identifier for the class of non-native asset. Note: A From<u32> bound here would prevent MultiLocation from being used as an AssetId.

source

type MultiAssetId: AssetId + Ord + From<Self::AssetId>

Type that identifies either the native currency or a token class from Assets. Ord is added because of get_pool_id.

The pool’s AccountId is derived from this type. Any changes to the type may necessitate a migration.

source

type MultiAssetIdConverter: MultiAssetIdConverter<Self::MultiAssetId, Self::AssetId>

Type to convert an AssetId into MultiAssetId.

source

type PoolAssetId: AssetId + PartialOrd + Incrementable + From<u32>

AssetId to address the lp tokens by.

source

type Assets: Inspect<Self::AccountId, AssetId = Self::AssetId, Balance = Self::AssetBalance> + Mutate<Self::AccountId> + AccountTouch<Self::AssetId, Self::AccountId> + ContainsPair<Self::AssetId, Self::AccountId>

Registry for the assets.

source

type PoolAssets: Inspect<Self::AccountId, AssetId = Self::PoolAssetId, Balance = Self::AssetBalance> + Create<Self::AccountId> + Mutate<Self::AccountId> + AccountTouch<Self::PoolAssetId, Self::AccountId>

Registry for the lp tokens. Ideally only this pallet should have create permissions on the assets.

source

type LPFee: Get<u32>

A % the liquidity providers will take of every swap. Represents 10ths of a percent.

source

type PoolSetupFee: Get<Self::Balance>

A one-time fee to setup the pool.

source

type PoolSetupFeeReceiver: Get<Self::AccountId>

An account that receives the pool setup fee.

source

type LiquidityWithdrawalFee: Get<Permill>

A fee to withdraw the liquidity.

source

type MintMinLiquidity: Get<Self::AssetBalance>

The minimum LP token amount that could be minted. Ameliorates rounding errors.

source

type MaxSwapPathLength: Get<u32>

The max number of hops in a swap.

source

type PalletId: Get<PalletId>

The pallet’s id, used for deriving its sovereign account ID.

source

type AllowMultiAssetPools: Get<bool>

A setting to allow creating pools with both non-native assets.

source

type WeightInfo: WeightInfo

Weight information for extrinsics in this pallet.

source

type BenchmarkHelper: BenchmarkHelper<Self::AssetId, Self::MultiAssetId>

The benchmarks need a way to create asset ids from u32s.

Implementors§