Front-Running Protection & Transaction Bundle
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
A service fee will be charged for Front-Running Protection. It will be 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).
Ultra
2%
Enterprise-Elite
2%
Enterprise
4%
Professional
5%
Introductory
5%
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
}
If your language of choice is not included above, you can create an instruction referencing our tip-receiving addresses:
➡️ Next Steps: Submit a transaction or submit a bundle of transactions
Last updated