@@ -10,6 +10,8 @@ import {
1010 Connection ,
1111 PublicKey ,
1212 Transaction ,
13+ ComputeBudgetInstruction ,
14+ ComputeBudgetProgram ,
1315} from '@solana/web3.js' ;
1416import { getMultipleAccounts , sleep } from '../utils/utils' ;
1517import BN from 'bn.js' ;
@@ -18,7 +20,8 @@ import {
1820 DexInstructions ,
1921 Market ,
2022} from '@project-serum/serum' ;
21- import { Token , TOKEN_PROGRAM_ID } from '@solana/spl-token' ;
23+ import { ASSOCIATED_TOKEN_PROGRAM_ID , Token , TOKEN_PROGRAM_ID } from '@solana/spl-token' ;
24+ import { WRAPPED_SOL_MINT } from '@project-serum/serum/lib/token-instructions' ;
2225
2326const {
2427 ENDPOINT_URL ,
@@ -43,7 +46,7 @@ const payer = Keypair.fromSecretKey(
4346 Uint8Array . from (
4447 JSON . parse (
4548 KEYPAIR ||
46- fs . readFileSync ( os . homedir ( ) + '/.config/solana/devnet .json' , 'utf-8' ) ,
49+ fs . readFileSync ( os . homedir ( ) + '/.config/solana/azzers .json' , 'utf-8' ) ,
4750 ) ,
4851 ) ,
4952) ;
@@ -55,6 +58,7 @@ const connection = new Connection(ENDPOINT_URL!, 'processed' as Commitment);
5558async function run ( ) {
5659 const spotMarkets = await Promise . all (
5760 markets [ cluster ] . map ( ( m ) => {
61+ console . log ( m . address ) ;
5862 return Market . load (
5963 connection ,
6064 new PublicKey ( m . address ) ,
@@ -137,6 +141,9 @@ async function run() {
137141 } ) ;
138142
139143 const transaction = new Transaction ( ) ;
144+ transaction . add ( ComputeBudgetProgram . setComputeUnitPrice ( {
145+ microLamports : 25000
146+ } ) )
140147 transaction . add ( instr ) ;
141148
142149 console . log (
@@ -146,10 +153,10 @@ async function run() {
146153 events . length ,
147154 'events' ,
148155 ) ;
149- await connection . sendTransaction ( transaction , [ payer ] , {
156+ console . log ( await connection . sendTransaction ( transaction , [ payer ] , {
150157 skipPreflight : true ,
151158 maxRetries : 2 ,
152- } ) ;
159+ } ) ) ;
153160 }
154161 await sleep ( interval ) ;
155162 } catch ( e ) {
0 commit comments