1515// See the License for the specific language governing permissions and
1616// limitations under the License.
1717
18- use crate :: { impls:: ToAuthor , weights:: TrappistDropAssetsWeigher } ;
18+ use crate :: {
19+ constants:: fee:: default_fee_per_second, impls:: ToAuthor , weights:: TrappistDropAssetsWeigher ,
20+ } ;
1921
2022use super :: {
2123 AccountId , AssetRegistry , Assets , Balance , Balances , ParachainInfo , ParachainSystem ,
@@ -43,11 +45,11 @@ use xcm::latest::{prelude::*, Fungibility::Fungible, MultiAsset, MultiLocation};
4345use xcm_builder:: {
4446 AccountId32Aliases , AllowKnownQueryResponses , AllowSubscriptionsFrom ,
4547 AllowTopLevelPaidExecutionFrom , AllowUnpaidExecutionFrom , AsPrefixedGeneralIndex ,
46- ConvertedConcreteAssetId , CurrencyAdapter , EnsureXcmOrigin , FungiblesAdapter , IsConcrete ,
47- LocationInverter , NativeAsset , ParentAsSuperuser , ParentIsPreset , RelayChainAsNative ,
48- SiblingParachainAsNative , SiblingParachainConvertsVia , SignedAccountId32AsNative ,
49- SignedToAccountId32 , SovereignSignedViaLocation , TakeWeightCredit , UsingComponents ,
50- WeightInfoBounds ,
48+ ConvertedConcreteAssetId , CurrencyAdapter , EnsureXcmOrigin , FixedRateOfFungible ,
49+ FungiblesAdapter , IsConcrete , LocationInverter , NativeAsset , ParentAsSuperuser , ParentIsPreset ,
50+ RelayChainAsNative , SiblingParachainAsNative , SiblingParachainConvertsVia ,
51+ SignedAccountId32AsNative , SignedToAccountId32 , SovereignSignedViaLocation , TakeWeightCredit ,
52+ UsingComponents , WeightInfoBounds ,
5153} ;
5254use xcm_executor:: XcmExecutor ;
5355
@@ -211,6 +213,14 @@ parameter_types! {
211213 // Rockmine's Assets pallet index
212214 pub RockmineAssetsPalletLocation : MultiLocation =
213215 MultiLocation :: new( 1 , X2 ( Parachain ( 1000 ) , PalletInstance ( 50 ) ) ) ;
216+
217+ pub RUsdPerSecond : ( xcm:: v1:: AssetId , u128 ) = (
218+ MultiLocation :: new( 1 , X3 ( Parachain ( 1000 ) , PalletInstance ( 50 ) , GeneralIndex ( 1984 ) ) ) . into( ) ,
219+ default_fee_per_second( ) * 10
220+ ) ;
221+ /// Roc = 7 RUSD
222+ pub RocPerSecond : ( xcm:: v1:: AssetId , u128 ) = ( MultiLocation :: parent( ) . into( ) , default_fee_per_second( ) * 70 ) ;
223+
214224}
215225
216226//- From PR https://github.com/paritytech/cumulus/pull/936
@@ -237,7 +247,14 @@ impl<T: Get<MultiLocation>> FilterAssetLocation for ReserveAssetsFrom<T> {
237247 }
238248}
239249
240- //--
250+ pub type Traders = (
251+ // RUSD
252+ FixedRateOfFungible < RUsdPerSecond , ( ) > ,
253+ // Roc
254+ FixedRateOfFungible < RocPerSecond , ( ) > ,
255+ // Everything else
256+ UsingComponents < WeightToFee , SelfReserve , AccountId , Balances , ToAuthor < Runtime > > ,
257+ ) ;
241258
242259pub type Reserves = ( NativeAsset , ReserveAssetsFrom < RockmineLocation > ) ;
243260
@@ -256,7 +273,7 @@ impl xcm_executor::Config for XcmConfig {
256273 RuntimeCall ,
257274 MaxInstructions ,
258275 > ;
259- type Trader = UsingComponents < WeightToFee , SelfReserve , AccountId , Balances , ToAuthor < Runtime > > ;
276+ type Trader = Traders ;
260277 type ResponseHandler = PolkadotXcm ;
261278 type AssetTrap = TrappistDropAssets <
262279 AssetId ,
0 commit comments