Best Performance for Landing Transactions
Optimizing Transaction Performance
To ensure high speed and inclusion rate for singular transactions, follow these guidelines:
1. Priority Fee:
Add a compute price instruction to your transaction for better prioritization.
Use the Priority Fee Stream to fetch the recommended fee in real-time.
const modifyComputeUnits = ComputeBudgetProgram.setComputeUnitLimit({
units: 1000000
});
const addPriorityFee = ComputeBudgetProgram.setComputeUnitPrice({
microLamports: 1
});
const transaction = new Transaction()
.add(modifyComputeUnits)
.add(addPriorityFee)
...
);let txn = submit_transaction(
&connection,
&wallet_signer,
// Array of instructions: 0: Set Compute Unit Limt, 1: Set Prioritization Fee,
// 2: Do something, 3: Do something else
[ComputeBudgetInstruction::set_compute_unit_limit(1_000_000u32),
ComputeBudgetInstruction::set_compute_unit_price(1u32),
...
)?;2. Include a Tip Instruction:
Ensure your transaction includes a tip for enhanced propagation.
The service fee is based on the features used (e.g., staked connections).
Use the Bundle Tip Stream to determine an optimal tip amount.
import (
"github.com/gagliardetto/solana-go"
"github.com/gagliardetto/solana-go/programs/system"
)
const (
// BloxrouteTipAddress is from here and may fall out of date from time to time. Check our docs:
// https://docs.bloxroute.com/solana/trader-api-v2/front-running-protection-and-transaction-bundle
BloxrouteTipAddress = "HWEoBxYs7ssKuudEjzjmpfJVX7Dvi7wescFsVx2L5yoY"
)
// CreateBloxrouteTipTransactionToUseBundles creates a transaction you can use to when using PostSubmitBundle endpoints.
// This transaction should be the LAST transaction in your submission bundle
func CreateBloxrouteTipTransactionToUseBundles(privateKey solana.PrivateKey, tipAmount uint64, recentBlockHash solana.Hash) (*solana.Transaction, error) {
recipient := solana.MustPublicKeyFromBase58(BloxrouteTipAddress)
tx, err := solana.NewTransaction([]solana.Instruction{
system.NewTransferInstruction(tipAmount, privateKey.PublicKey(), recipient).Build()}, recentBlockHash)
if err != nil {
return nil, err
}
signatures, err := tx.Sign(func(key solana.PublicKey) *solana.PrivateKey {
if key.Equals(privateKey.PublicKey()) {
return &privateKey
}
return nil
})
if err != nil {
return nil, err
}
tx.Signatures = signatures
return tx, nil
}import {
Keypair,
PublicKey,
Transaction,
TransactionInstruction,
MessageCompiledInstruction,
VersionedTransaction,
SystemProgram,
} from "@solana/web3.js"
// check documentation for latest tip wallet, and how to send tip transactions
// https://docs.bloxroute.com/solana/trader-api-v2/front-running-protection-and-transaction-bundle
const TRADER_API_TIP_WALLET = "HWEoBxYs7ssKuudEjzjmpfJVX7Dvi7wescFsVx2L5yoY"
// createTraderAPIMemoInstruction generates a transaction instruction that places a memo in the transaction log
// Having a memo instruction with signals Trader-API usage is required
export function CreateTraderAPITipInstruction(
senderAddress: PublicKey,
tipAmount: number
): TransactionInstruction {
const tipAddress = new PublicKey(TRADER_API_TIP_WALLET)
return SystemProgram.transfer({
fromPubkey: senderAddress,
toPubkey: tipAddress,
lamports: tipAmount,
})
}from numpy import uint64
from solders import pubkey as pk
from solders import instruction as inst
from solders import transaction as solders_tx
from solders.hash import Hash
from solders.keypair import Keypair
from solders.message import Message
from solders.pubkey import Pubkey
from solders.system_program import transfer, TransferParams
from solders.transaction import Transaction
# as of 2/12/2024, this is the bloxRoute tip wallet... check docs to see latest up to date tip wallet:
# https://docs.bloxroute.com/solana/trader-api-v2/front-running-protection-and-transaction-bundle
BloxrouteTipWallet = pk.Pubkey.from_string(
"HWEoBxYs7ssKuudEjzjmpfJVX7Dvi7wescFsVx2L5yoY"
)
# create_trader_api_tip_instruction creates a tip instruction to send to bloxRoute. This is used if a user wants to send
# bundles or wants front running protection. If using bloXroute API, this instruction must be included in the last
# transaction sent to the API
def create_trader_api_tip_instruction(
tip_amount: uint64,
sender_address: Pubkey,
) -> inst.Instruction:
instruction = transfer(
TransferParams(
from_pubkey=sender_address,
to_pubkey=BloxrouteTipWallet,
lamports=int(tip_amount),
)
)
return instructionIf your language of choice is not included above, you can create an instruction referencing our tip-receiving addresses
3. Submission Endpoint Configuration:
Use the submit endpoint (*You shall submit the transaction to the closest region and the global endpoint in parallel) with the following parameters for best performance:
frontRunningProtection: falseuseStakedRPCs: truesubmitProtection: SP_LOW
# USE HTTP, NOT HTTPS, FOR THE BEST PERFORMANCE
curl -X 'POST' \
'http://ny.solana.dex.blxrbdn.com/api/v2/submit' \
-header "Authorization: $AUTH_HEADER" \
-d '{
"transaction": {"content": "AjF+Br2CUIENJqV1...BAAABCQ=="},
"frontRunningProtection": false,
"useStakedRPCs": true,
"submitProtection": SP_LOW
}'wscat -c ws://ny.solana.dex.blxrbdn.com/ws --execute '{"jsonrpc": "2.0", "id": 1, "method": "PostSubmit", "params": {
"transaction": {"content": "AjF+Br2CU...AMBAAABCQ=="},
"frontRunningProtection": false,
"useStakedRPCs": true,
"submitProtection": SP_LOW
}}'# submitting raw transactions
await api.post_submit(
post_submit_request=proto.PostSubmitRequest(
transaction=proto.TransactionMessage(content=signed_tx),
front_running_protection=False,
use_staked_RPCs=True,
submit_protection=SP_LOW
)
await provider.postSubmit({
transaction: { content: encodedTxn, isCleanup: false },
frontRunningProtection: false,
useStakedRPCs: true,
submitProtection: SP_LOW
})4. Send to the right regions
Global endpoint (recommended)
Global — Submit ONLY
Use the Global endpoint to automatically route your transaction submits to the closest Trader API transaction-handling instances. This reduces end-to-end latency and improves landing performance—especially when your bot is within ~2 ms RTT of a Trader API region. For best results, send to the Global endpoint in parallel with your preferred regional endpoint(s).
Host: global.solana.dex.blxrbdn.com
How to use
Primary target: Point your Trader API base URL/host to the Global endpoint
Parallelization: Also send the same transaction to your nearest regional endpoint(s) in parallel to maximize time-to-first-land.
No other config changes needed.
Global only supports
http
Global (recommended)
global.solana.dex.blxrbdn.com
To ensure accurate routing, use a public DNS resolver that supports EDNS Client Subnet (ECS), such as Google DNS (8.8.8.8) or OpenDNS (208.67.222.222 / 208.67.220.220). Resolvers without ECS support (e.g., Cloudflare) may obscure the client ASN, leading to suboptimal routing.
Choose your closest region
For consistent best performance, pair the Global endpoint with the closest region to where your bot runs.
Find regions & hosts: See the full, always-updated list here: https://docs.bloxroute.com/solana/trader-api/introduction/regions
Pick the nearest region: Choose the region with the lowest RTT from your bot host. If you’re already ~2 ms from a Trader API region, the Global endpoint will typically select it—and parallel sends ensure you still catch the fastest path.
Practical tip: Measure latency from the same machine that runs your bot.
Latency check examples
# Quick TCP connect timing (good proxy for RTT)
curl -s -o /dev/null -w "connect:%{time_connect}\n" http://<region-host>
# ICMP ping (if enabled on your network)
ping -c 5 <region-host>Parallel submit pattern (pseudo-code)
# Send once to Global, and in parallel to your nearest region(s)
targets = [
"http://global.solana.dex.blxrbdn.com",
"http://<your-nearest-region-host>" # from the Regions page above
]
# Fire in parallel; accept the first success
first_ok = race([submit_tx(t, tx_bytes) for t in targets])
return first_okGuidance
Always include Global in your send set.
Add 1–2 closest regions in parallel for resilience and the best possible landing time.
Keep your region list current using the Regions page linked above.
5. Make sure to keep the HTTP connection live.
The maximum duration for the Trader API keep-live is about 60 seconds. We recommended doing a "keep-live" request every 60 seconds. You can execute a GET request (like, rate-limit) or omit the api-key.
Commonly used Submission Modes.
This table summarizes different submission modes by different parameter configurations.
Fastest mode
frontRunningProtection: False,
useStakedRPCs: True, submitProtection: SP_LOW
0.001 SOL
Max speed by leveraging staked RPC connections.
Ideal for time-sensitive transactions.
MEV-protected mode
frontRunningProtection: True, submitProtection: SP_MEDIUM
0.001 SOL
Protects against MEV attacks based on the bloXroute Malicious Leader detection system.
Slightly slower if consecutive flagged malicious validators are present.
submitProtection: SP_HIGHcan be used to further the MEV protection level.
Transaction Revert Protection
frontRunningProtection: True, reverProtection: True
0.001 SOL
Transactions will only be sent to the Jito block engine and the Paladin leader.
Failed transactions won't land on the chain.
This method is the slowest method as no public RPC propagation channels will be used. If consecutive non-Jito nor non-Paladin validators are present, it could be even slower.
Last updated