File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -352,6 +352,16 @@ async function constructAmmSetup(api: ApiPromise) {
352352 ] ;
353353 } ) . flat ( ) ;
354354
355+
356+ const lKsmPrice = 4.72 ; // https://apps.karura.network/swap
357+ const vKsmPrice = prices . get ( JSON . stringify ( { Token : "KSM" } ) ) as number * 1.135658 ; // https://bifrost.app/vstaking/vKSM
358+ const sKsmPrice = 42.37 ; // https://analytics.parallel.fi/kusama/moneymarket/sKSM
359+
360+ let basePoolLiquidity = 1_100_000 ;
361+ let lKsmDeposit = new BN ( basePoolLiquidity / 3 ) . mul ( new BN ( 10 ) . pow ( new BN ( 12 ) ) ) . divn ( lKsmPrice ) ;
362+ let vKsmDeposit = new BN ( basePoolLiquidity / 3 ) . mul ( new BN ( 10 ) . pow ( new BN ( 12 ) ) ) . divn ( vKsmPrice ) ;
363+ let sKsmDeposit = new BN ( basePoolLiquidity / 3 ) . mul ( new BN ( 10 ) . pow ( new BN ( 12 ) ) ) . divn ( sKsmPrice ) ;
364+
355365 // note: this is before the batch is executed
356366 const basePoolId = ( await api . query . dexStable . nextPoolId ( ) as any ) . toNumber ( ) ;
357367 const basePoolSetup = [
@@ -379,9 +389,9 @@ async function constructAmmSetup(api: ApiPromise) {
379389 api . tx . dexStable . addLiquidity (
380390 basePoolId ,
381391 [
382- "20000000000000" , // 20 LKSM
383- "20000000000000" , // 20 VKSM
384- "20000000000000" , // 20 SKSM
392+ lKsmDeposit , // 77683.474576271190 LKSM
393+ vKsmDeposit , // 8956.076760709657 VKSM
394+ sKsmDeposit , // 8653.906065612462 SKSM
385395 ] ,
386396 0 , // min mint amount
387397 treasuryAccount , // recipient
You can’t perform that action at this time.
0 commit comments