Transaction Optimization Guide
Transaction Optimization Guide
This guide will help you optimize your Node1 transactions, improve success rates, and reduce costs.
Transaction Optimization Strategies
Choose the Nearest Server Endpoint
Selecting the geographically closest server will provide the lowest latency:
- North America Users: Use
http://ny.Node1.tradeorhttp://slc.Node1.trade - Europe Users: Use
http://ams.Node1.tradeorhttp://fra.Node1.trade - Other Regions: Choose the best endpoint based on network latency tests
Optimize Tip Amount
The tip amount directly affects transaction priority:
- Minimum Tip: 0.001 SOL
- Recommended Tip: 0.001 - 0.01 SOL (adjust based on network congestion)
- High Priority: 0.01+ SOL (urgent transactions)
Monitor Network Status
Before sending transactions, check:
- Solana network status
- Current network congestion
- Average transaction confirmation time
Transaction Structure Optimization
Correct Transaction Format
{
"transactions": [
"base64_encoded_transaction_1",
"base64_encoded_transaction_2"
]
}Tip Instruction Example
// Add a tip transfer instruction to your transaction
const tipInstruction = SystemProgram.transfer({
fromPubkey: wallet.publicKey,
toPubkey: new PublicKey("FLaShB3iXXTWE1vu9wQsChUKq3HFtpMAhb8kAh1pf1wi"),
lamports: 1000000 // 0.001 SOL
});🧪 Sandwich Mitigation Feature
We have introduced a new feature to help mitigate sandwich attacks—without the need for the vote account method.
How It Works
In your Solana transaction, add any valid Solana public key that starts with jitodontfront to any instruction. For example: jitodontfront1111111Node1dottrade or jitodontfront1111111Node1dottrade
Any bundle containing a transaction with the jitodontfront account will be** rejected by the block engine **unless that transaction appears first (at index 0) in the bundle.
Transactions and bundles that do not contain this account are not impacted by this change.
✅ Allowed bundle patterns:
[tx_with_dont_front, tip][tx_with_dont_front, arbitrage, tip]
❌ Disallowed bundle patterns:
[tip, tx_with_dont_front][txA_with_dont_front, txB_with_dont_front][txA_with_dont_front, txB_with_dont_front, tip][trade, tx_with_dont_front, arbitrage, tip]
📌 Important Points:
- The account does not need to exist on-chain but must be a valid public key
- Mark the account as read-only to optimize landing speed
- (Optional) Use a unique variation of jitodontfront for your application (use your own pubkey), for example:
jitodontfront1111111Node1dottrade,jitodontfront1111111Node1dottrade - Supports AddressLookupTables
📋 Example:
// Add the protection account to your transaction instruction
const dontFrontAccount = new PublicKey("jitodontfront1111111Node1dottrade");
// Add to any instruction (recommended as read-only)
const protectedInstruction = {
programId: yourProgramId,
keys: [
{ pubkey: dontFrontAccount, isSigner: false, isWritable: false }, // read-only
// ... other accounts
],
data: instructionData
};Performance Optimization Tips
Connection Optimization
- Use persistent HTTP connections
- Enable connection reuse
- Set reasonable timeout values
- Send a ping request every 30 seconds
Error Handling
try {
const response = await fetch('http://ny.Node1.trade/api/v2/submit-batch', {
method: 'POST',
headers: {
'Authorization': authHeader,
'Content-Type': 'application/json'
},
body: JSON.stringify({ transactions: batch })
});
const result = await response.json();
if (result.success) {
console.log('Batch submitted successfully:', result.data);
} else {
console.error(`Error: ${result.message} (Code: ${result.code})`);
}
} catch (error) {
console.error('API request failed:', error);
throw error;
}Cost Optimization
Tip Strategy
- Adjust the tip based on transaction urgency
- Use the minimum tip for non-urgent transactions
- Dynamically adjust based on network congestion
Troubleshooting
Transaction Failure
- Check if the tip is sufficient
- Verify transaction format
- Confirm network connection
High Latency
- Switch to a closer endpoint
- Increase the tip amount
- Check network status
High Cost
- Optimize batch size
- Adjust tip strategy
- Choose the appropriate time window
Best Practices Summary
- Always use the nearest server endpoint
- Dynamically adjust the tip based on network status
- Implement a reasonable retry mechanism
- Monitor key performance indicators
- Optimize transaction batch size
- Maintain robust error handling in your code
By following these optimization strategies, you will significantly improve transaction success rates, reduce latency, and optimize cost efficiency.
