I used to think priority fees were the magic bullet for transaction ordering.
My bots kept landing half of a two-step trade. The buy would go through, but the sell would drop. Or vice versa.
I’d watch the logs, see the first transaction succeed, and then panic as the second one vanished into the void. I cranked up the priority fees. Nothing changed. The order was still wrong.
It wasn’t the price. It was the mechanics.
A bundle is not a batch job
A lot of people treat multiple transactions like a list to be executed. If one fails, the others might still land. That’s fine for independent tasks. It’s a disaster when step two depends on step one.
Jito bundles work differently. You send up to five transactions together to the Jito block engine. They execute in order, back to back, and atomically. All land or none land. There is no middle state where you’re left holding an asset you didn’t mean to keep.
There is a catch. Bundles only land in slots where the leader runs the Jito validator client. That’s most of the stake on mainnet, but not all of it. If a non-Jito leader produces the next block, your bundle doesn’t execute. It doesn’t fail exactly, it just doesn’t land.
This changes how you think about reliability. You aren’t gambling on one slot. You need retry logic to catch the next opportunity.
The tip is how you win the auction
You don’t pay a fee to the network directly like a standard priority fee. You pay a tip to Jito.
The tip is a simple SOL transfer inside your bundle. Usually, I put it as the last instruction of the last transaction. This ensures the tip only goes out if the whole bundle lands. If the bundle fails, you don’t lose the tip.
You need to know where to send that tip. Jito publishes a list of tip accounts. You fetch them using the getTipAccounts JSON-RPC method on the block engine. Then you pick one at random. Don’t always use the same one, or you’ll create a bottleneck.
The minimum tip is 1000 lamports. That’s tiny. But in a busy slot, 1000 lamports won’t win anything. You need to compete with other bundles. I usually start higher and adjust based on success rates.
Here’s what the tip instruction looks like:
import { SystemProgram, PublicKey } from '@solana/web3.js';
const tipAccount = new PublicKey(tipAccounts[randomIndex]);
const tipInstruction = SystemProgram.transfer({
fromPubkey: payer.publicKey,
toPubkey: tipAccount,
lamports: 5_000_000, // 0.005 SOL, adjust as needed
});
Keep this instruction inside a transaction that is part of your bundle. If you send the tip in its own separate transaction, it can land on its own while your main trade fails. That’s burning money for nothing.
Sending the bundle
You send the bundle to Jito’s block engine API. It’s a standard JSON-RPC call.
The endpoint is https://mainnet.block-engine.jito.wtf/api/v1/bundles. The method is sendBundle. You pass an array of serialized transactions. Each transaction must be fully signed.
const res = await fetch('https://mainnet.block-engine.jito.wtf/api/v1/bundles', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'sendBundle',
params: [
txs.map((tx) => Buffer.from(tx.serialize()).toString('base64')),
{ encoding: 'base64' }
]
})
});
const data = await res.json();
const bundleId = data.result;
That bundleId is your receipt. You use it to check status later.
One thing that trips people up: the public block engine endpoint is rate limited. If you’re sending a lot of bundles, you’ll hit that limit fast. I either batch my requests carefully or use a private endpoint if volume gets high. Don’t assume you can fire off a bundle every 100ms forever.
Checking if it landed
You don’t know if your bundle succeeded until you ask. Use the getBundleStatuses method on the same endpoint. Pass in the bundle ID.
If it returns nothing, it didn’t land. Don’t wait forever. The bundle is either in a slot that hasn’t been produced yet, or it’s gone. If you’re building a bot, set a timeout. If it doesn’t land within a few slots, consider it dead.
When you retry, generate a fresh blockhash. Reusing an old blockhash is a classic mistake. The transaction becomes invalid, and your bundle fails before it even gets to the execution stage.
const statusRes = await fetch('https://mainnet.block-engine.jito.wtf/api/v1/bundles', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
id: 2,
method: 'getBundleStatuses',
params: [[bundleId]]
})
});
const statusData = await statusRes.json();
const status = statusData.result?.value?.[0]
// null means it hasn't landed, otherwise check status.confirmation_status
To see why a bundle didn’t land, use getInflightBundleStatuses on the same endpoint. It covers bundles from the last five minutes. It returns a status of Pending, Failed, Landed, or Invalid. Failed usually means the transactions failed simulation or the tip lost the auction.
When I don’t use bundles
I don’t use bundles for everything. If I’m doing a single simple transfer or a basic swap that doesn’t depend on another transaction, a bundle is overkill.
A priority fee is enough for those cases. It buys you a better place in the queue for that single transaction. You pay more, and you get confirmed faster. That’s it.
Bundles solve a different problem. They solve ordering and atomicity. If your flow has multiple steps where one depends on the other, bundles are the tool. If it’s just one step, don’t complicate it.
Know which problem you’re solving
I spent months thinking my priority fees were too low because my trades kept failing halfway through. They weren’t too low. They were irrelevant to the ordering problem.
Priority fees buy you a better place in line. Bundles buy you order and all-or-nothing execution. They do different jobs.
If your transactions are independent, use priority fees. If they’re interdependent, use bundles. Stop mixing them up. Your bot will thank you, and your SOL balance won’t bleed out on tips for failed partial trades.