getRecentPrioritizationFees
Returns a list of prioritization fees from recent blocks. Prioritization fees are additional fees paid to incentivize validators to include a transaction in a block more quickly. This method is critical for applications that need to dynamically set compute unit prices to ensure timely transaction inclusion during periods of high network congestion, such as NFT mints or DeFi trading.
Parameters
| # | Type | Required | Description |
|---|---|---|---|
| 1 | array[string] | No | Array of base-58 encoded account addresses (max 128). If provided, returns fees for transactions that write-lock these accounts |
Response
Returns an array of prioritization fee objects:
| Field | Type | Description |
|---|---|---|
[].slot | u64 | Slot in which the fee was observed |
[].prioritizationFee | u64 | The per-compute-unit fee paid by at least one transaction in the block, in micro-lamports |
Code Examples
cURL
curl http://88.216.36.108:7999 -X POST -H "Content-Type: application/json" -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getRecentPrioritizationFees",
"params": [
["CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY"]
]
}'TypeScript
const response = await fetch("http://88.216.36.108:7999", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "getRecentPrioritizationFees",
params: [
["CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY"]
]
}),
});
const { result } = await response.json();
const avg = result.reduce((s, f) => s + f.prioritizationFee, 0) / result.length;
console.log("Average priority fee:", avg, "micro-lamports");Python
import requests
response = requests.post("http://88.216.36.108:7999", json={
"jsonrpc": "2.0",
"id": 1,
"method": "getRecentPrioritizationFees",
"params": [
["CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY"]
]
})
result = response.json()["result"]
avg = sum(f['prioritizationFee'] for f in result) / len(result)
print(f"Average priority fee: {avg} micro-lamports")Rust
use reqwest::Client;
use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let res = client.post("http://88.216.36.108:7999")
.json(&json!({
"jsonrpc": "2.0",
"id": 1,
"method": "getRecentPrioritizationFees",
"params": [
["CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY"]
]
}))
.send().await?
.text().await?;
println!("{}", res);
Ok(())
}Example Response
{
"jsonrpc": "2.0",
"result": [
{ "slot": 166974442, "prioritizationFee": 1000 },
{ "slot": 166974441, "prioritizationFee": 500 },
{ "slot": 166974440, "prioritizationFee": 0 }
],
"id": 1
}