---
title: getRecentPrioritizationFees
description: >-
  Returns recent prioritization-fee samples, optionally filtered to transactions
  that lock a set of writable accounts.
url: /docs/rpc/http/getrecentprioritizationfees
type: reference
hideTableOfContents: true
---

Returns recent prioritization-fee samples, optionally filtered to transactions
that lock a set of writable accounts.

<Callout type="info" title="Source">
  [`get_recent_prioritization_fees`](https://github.com/anza-xyz/agave/blob/v3.1.8/rpc/src/rpc.rs#L2386)
</Callout>

<Callout type="info">
  Currently, a node's prioritization-fee cache stores data from up to 150
  blocks.
</Callout>

<APIMethod>

```jsonc !!request curl
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getRecentPrioritizationFees",
  "params": [
    // !hover addresses
    ["CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY"]
  ]
}
```

```ts !!request title="Kit"
import { address, createSolanaRpc } from "@solana/kit";

const rpc_url = "https://api.devnet.solana.com";
const rpc = createSolanaRpc(rpc_url);

// !hover addresses
let addresses = [address("CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY")];
let prioritizationFees = await rpc
  .getRecentPrioritizationFees(addresses)
  .send();

console.log(prioritizationFees);
```

```ts !!request title="web3.js"
import { Connection, PublicKey, clusterApiUrl } from "@solana/web3.js";

const connection = new Connection(clusterApiUrl("devnet"), "confirmed");

// !hover addresses
let addresses = [new PublicKey("CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY")];

let prioritizationFees = await connection.getRecentPrioritizationFees({
  lockedWritableAccounts: addresses
});

console.log(prioritizationFees);
```

```rs !!request title="Rust"
use anyhow::Result;
use solana_client::nonblocking::rpc_client::RpcClient;
use solana_commitment_config::CommitmentConfig;
use solana_sdk::pubkey;

#[tokio::main]
async fn main() -> Result<()> {
    let client = RpcClient::new_with_commitment(
        String::from("https://api.devnet.solana.com"),
        CommitmentConfig::confirmed(),
    );

    // !hover addresses
    let addresses = [pubkey!("CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY")];
    let prioritization_fees = client.get_recent_prioritization_fees(&addresses).await?;

    println!("{:#?}", prioritization_fees);

    Ok(())
}
```

### !params

#### !! addresses

!type array  
!optional

Optional array of account addresses, as base-58 encoded strings. Maximum 128
addresses.

<Callout type="info">
  If you provide this parameter, the response reflects fees observed for
  transactions that lock all of the supplied accounts as writable.
</Callout>

If you omit `params` entirely, the RPC returns recent prioritization-fee samples
without filtering by writable account locks.

### !!result

```jsonc !response
{
  "jsonrpc": "2.0",
  // !hover(1:22) result
  "result": [
    {
      // !hover slot
      "slot": 348125,
      // !hover prioritizationFee
      "prioritizationFee": 0
    },
    {
      "slot": 348126,
      "prioritizationFee": 1000
    },
    {
      "slot": 348127,
      "prioritizationFee": 500
    },
    {
      "slot": 348128,
      "prioritizationFee": 0
    },
    {
      "slot": 348129,
      "prioritizationFee": 1234
    }
  ],
  "id": 1
}
```

!type array

Array of prioritization-fee samples containing:

##### !! slot

!type u64

Slot that produced this fee sample.

##### !! prioritizationFee

!type u64

Prioritization fee, in micro-lamports per compute unit, observed for that slot.

</APIMethod>
