Priority Fees & MEV
Optimize transaction inclusion with priority fees and understand MEV on Solana.
Priority fees are the primary mechanism for ensuring your transactions are included quickly during network congestion. Understanding how to set them correctly is essential for production applications.
How Priority Fees Work
Priority fees are set using ComputeBudgetProgram.setComputeUnitPrice(microLamports). The total priority fee paid is microLamports × compute_units_used / 1,000,000 lamports. Higher fees make your transaction more attractive to validators.
Setting the Right Fee
Use connection.getRecentPrioritizationFees() to query recent fees for the specific accounts your transaction writes to. Use the 75th percentile for normal transactions, 90th-95th percentile for time-sensitive ones. Avoid setting fees too high — you're competing with other transactions, not paying a fixed cost.
Dynamic Fee Adjustment
For trading bots, implement dynamic fee adjustment based on current network conditions. Monitor the mempool (via gRPC) to see what fees other transactions are paying and adjust accordingly.
MEV on Solana
MEV (Maximal Extractable Value) refers to value extracted through transaction ordering. On Solana, MEV is primarily extracted through: DEX arbitrage (exploiting price differences across pools), liquidations (liquidating undercollateralized positions), and sandwich attacks. Jito's block engine enables atomic bundle execution for MEV strategies.
Jito Tips
When using Jito bundles, you pay a tip to the validator in addition to regular transaction fees. The tip goes to the Jito tip accounts. Higher tips increase the probability of bundle inclusion during competitive periods.