Comments (7)
Perhaps the node provider (RPC) requires maintenance?
I've attempted various troubleshooting steps. While processing data, I utilize the rpc helius, and for sending transaction data, I employ mainnet beta. Some transactions have gone through, indicating that there may be an issue with the RPC provider node that needs to be addressed.
from raydium-sdk-v1-demo.
same here, code worked 2 days ago but no longer
from raydium-sdk-v1-demo.
Can anyone solve this problem.?
from raydium-sdk-v1-demo.
Solana is heavily congested. To increase the chances of your transactions being included you must add priority fee to them. Unfortunately it does not guarantee that it will be accepted... Refer to this tweet to know why: https://twitter.com/0xCygaar/status/1776331763477819701
If you want a function that handle priority fee, add this in utils.ts
:
export async function createAndSendV0Tx(txInstructions: TransactionInstruction[], wallets: Keypair[]) {
let latestBlockhash = await connection.getLatestBlockhash('finalized');
// Set your fee values here
const priority_fee_price = ComputeBudgetProgram.setComputeUnitPrice({microLamports: 25000})
txInstructions.push(priority_fee_price);
const messageV0 = new TransactionMessage({
payerKey: wallets[0].publicKey,
recentBlockhash: latestBlockhash.blockhash,
instructions: txInstructions
}).compileToV0Message();
const transaction = new VersionedTransaction(messageV0);
console.log("Transaction size:", transaction.serialize().length);
transaction.sign(wallets);
const txid = await connection.sendTransaction(transaction, { skipPreflight: true, maxRetries: 5 });
console.log("Transaction sent to network");
const confirmation = await connection.confirmTransaction({ signature: txid, blockhash: latestBlockhash.blockhash, lastValidBlockHeight: latestBlockhash.lastValidBlockHeight });
if (confirmation.value.err) { throw new Error("Transaction not confirmed.") }
console.log(`Transaction succesfully confirmed! https://explorer.solana.com/tx/${txid}`);
}
Then in the scripts instead of:
return { txids: await buildAndSendTx(innerTransactions) }
Do this:
return await createAndSendV0Tx(innerTransactions[0].instructions, [wallet]);
If your transaction doesn't show on the explorer after that, try to increase the priority fee and / or change RPC.
You can come to the Raydium discord in the ask-dev channel, you will get more active assistance than here.
from raydium-sdk-v1-demo.
So we need to set the microLamports higher, right?
from raydium-sdk-v1-demo.
As stated in the tweet I shared, the problem is bots spamming the nodes, most transactions don't even get in because they are full. The fee is for when your transaction is received, to be prioritized and not fail. So, having a priority fee + retrying to send your transaction is the solution. But don't set the microLamports too high, 25000-250000 max should do, more would be a waste of money.
(Source: 0xCygaar and 0xBreadguy)
from raydium-sdk-v1-demo.
Priority fees is likely less important than the tx dropping in this case. You can use the method getRecentPriorityFees method to do a check. most txns does not pay that much priority fees to get executed.
For the bot that spams txn on the network layer, is it correct to state there is no fee imposed on them since those dropped txn never made it to chain to pay any fee? So it is a matter of free spamming till your txn gets through.
from raydium-sdk-v1-demo.
Related Issues (20)
- swaponlyamm suggestion HOT 3
- Creating a new market fails HOT 2
- bigint: Failed to load bindings, pure JS will be used (try npm run rebuild?) HOT 1
- Unable create pool on devnet HOT 1
- Running swapOnlyAMM throw error HOT 3
- The error occurs when invoking ammCreatePool.ts HOT 5
- Running swapRoute throw error
- bad secret key size HOT 4
- Where is the ammV3MarketMaker file? HOT 1
- subNewAmmPool runs without receiving events HOT 1
- Create Pool Tx not Found on Solana Devnet Explorer
- Bad secret key size HOT 1
- Program logged: "Error: InvalidFee" on Devnet when creating AMM HOT 1
- Thanks!
- Why swapRoute.ts soooooo slow?
- staked list
- Error when create pool on devnet HOT 4
- l HOT 1
- getClmmPoolInfo not showing proper coin price HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raydium-sdk-v1-demo.