The getRecentPrioritizationFees RPC method returns a list of prioritization fee samples from the past 150 blocks on the Solana network. Each sample includes the slot number and the minimum fee (in micro-lamports per CU) that was paid by transactions in that slot. This data is essential for dynamically setting competitive priority fees.
You can call this method with an optional list of account public keys to filter fees relevant to specific programs. For example, if you are interacting with a high-activity DeFi program, filtering by that program's account address gives you a more accurate picture of what competing transactions are paying — rather than the global network average.
getRecentPrioritizationFees is useful for gauging the minimum fee floor in recent slots. For more precise estimates, combine it with specialized APIs like Helius getPriorityFeeEstimate which returns a single actionable value.
Chainstack Developer Guide
A common pattern is to fetch the last 150 slots of fee data, extract the 50th–75th percentile value, and use that as your compute unit price. This balances cost efficiency with reliable confirmation times. Remember that the returned list shows the minimum fee paid per slot — actual competitive fees during high congestion may be significantly higher, so consider using the 75th–95th percentile for important transactions.
For production DApps, it is recommended to cache the fee estimate and refresh it every few seconds rather than making a fresh RPC call for every transaction. This reduces latency and avoids rate limiting from RPC providers.
