Bundles

Article title image

What are bundles? 

Bundles are transactions grouped together into a single unit, bundle, and submitted all at once. Transactions within a bundle are executed in the specified order.

Bundles in DeFi Algo Trading

Primarily, bundles are used by MEV searchers who are attempting to capture MEV opportunities. For example, when there is a target swap transaction (trigger transaction), a searcher can submit a bundle with the trigger transaction along with a front-running transaction placed right before the trigger transaction and a back-running transaction after that, creating a sandwich attack.

How do bundles work? 

When an MEV opportunity arises, a searcher will bundle together transactions to capture the MEV and submit them in a single bundle to the block builder to get included in the block. The builder receives bundles from a variety of searchers. As a rule of thumb, bundles with the most profitable transactions will be favored by the block-building algorithms and included in the block. Bundle/transaction profitability is determined by fee per gas used, priority fee, and direct validator payments.

Bundles are atomic, meaning that no other transactions will be placed in between the bundle’s transactions. Also, bundles can be placed anywhere in the block. In this case, transactions can be placed between the bundles but not within a bundle itself. 

When a searcher submits a bundle to a block builder, it is an all-or-nothing execution. If one transaction does not go through, then the rest of the transactions will not go through, and the transactions in the bundle will revert. If you are interested in learning how you can revert specific transactions included in a bundle, reach out to bloXroute support team.

Bundles can be combined with other bundles to create different strategies.  

Article title image

Why are bundles important in DeFi trading?

Bundle trading strategies represent a significant part of all DeFi trading activities. One of the main reasons for this is atomic inclusion. Atomic inclusion ensures that all the transactions will not only be executed within the same block but in a particular order as well. Simulating trades, identifying profitable opportunities, and then executing them all within a single block lowers risks associated with trading significantly since you are taking time exposure out of the equation. Below, we’ve outlined several simplified examples of using bundles in DeFi trading. 

  • DEX to DEX arbitrage with bundles
    • A searcher finds a price discrepancy between the USDT and WETH pairs on Uniswap and Sushswap.
    • Buys 1 ETH for 1800 USDT on Uniswap
    • Sells 1 ETH for 1850 USDT on Sushiswap 
    • Pockets the profit of 50 USDT 
  • Sandwich attack with a bundle
    • A searcher is monitoring several trading pairs on Uniswap and notices a high-value pending TX in the mempool that will move the spot price.
    • A searcher submits a bundle of transactions with the transaction in the middle while paying higher gas price fees to re-order transactions within the block and position yourself right before and after the user’s target transaction, essentially frontrunning it at first and backrunning it at last. 

bloXroute bundle services

  • Ethereum Bundle Submission - Searchers can submit bundles directly to all supported builders or a specific builder via Gateway or bloXroute Cloud-API. 
  • BSC Bundle Submission - Searchers can submit BSC bundles to Cloud-API, which validates and forwards the bundle to MEV Relays directly connected to BSC validators participating in our MEV solution program. 
  • Bundle Simulation - Simulate the execution of an MEV bundle to make sure transactions are valid. 

No matter what chain bundles are submitted on, the best way to increase the likelihood of them getting executed on-chain quickly is to tip the validators or pay higher gas prices to outbid the competition.