πŸš€Achieve Best Performance for Landing a Transaction

To achieve the best performance for landing a singular transaction (landing speed and inclusion rate), your transaction should include a Priority Fee & a Tip.

When calling the submitting endpoint, do NOT use the frontRunningProtection option or there is a good chance that your transaction will be delayed. Make sure your transaction includes a good Priority Fee & a Tip. If you are not Enterprise-Elite or higher tier, your transaction is required to have a bloXroute memo instruction.

In addition, Trader API offers some additional parameters to enhance the propagation of your transactions, like staked connections. Your bloXroute subscription tier will also affect how many channels will be used for propagation, which affects the propagation time.

Follow the steps below for best practice for getting the optimal performance:

Priority fee

Make sure your transaction includes the priory fee by adding computePrice instruction. You can use the Priority Fee Stream to get the current recommended priority fee.

const modifyComputeUnits = ComputeBudgetProgram.setComputeUnitLimit({ 
  units: 1000000 
});

const addPriorityFee = ComputeBudgetProgram.setComputeUnitPrice({ 
  microLamports: 1 
});

const transaction = new Transaction()
.add(modifyComputeUnits)
.add(addPriorityFee)
...
  );

tip Instruction

If you want to get the optimal performance you need to include a tip instruction. The Trader API service fee will be determined by the different features you will use (such as stacked connection, on-demand TPUs etc) so make sure to include a high enough tip.

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:

SNS Name
Address

bloxroute.sol

HWEoBxYs7ssKuudEjzjmpfJVX7Dvi7wescFsVx2L5yoY

bloxroute1.sol

95cfoy472fcQHaw4tPGBTKpn6ZQnfEPfBgDQx6gcRmRg

Submit the transaction

Submit your transaction to Trader API using the Submit Endpoint. Make sure frontRunningProtection is set to False.

For best performance and assuming you included a high enough tip and set useStakedRPCs to True

curl -X 'POST' \
  'https://ny.solana.dex.blxrbdn.com/api/v2/submit' \
  -header "Authorization: $AUTH_HEADER" \
  -d '{
 "transaction": {"content": "AjF+Br2CUIENJqV1...BAAABCQ=="},
 "frontRunningProtection": false,
 "useStakedRPCs": true,
}'

If you are not an Elite or Ultra user, your transaction must include the bloXroute Memo Instruction.

Construct Memo Program Instruction by yourself

Our SDKs include hooks for adding this instruction for successful submission:

import "github.com/gagliardetto/solana-go"

// AddMemoToSerializedTxn adds memo instruction to a serialized transaction, it's primarily used if the user
// doesn't want to interact with Trader-API directly
func AddMemoToSerializedTxn(
	txBase64, 
	memoContent string,
	owner solana.PublicKey, 
	privateKeys map[solana.PublicKey]solana.PrivateKey
) (string, error) {}
	
// CreateTraderAPIMemoInstruction generates a transaction instruction that places a memo in the transaction log
// Having a memo instruction with signals Trader-API usage is required
func CreateTraderAPIMemoInstruction(msg string) solana.Instruction {}

If your language of choice is not included above, you can create an instruction referencing program HQ2UUt18uJqKaQFJhgV9zaTdQxUZjNrsKFgoEDquBkcx, with any data as the body. Make sure the memo_content is exactly "Powered by bloXroute Trader Api".

Commonly used Submission Modes.

This paragraph summarizes different submission modes by different parameter configurations.

Mode - Nickname
Parameter config
Require tip?
Description

Fastest mode

frontRunningProtection: False, useStakedRPCs: True

Yes. Min: 0.001 SOL

The MOST used submission method. Same as the article explained on this page. This mode gives you the most speed advantage when submitting transactions. This method made full use of our infrastructure.

MEV protected mode

frontRunningProtection: True

Yes. Min: 0.001 SOL

This is a full MEV-protected submission method. Commonly used when the swap transaction has a huge slippage. We utilize Jito bundle for this purpose. However, due to the fact not every validator is a Jito validator, the propagation speed of this method will be relatively slower, especially when there are multiple consecutive leaders are non-Jito validator.

In-the-middle mode

frontRunningProtection: True, fastBestEffort: True

Yes. Min: 0.001 SOL

Our backend has been consistently monitoring sandwich activities onchian. We dynamically identify low-risk validators. By using this method, we will propagate to both Jito and bloXroute-identified low-risk validators. This way, your transaction will most likely be MEV-protected while enjoying some level of landing speed escalation.

*Debug mode

skipPreFlight: True

No

Commonly used to debug transaction construction. Any failed transaction will still land on-chain with log information. Developers can use the log information for debugging purposes.

*Pre-simulation mode

skipPreFlight: False

No

Trader API will simulate transactions before propagation. You shall expect a 200 response only when the simulation is successful.

*Only paid customers (Enterprise Tier and plus) can submit transactions without tips.

Last updated