Solana Priority Fee API | Smart Fee Estimation for Developers
Introduction
The Solana Priority Fee API provides developers with smart, real-time fee estimates based on live network activity. With six priority levels and per-program fee analysis, you can integrate accurate fee recommendations directly into your dApp or trading bot.
Primary Method
The primary API method analyzes your exact serialized transaction for maximum accuracy. Pass your transaction bytes with a priorityLevel parameter (Min, Low, Medium, High, VeryHigh, UnsafeMax) and receive the recommended micro-lamport price to use as your compute unit price.
Account-Based Method
For pre-transaction analysis or batch operations, use the account-based estimation method. Pass the list of accounts your transaction will interact with to get fee estimates based on recent activity for those specific program accounts — ideal for building fee prediction UIs.
The Priority Fee API exposes the getPriorityFeeEstimate method. Example request:
POST https://mainnet-rpc-endpoint
{
"jsonrpc": "2.0",
"method": "getPriorityFeeEstimate",
"params": [{
"transaction": "<serialized_tx_base58>",
"options": {
"priorityLevel": "Medium",
"recommended": true
}
}]
}
Response includes priorityFeeEstimate in microlamports — pass this directly to ComputeBudgetProgram.setComputeUnitPrice(). Available priority levels: Min, Low, Medium, High, VeryHigh, UnsafeMax.








