jito-bundle
Standalone Rust library for submitting Jito Bundles on Solana.
Submit up to 5 transactions that execute atomically and in order. The library handles tip calculation, bundle construction, simulation, endpoint retry, and on-chain confirmation.
Jito Bundle Explorer: https://explorer.jito.wtf/
Features
- Atomic bundle construction from fixed-size
BundleInstructionSlotsinput. - Automatic tipping via
TipStrategy. - Endpoint retry across Jito mainnet regions.
- Optional Helius
simulateBundlebefore sending. - Optional
jitodontfrontaccount injection. - Typed error handling via
JitoError.
Requirements
- Rust 1.85+ (edition 2024)
- Solana keypair with SOL for tips
Usage
Via JitoBundler facade (recommended)
use BundleInstructionSlots;
use ;
use JitoConfig;
use Keypair;
async
Direct construction via BundleBuilder
use ;
use BundleInstructionSlots;
use DEFAULT_COMPUTE_UNIT_LIMIT;
use Hash;
use Keypair;
Public Types
BundleInstructionSlots:type BundleInstructionSlots = [Option<Vec<Instruction>>; 5]BuiltBundle:transactions: Vec<VersionedTransaction>tip_account: Pubkeytip_lamports: u64tip_mode: TipMode
Configuration
JitoConfig uses a builder pattern:
| Method | Description |
|---|---|
new(rpc_url) |
Required Solana RPC URL |
.with_network(Network) |
Mainnet (default) or Custom { block_engine_url, tip_floor_url } |
.with_helius_rpc_url(url) |
Enable Helius simulation before send |
.with_uuid(uuid) |
Jito authentication UUID |
.with_tip_strategy(TipStrategy) |
Fixed, FetchFloor, or FetchFloorWithCap |
.with_confirm_policy(ConfirmPolicy) |
Confirmation polling config |
.with_jitodontfront(pubkey) |
Optional frontrun protection account |
.with_compute_unit_limit(u32) |
Per-transaction compute budget |
Corner Cases and Rules We Enforce
- Bundle size is hard-capped at 5 transactions (Jito protocol limit).
- Empty bundles are rejected (
InvalidBundleSize). - Sparse input slots are compacted before build (gaps removed, order preserved).
- Tip is always inserted.
- If bundle has fewer than 5 transactions, tip is added as a separate transaction.
- If bundle already has 5 transactions, tip is appended inline to the last transaction.
- Tip instruction is always the last instruction of the final transaction.
- If the chosen tip account appears in a lookup table for inline mode, build rejects it (prevents Jito runtime failure).
jitodontfrontis enforced only in the first transaction; existingjitodontfront*accounts are removed by prefix match (suffix may vary).jitodontfrontaccount duplication is prevented.- Compute budget instruction is prepended to every transaction.
- Every compiled transaction is size-checked against Solana max transaction size.
Error Handling
All operations return Result<T, JitoError>.
use JitoError;
Testing
# Unit tests
# Integration tests (requires .env with live credentials)
License
MIT