Search
K

Bundles

Bundles allow sequential and atomic transaction execution on Solana. Batch execute trades or efficiently capture MEV!

Sending your first bundle

The quickest way to start sending bundles is to try out the CLI client in our searcher-examples repo.
Prerequisites: make sure you have set up your environment, as described in Getting Started
  1. 1.
    Set up the searcher-examples repo

What are bundles?

Bundles are a list of transactions that execute sequentially and atomically, all-or-nothing. To explain more:
  • Sequentially: provide a list of transactions in a bundle and they are guaranteed to execute in order.
  • Atomically: bundles execute atomically within the same slot. A bundle can't cross slot boundaries and if the entire thing executes successfully, it will all be committed to the chain.
  • All-or-nothing: bundles can only contain successful transactions. If any transaction in a bundle fails, no transactions in the bundle will make it on-chain.
A user can send a bundle that contains multiple transactions and guarantee that they are all executed sequentially.

How do they work?

Jito-Solana has a special bundle execution stage, called BundleStage, which understands how to execute bundles.
Users can send bundles to Jito's Block Engine and it will take care of sending bundles to the validators running Jito-Solana.

When can I use bundles?

Bundles only work when a Jito-Solana leader is producing blocks. The normal validator client doesn't receive bundles or know how to execute bundles.

What are some examples of bundles?

Arbitrage
One can use bundles and the mempool stream to perform atomic arbitrage. When doing this, a user would subscribe to the mempool stream and wait for a transaction that exposes MEV. When they find one, they can submit a bundle with transactions: [user_tx, arb_tx].
An open-source arb bot implementing bundles is available here. This offers an easy way to get started and should be a good base for further optimizations.
Liquidations
To perform liquidations with bundles, one can subscribe to oracle transactions. When an oracle transaction comes in that allows someone's account to be liquidated, they can send a bundle with the transactions: [oracle_tx, liq_tx].
Batching DeFi operations
If one needs to batch DeFi operations and can't do it in a single transaction due to transaction size limits or compute budget, send a bundle to Jito's Block Engine. This allows one to get around the pesky sequence IDs needed to ensure correct ordering in DeFi operations. An example of batching defi operations could be market making an on-chain DEX.

How do I send a bundle?

Sending bundles is currently free, but API-gated to avoid abuse. The block engine uses a challenge-response authentication mechanism with messages signed by a local Solana keypair. This local keypair shouldn't contain funds and doesn't need to be related to the keypair you sign transactions or submit bundles for. To get access to the block engine, please generate a new solana keypair and submit the public key here: https://web.miniextensions.com/WV3gZjFwqNqITsMufIEp
After getting your key approved, one can check out the send bundle command in the searcher cli located here: https://github.com/jito-labs/searcher-examples

What are tips?

Because bundles have their own execution fast-lane, they need to tip validators so validators are incentivized to process them ahead of other transactions.
In order to tip validators, a user needs to submit a SOL transfer to one of the tip addresses on-chain. The tip addresses can be found here: https://jito-foundation.gitbook.io/mev/mev-payment-and-distribution/on-chain-addresses.
NOTE: Ensure that your tip is an instruction in the last transaction of your bundle. If you include it as a separate transaction, it could get stolen from a malicious validator or other user on the network if it ends up on a fork.
Note that tips don't prioritize transactions for non Jito-Solana leaders and will be a waste of money. The block engine currently has a 1,000 lamport minimum for tips.

How does the block engine determine which bundles are sent to validators?

The block engine performs a series of checks with bundles when deciding whether to send them to a validator or not. The checks include:
  • Basic sanity check
    • are these actually transactions?
    • are they signed properly?
    • is there less than or equal to 5 transactions in the bundle?
  • Simulation check
    • will all transactions in these bundles succeed if they're sent to the validator?
    • how much is this bundle paying compared to other submitted?
  • Auction check
    • bundles are split into groups based on what state they read and write lock.
    • bundles are simulated and put in an ordering from highest to lowest payer.
    • the top N highest paying bundles are selected.

Why are my bundles not landing?

Bundles can not be landing for a few reasons:
  • The block is full. (we are actively improving this)
  • The bundle didn't win the auction.
  • The bundle did not tip the minimum amount necessary, as of this writing that amount is 1000 Lamports.