@@ -3,6 +3,12 @@ import { Transaction, VersionedTransaction } from '@solana/web3.js';
33import 'dotenv/config' ;
44import { swapConfig } from './swapConfig' ; // Import the configuration
55
6+ ////////////ayad//////////
7+ import {
8+ LiquidityPoolKeys ,
9+ } from '@raydium-io/raydium-sdk' ;
10+ import { web3 } from "@project-serum/anchor" ;
11+
612/**
713 * Performs a token swap on the Raydium protocol.
814 * Depending on the configuration, it can execute the swap or simulate it.
@@ -21,11 +27,50 @@ const swap = async () => {
2127 await raydiumSwap . loadPoolKeys ( swapConfig . liquidityFile ) ;
2228 console . log ( `Loaded pool keys` ) ;
2329
30+
31+
32+ /////////ayad/////////////
2433 /**
2534 * Find pool information for the given token pair.
2635 */
27- const poolInfo = raydiumSwap . findPoolInfoForTokens ( swapConfig . tokenAAddress , swapConfig . tokenBAddress ) ;
28- console . log ( 'Found pool info' ) ;
36+ // const poolInfo = raydiumSwap.findPoolInfoForTokens(swapConfig.tokenAAddress, swapConfig.tokenBAddress);
37+ // console.log('Found pool info');
38+
39+ const poolInfo : LiquidityPoolKeys = {
40+ // "_id":"6641bf8d7fdfe653a776471b",
41+ // id:"2viGyp1hY8PGw7GEPzJvLdPAQpe7zL745oHp1C6a3jcJ",
42+ id : new web3 . PublicKey ( "2viGyp1hY8PGw7GEPzJvLdPAQpe7zL745oHp1C6a3jcJ" ) ,
43+ baseMint : new web3 . PublicKey ( "Duqm5K5U1H8KfsSqwyWwWNWY5TLB9WseqNEAQMhS78hb" ) ,
44+ quoteMint : new web3 . PublicKey ( "So11111111111111111111111111111111111111112" ) ,
45+ lpMint : new web3 . PublicKey ( "89ZKE4aoyfLBe2RuV6jM3JGNhaV18Nxh8eNtjRcndBip" ) ,
46+ baseDecimals :9 ,
47+ quoteDecimals :9 ,
48+ lpDecimals :6 ,
49+ version :4 ,
50+ programId : new web3 . PublicKey ( "HWy1jotHpo6UqeQxx49dpYYdQB8wj9Qk9MdxwjLvDHB8" ) ,
51+ authority : new web3 . PublicKey ( "5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1" ) ,
52+ openOrders : new web3 . PublicKey ( "6Su6Ea97dBxecd5W92KcVvv6SzCurE2BXGgFe9LNGMpE" ) ,
53+ targetOrders : new web3 . PublicKey ( "5hATcCfvhVwAjNExvrg8rRkXmYyksHhVajWLa46iRsmE" ) ,
54+ baseVault : new web3 . PublicKey ( "Em6rHi68trYgBFyJ5261A2nhwuQWfLcirgzZZYoRcrkX" ) ,
55+ quoteVault : new web3 . PublicKey ( "3mEFzHsJyu2Cpjrz6zPmTzP7uoLFj9SbbecGVzzkL1mJ" ) ,
56+ withdrawQueue : new web3 . PublicKey ( "11111111111111111111111111111111" ) ,
57+ lpVault : new web3 . PublicKey ( "11111111111111111111111111111111" ) ,
58+ marketVersion :3 ,
59+ marketProgramId : new web3 . PublicKey ( "srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX" ) ,
60+ marketId : new web3 . PublicKey ( "BzcDHvKWD4LyW4X1NUEaWLBaNmyiCUKqcd3jXDRhwwAG" ) ,
61+ marketAuthority : new web3 . PublicKey ( "7SdieGqwPJo5rMmSQM9JmntSEMoimM4dQn7NkGbNFcrd" ) ,
62+ marketBaseVault : new web3 . PublicKey ( "6U6U59zmFWrPSzm9sLX7kVkaK78Kz7XJYkrhP1DjF3uF" ) ,
63+ marketQuoteVault : new web3 . PublicKey ( "4YEx21yeUAZxUL9Fs7YU9Gm3u45GWoPFs8vcJiHga2eQ" ) ,
64+ marketBids : new web3 . PublicKey ( "C1nEbACFaHMUiKAUsXVYPWZsuxunJeBkqXHPFr8QgSj9" ) ,
65+ marketAsks : new web3 . PublicKey ( "4DNBdnTw6wmrK4NmdSTTxs1kEz47yjqLGuoqsMeHvkMF" ) ,
66+ marketEventQueue : new web3 . PublicKey ( "4HGvdannxvmAhszVVig9auH6HsqVH17qoavDiNcnm9nj" ) ,
67+ lookupTableAccount : new web3 . PublicKey ( "73mV3Cihr7vMUHeoS2KfQ12gaPur8Zf9BGxmuDtQaG6p" ) ,
68+ // createdAt:"2024-05-13T07:21:49.907Z",
69+ // updatedAt:"2024-05-13T07:21:49.907Z",
70+ // __v:0
71+ }
72+
73+
2974
3075 /**
3176 * Prepare the swap transaction with the given parameters.
0 commit comments