Triton One Docs
WebsiteCustomer Portal
  • Introduction
  • RPC Pool
    • Introduction
    • GeoDNS
    • Abuse prevention
    • Rate Limits
    • Proxying
    • Support FAQs
    • Privacy & Security
  • Chains
    • Solana
      • Streaming
      • BigTable Archive
      • Improved Priority Fees API
        • For RPC Providers
      • Cascade
        • Transaction sending advice
        • Buying Transaction Bandwidth
        • Providing Transaction Bandwidth
      • Web3JS Socket/Connection Issues
      • Deprecated calls Solana 2.0
    • Pythnet
    • SUI
    • Others
  • Digital Assets API
    • Introduction
    • Fungible Assets
    • API Methods
      • Get Asset
      • Get Asset Proof
      • Get Assets By Authority
      • Get Assets By Owner
      • Get Assets By Group
      • Get Assets By Creator
      • Search Assets
      • Get Token Accounts
      • Get Signatures For Asset
      • Get NFT Editions
      • Get Asset Proofs
  • Project Yellowstone
    • Introduction
    • Dragon's Mouth gRPC Subscriptions
    • Old Faithful Historical Archive
      • Old Faithful Public Report
    • Steamboat Custom Indexes
    • Whirligig WebSockets
    • Fumarole Reliable Streams
    • Vixen Data Pipelines
      • Generate a Yellowstone Vixen Parser with Codama
  • Shield Transaction Policies
  • Account Management
    • Payments
    • Account management API
      • Introduction
      • Auth & Headers
      • Accounts
      • Address Watch Lists
      • Subscriptions
      • Subscription Types
      • Endpoints
      • Tokens
      • Rate Tiers
  • Trading APIs
    • Introduction
    • Jupiter swap
    • Pyth Hermes
    • Bundle simulation by Jito
  • Validators
    • Introduction
    • Vote account setup
    • Node identity protection
  • Pyth Publishers
    • NGINX proxy
    • Testnet, Devnet and Pythnet
Powered by GitBook
On this page
  • Client API
  • Sample requests

Was this helpful?

  1. Chains
  2. Solana

Improved Priority Fees API

PreviousBigTable ArchiveNextFor RPC Providers

Last updated 2 months ago

Was this helpful?

This is currently in staging/beta testing. If you want access to an endpoint for testing, contact us on your customer support channels. After receiving client feedback, we will create a PR to include this feature in the Anza/Solana Labs repositories.

Solana's default RPC stack supports identifying recently paid priority fees globally and per writeable account. Currently, this provides a single number per slot to indicate the minimum priority fee amount. Returning only the minimum priority fee limits the ability of RPC consumers to more clearly identify what priority fees to use in their transactions.

To address this, we have added a percentile parameter to the method that provides you better flexibility to estimate previous priority fees that were paid and, thus, what you might want to add to your transactions.

If you are running your own Solana node or an RPC provider, we provide the patches build to support these new parameters. We encourage everyone to support this new param.

Client API

If you're using the (formerly known as @solana/web3.js v2) SDK then you can create a custom RPC function to be called via your RPC connection object.

Your call to this API would be like this

const feeResults = await rpcConnection
  .getRecentPrioritizationFeesTriton([], {
    percentile: PRIORITY_FEE_PERCENTILE,
  })
  .send();

To help accelerate your development with this change, we've prepared an with examples of API usage and utility functions that you can copy-paste into your JS codebase and get started without additional dependencies.

Sample requests

Request Body:

{
  "method": "getRecentPrioritizationFees",
  "jsonrpc": "2.0",
  "params": [
    [
      "RNXnAJV1DeBt6Lytjz4wYzvS3d6bhsfidS5Np4ovwZz"
    ],
    {
      "percentile": 5000
    }
  ],
  "id": "1"
}

The response format doesn't change. The only difference is the return value reflects the percentile from the request. The default behavior, when no percentile is provided, is to return the minimum, as before.

{
  "jsonrpc": "2.0",
  "result": [
    {
      "slot": 348125,
      "prioritizationFee": 0
    },
    {
      "slot": 348126,
      "prioritizationFee": 1000
    },
    {
      "slot": 348127,
      "prioritizationFee": 500
    },
    {
      "slot": 348128,
      "prioritizationFee": 0
    },
    {
      "slot": 348129,
      "prioritizationFee": 1234
    }
  ],
  "id": 1
}

Sample CURL requests

You can use the following CURL requests to try out the API (replace localhost:8899 with your RPC endpoint, which is currently on our staging servers only).

curl localhost:8899 -X POST -H "Content-Type: application/json" -d '[{"method":"getRecentPrioritizationFees","jsonrpc":"2.0","params":[],"id":"1"}]'
curl localhost:8899 -X POST -H "Content-Type: application/json" -d '[{"method":"getRecentPrioritizationFees","jsonrpc":"2.0","params":[[],{"percentile":5000}],"id":"1"}]'
curl localhost:8899 -X POST -H "Content-Type: application/json" -d '[{"method":"getRecentPrioritizationFees","jsonrpc":"2.0","params":[["RNXnAJV1DeBt6Lytjz4wYzvS3d6bhsfidS5Np4ovwZz"]],"id":"1"}]'
curl localhost:8899 -X POST -H "Content-Type: application/json" -d '[{"method":"getRecentPrioritizationFees","jsonrpc":"2.0","params":[["RNXnAJV1DeBt6Lytjz4wYzvS3d6bhsfidS5Np4ovwZz"],{"percentile":5000}],"id":"1"}]'
Solana JSON RPC `getRecentPrioritizationFees`
you can apply to your local Solana validator
@solana/kit
Custom Function Example
Usage Example
Anza Docs
example repository
GitHub - rpcpool/solana-prioritization-fees-api: Solana prioritization fees API client examples.GitHub
Logo