Trader API provides two advanced features: Front-Running Protection and Transaction Bundling.
Features
Front-Running Protection
Protects your transactions from MEV attacks when calling the Submit endpoint.
Two modes:
Fast Best Effort: Sends transactions to Jito and low-risk validators for a balance of protection and speed.
Jito Only: Uses Jito exclusively for maximum protection.
Transaction Bundling
Executes multiple transactions together as a single, atomic bundle when calling the Batch Submit endpoint:
Sequential: Transactions execute in the provided order.
Atomic: All transactions succeed or none are included.
All-or-Nothing: If one transaction fails, the entire bundle is rejected.
Fees
Front-Running Protection: 2–5% of the tip (based on your account tier).
Transaction Bundles: 5% of the total tip per transaction in the bundle.
Example: A bundle with 2 transactions incurs a 10% tip fee (Introductory tier).
Maximum of 4 transactions in a bundle.
Minimum Tip: 0.001 SOL (1,000,000 lamports).
Account Tier
Tip Service Fee
Ultra
2%
Enterprise-Elite
2%
Enterprise
4%
Professional
5%
Introductory
5%
Setting a higher tipwill yield a faster inclusion.
Custom Transaction Construction
If you’re not using Trader API endpoints, include a tip instruction manually in your transactions to enable these features.
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 instruction
If your language of choice is not included above, you can create an instruction referencing our tip-receiving addresses: