Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,40 @@
"@bloxroute/solana-trader-client-ts": "^2.1.6",
"@coral-xyz/anchor": "^0.28.1-beta.2",
"@mercurial-finance/dynamic-amm-sdk": "^1.0.3",
"@metaplex-foundation/js": "^0.20.1",
"@metaplex-foundation/mpl-candy-machine": "^6.0.1",
"@metaplex-foundation/mpl-token-metadata": "^3.2.1",
"@metaplex-foundation/umi": "^0.9.1",
"@metaplex-foundation/umi-bundle-defaults": "^0.9.1",
"@meteora-ag/dlmm": "^1.0.54",
"@orca-so/common-sdk": "^0.6.0-alpha.3",
"@orca-so/whirlpools-sdk": "^0.11.8",
"@project-serum/anchor": "^0.26.0",
"@project-serum/serum": "^0.13.65",
"@raydium-io/raydium-sdk": "^1.3.1-beta.47",
"@raydium-io/raydium-sdk-v2": "^0.1.23-alpha",
"@metaplex-foundation/js": "^0.20.1",
"@metaplex-foundation/mpl-candy-machine": "^6.0.1",
"@metaplex-foundation/mpl-token-metadata": "^3.2.1",
"@metaplex-foundation/umi": "^0.9.1",
"@metaplex-foundation/umi-bundle-defaults": "^0.9.1",
"@shyft-to/solana-transaction-parser": "^1.1.17",
"@solana/spl-token": "^0.4.0",
"@solana/web3.js": "^1.89.1",
"@triton-one/yellowstone-grpc": "^0.4.0",
"async-mutex": "^0.5.0",
"axios": "^1.6.8",
"bigint-buffer": "^1.1.5",
"bip39": "^3.1.0",
"bn.js": "^5.2.1",
"bs58": "^5.0.0",
"commander": "^12.1.0",
"decimal.js": "^10.4.3",
"dotenv": "^16.4.5",
"i": "^0.3.7",
"jito-ts": "^4.0.0",
"npm": "^10.5.2",
"pino": "^8.18.0",
"pino-pretty": "^10.3.1",
"pino-std-serializers": "^6.2.2",
"pumpdotfun-sdk": "^1.3.2",
"random-js": "^2.1.0",
"rpc-websockets": "7.10.0",
"@triton-one/yellowstone-grpc": "^0.4.0",
"jito-ts": "^4.0.0",
"async-mutex": "^0.5.0",
"bigint-buffer": "^1.1.5",
"@shyft-to/solana-transaction-parser": "^1.1.17"
"rpc-websockets": "7.10.0"
},
"overrides": {
"@solana/web3.js": "^1.89.1",
Expand All @@ -61,6 +61,7 @@
"bigint-buffer": "^1.1.5"
},
"devDependencies": {
"@types/bn.js": "^5.2.0",
"typescript": "^5.5.4"
},
"engines": {
Expand Down
20 changes: 12 additions & 8 deletions src/grpc_streaming_dev/grpc-pf-sniper/src/jito/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,21 @@ import {
}


// Get Tip Accounts
let tipAccounts: string[] = [];
(async () => {
// Get Tip Accounts

let tipAccounts: string[] = [];
(async () => {
try {
tipAccounts = await c.getTipAccounts();
// console.log('Result:', tipAccounts);
const tipResult = await c.getTipAccounts();
if ((tipResult as any).ok) {
tipAccounts = (tipResult as any).value as string[];
} else {
logger.warn({ err: (tipResult as any).error }, 'Failed to fetch tip accounts');
}
} catch (error) {
console.error('Error:', error);
console.error('Error:', error);
}
})();
})();



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ export const METADATA_SEED = "metadata";
export const DEFAULT_DECIMALS = 6;

export class PumpFunSDK {
public program: Program<PumpFun>;
public program: Program<any>;
public connection: Connection;
constructor(provider?: Provider) {
this.program = new Program<PumpFun>(IDL as PumpFun, provider);
this.program = new Program<any>(IDL as any, new PublicKey(PROGRAM_ID), provider);
this.connection = this.program.provider.connection;
}

Expand Down Expand Up @@ -188,7 +188,7 @@ export class PumpFunSDK {
);

return this.program.methods
.create(name, symbol, uri)
.create(name, symbol, uri, creator)
.accounts({
mint: mint.publicKey,
associatedBondingCurve: associatedBondingCurve,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import { AnchorProvider } from "@coral-xyz/anchor";
import NodeWallet from "@coral-xyz/anchor/dist/cjs/nodewallet";
import { printSPLBalance } from "../pumpdotfun-sdk/example/util";
let wallet: Keypair;
let dev_wallet: Keypair;
let dev_wallet: Keypair | undefined;
let quoteAmount: TokenAmount;
quoteAmount = new TokenAmount(Token.WSOL, QUOTE_AMOUNT, false);
export const solanaConnection = new Connection(RPC_ENDPOINT, {
Expand Down Expand Up @@ -167,12 +167,14 @@ export async function sell(
if (isJito) {
sendBundle(latestBlockhash.blockhash, transaction, mintPublicKey, wallet); // with jito
await new Promise((r) => setTimeout(r, 1000));
sendBundle(
latestBlockhash.blockhash,
transaction,
mintPublicKey,
dev_wallet
); // with jito
if (dev_wallet) {
sendBundle(
latestBlockhash.blockhash,
transaction,
mintPublicKey,
dev_wallet
); // with jito
}
} else simple_executeAndConfirm(transaction); // without jito
}

Expand Down Expand Up @@ -249,6 +251,9 @@ export async function createAndBuy(
tokenMetadata: any,
initialBuySolAmount: number
) {
if (!dev_wallet) {
throw new Error('dev_wallet is not configured');
}
const Wallet = new NodeWallet(dev_wallet);
const provider = new AnchorProvider(solanaConnection, Wallet, {
commitment: "processed",
Expand Down
15 changes: 10 additions & 5 deletions src/grpc_streaming_dev/grpc-raydium-sniper/src/jito/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,17 @@ return client;

let tipAccounts: string[] = [];
(async () => {
try {
tipAccounts = await c.getTipAccounts();
console.log('Result:', tipAccounts);
} catch (error) {
try {
const tipResult: any = await c.getTipAccounts();
if (tipResult && tipResult.ok) {
tipAccounts = tipResult.value as string[];
console.log('Result:', tipAccounts);
} else {
console.warn('Failed to fetch tip accounts', tipResult?.error);
}
} catch (error) {
console.error('Error:', error);
}
}
})();


Expand Down
6 changes: 4 additions & 2 deletions src/meteora/token-filters/pool-sol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ export async function getCurrentSolInPool(token_address:string):Promise<any> {
const dlmmPool = await fetchDLMMPool(token_address);
let solReserve:number;
if(dlmmPool.tokenX.publicKey.toBase58() === wsol){
solReserve = Number(dlmmPool.tokenX.amount)/Math.pow(10,dlmmPool.tokenX.decimal);
const decimalsX = (dlmmPool.tokenX as any).decimals ?? (dlmmPool.tokenX as any).decimal;
solReserve = Number(dlmmPool.tokenX.amount)/Math.pow(10,decimalsX);
}else{
solReserve = Number(dlmmPool.tokenY.amount)/Math.pow(10,dlmmPool.tokenY.decimal);
const decimalsY = (dlmmPool.tokenY as any).decimals ?? (dlmmPool.tokenY as any).decimal;
solReserve = Number(dlmmPool.tokenY.amount)/Math.pow(10,decimalsY);
}
console.log(solReserve);
return solReserve;
Expand Down
4 changes: 2 additions & 2 deletions src/pumpfunsdk/pumpdotfun-sdk/example/basic/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
printSPLBalance,
} from "../util";

const KEYS_FOLDER = __dirname + "/.keys";s
const KEYS_FOLDER = __dirname + "/.keys";
const SLIPPAGE_BASIS_POINTS = 100n;

//create token example:
Expand Down Expand Up @@ -85,7 +85,7 @@ const main = async () => {
},
);

if (createResults.success) {
if ((createResults as any).success) {
console.log("Success:", `https://pump.fun/${mint.publicKey.toBase58()}`);
boundingCurveAccount = await sdk.getBondingCurveAccount(mint.publicKey);
console.log("Bonding curve after create and buy", boundingCurveAccount);
Expand Down
6 changes: 3 additions & 3 deletions src/pumpfunsdk/pumpdotfun-sdk/example/events/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ const main = async () => {

let sdk = new PumpFunSDK(provider);

let createEvent = sdk.addEventListener("createEvent", (event) => {
let createEvent = sdk.addEventListener("createEvent", (event: any) => {
console.log("createEvent", event);
});
console.log("createEvent", createEvent);

let tradeEvent = sdk.addEventListener("tradeEvent", (event) => {
let tradeEvent = sdk.addEventListener("tradeEvent", (event: any) => {
console.log("tradeEvent", event);
});
console.log("tradeEvent", tradeEvent);

let completeEvent = sdk.addEventListener("completeEvent", (event) => {
let completeEvent = sdk.addEventListener("completeEvent", (event: any) => {
console.log("completeEvent", event);
});
console.log("completeEvent", completeEvent);
Expand Down
4 changes: 2 additions & 2 deletions src/pumpfunsdk/pumpdotfun-sdk/src/pumpfun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ export const METADATA_SEED = "metadata";
export const DEFAULT_DECIMALS = 6;

export class PumpFunSDK {
public program: Program<PumpFun>;
public program: Program<any>;
public connection: Connection;
constructor(provider?: Provider) {
this.program = new Program<PumpFun>(IDL as PumpFun, provider);
this.program = new Program<any>(IDL as any, new PublicKey(PROGRAM_ID), provider);
this.connection = this.program.provider.connection;
}
async bundleBuys(
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@

/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
"typeRoots": ["./types", "./node_modules/@types"]
}
}
5 changes: 5 additions & 0 deletions types/bnjs.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module 'bn.js' {
export default class BN {
constructor(number: string | number | bigint | Buffer | number[], base?: number, endian?: 'le' | 'be');
}
}