bilix-software / solana-pump-fun

Facilitates the execution and simulation of buy and sell transactions for pump.fun on the Solana blockchain.
https://viper.bot
MIT License
93 stars 43 forks source link

Buy tx problem #2

Closed webby-the-dev closed 4 months ago

webby-the-dev commented 4 months ago

Hey, Looks like code does not work anymore after pumpfun hack few days ago. Can you please double check what needs to be changed? I am sure I cloned this repo before pumpfun hack and it was working really good, now I've just cloned it, pasted in private key and pumpfun address and IM getting block height exceeded error. Using same config.

bilix-software commented 4 months ago

Hi, that has to do with a lot of transactions failing atm on the chain. Try bundling it through jito or using a private rpc from helius or bloxroutes. I can confirm the code is definitely still working.

bilix-software commented 4 months ago

Alternatively you could try adding a priority fee to your transaction to increase the chance of it being accepted. As described here: https://solana.com/developers/cookbook/transactions/add-priority-fees

webby-the-dev commented 4 months ago

Is there a way to contact you directly instead of here? To fix it quicker

webby-the-dev commented 4 months ago

I've tried to add priority fee in utils.ts like:

  const modifyComputeUnits = ComputeBudgetProgram.setComputeUnitLimit({
    units: 1400000,
  });

  // set the desired priority fee
  const addPriorityFee = ComputeBudgetProgram.setComputeUnitPrice({
    microLamports: 5,
  });
  const transaction = new Transaction()
    .add(modifyComputeUnits)
    .add(addPriorityFee)
    .add(...instructions);

but I'm still getting Error sending transaction: TransactionExpiredBlockheightExceededError: Signature 3aAspp1dP8CoYvHz5t9jRtStfdY7kxnLBJr8nieLoRcazXnCjVgdkGFXWfZB27jtChE7ds2rUmpSWPnddVWf5y5X has expired: block height exceeded.

I've tested it on like 4 different RPCs so I think its not RPC issue

bilix-software commented 4 months ago

Yeah I tried it and also see its not being included at that amount. I just tried with the following:

    const modifyComputeUnits = ComputeBudgetProgram.setComputeUnitLimit({
        units: 1400000,
    });

      // set the desired priority fee
      const addPriorityFee = ComputeBudgetProgram.setComputeUnitPrice({
        microLamports: 100000,
    });

And that went through, so i would say experiment with the prio fee amount needed to get it included. This was a 0.00014 SOL prio tip.

You can contact me at info@bilix.io or on twitter at @BilixSoftware

webby-the-dev commented 4 months ago

Yeah I tried it and also see its not being included at that amount. I just tried with the following:

    const modifyComputeUnits = ComputeBudgetProgram.setComputeUnitLimit({
        units: 1400000,
    });

      // set the desired priority fee
      const addPriorityFee = ComputeBudgetProgram.setComputeUnitPrice({
        microLamports: 100000,
    });

And that went through, so i would say experiment with the prio fee amount needed to get it included. This was a 0.00014 SOL prio tip.

You can contact me at info@bilix.io or on twitter at @BilixSoftware

I've changed values to same ones and it still does not go through.... I've sent you DM on twitter

bilix-software commented 4 months ago

I just pushed a new version with configurable sol tip. Hope that makes it easier.

bilix-software commented 4 months ago

For anyone else struggling with inclusion check out the transactions on my testing wallet here: https://solscan.io/account/JATt1ta9GcbVMThdL18rXUqHn3toCMjWkHWtxM5WN3ec

They were all done on the public mainnet-beta rpc, with the following settings:

   async main() {
        const solIn = 0.0001; // Example value, adjust as needed
        const slippageDecimal = 0.25; // Example value, adjust as needed
        const tokenBalance = 2008000000; // Example value, adjust as needed
        const priorityFeeInSol = 0.001; // Example value for tip to get faster inclusion, adjust as needed

        try {
            // Call the buy function
            await pumpFunBuy(this.transactionMode, this.payerPrivateKey, this.mintAddress, solIn, priorityFeeInSol, slippageDecimal);

            // Call the sell function
            await pumpFunSell(this.transactionMode, this.payerPrivateKey, this.mintAddress, tokenBalance,priorityFeeInSol, slippageDecimal);
        } catch (error) {
            console.error('Error in main function:', error);
        }
    }