@@ -131,15 +131,20 @@ function constructLendingSetup(api: ApiPromise) {
131131 )
132132 ] ;
133133
134-
135- let activateMarkets = [
136- api . tx . loans . activateMarket ( { Token : "KBTC" } ) ,
137- api . tx . loans . activateMarket ( { Token : "KSM" } ) ,
138- api . tx . loans . activateMarket ( { ForeignAsset : 1 } ) ,
139- api . tx . loans . activateMarket ( { ForeignAsset : 2 } ) ,
134+ const underlyingTokens = [
135+ { Token : "KBTC" } ,
136+ { Token : "KSM" } ,
137+ { ForeignAsset : 1 } , // usdt
138+ { ForeignAsset : 2 } , // movr
140139 ] ;
141140
142- return addMarkets . concat ( activateMarkets ) ;
141+ let addRewards = [ api . tx . loans . addReward ( "100000000000000000000" ) ] ;
142+ let activateMarketWithRewards = underlyingTokens . map ( ( token ) => { return [
143+ api . tx . loans . activateMarket ( token ) ,
144+ api . tx . loans . updateMarketRewardSpeed ( token , 10 , 10 ) ,
145+ ] } ) . reduce ( ( x , y ) => { return x . concat ( y ) ; } ) ;
146+
147+ return addMarkets . concat ( addRewards ) . concat ( activateMarketWithRewards ) ;
143148}
144149
145150function constructFundingSetup ( api : ApiPromise ) {
@@ -177,7 +182,7 @@ function constructVaultRegistrySetup(api: ApiPromise) {
177182 ] ;
178183}
179184
180- function constructRewardsSetup ( api : ApiPromise ) {
185+ function constructAnnuitySetup ( api : ApiPromise ) {
181186 const blocksPerYears = 365 * 24 * 60 * 5 ; // 5 per minute
182187 const vaultAnnuity = [
183188 api . tx . tokens . setBalance (
@@ -288,7 +293,7 @@ async function setupParachain() {
288293 constructForeignAssetSetup ( paraApi ) ,
289294 constructLendingSetup ( paraApi ) ,
290295 constructVaultRegistrySetup ( paraApi ) ,
291- constructRewardsSetup ( paraApi ) ,
296+ constructAnnuitySetup ( paraApi ) ,
292297 constructAmmSetup ( paraApi ) ,
293298 ] . reduce ( ( x , y ) => { return x . concat ( y ) ; } ) ;
294299
0 commit comments