getPriorityFeeEstimate
https://api.triport.ioReturns a recommended priority (compute-unit) fee estimate for landing a Solana transaction.
getPriorityFeeEstimate returns a recommended priority fee — the per-compute-unit
price (in micro-lamports) that a transaction should attach so that it lands
reliably given recent network conditions. Solana orders pending transactions in
part by the priority fee they bid, so a sender uses this estimate to set a
ComputeBudgetProgram.setComputeUnitPrice instruction before signing.
Use it just before submitting a transaction: query the estimate, apply it to the
compute-budget instruction, then send via
sendTransaction. Because network demand shifts from
slot to slot, fetch a fresh estimate per submission rather than caching one.
This is a read method in the sol_read_rpc category (free tier and up). It does
not submit or simulate anything — it only reports a fee recommendation.
Parameters
In the current scaffold the spec declares no parameters (params is an empty
array []), so the request below sends "params": []. The finalized api.2.2+
schema is expected to accept an optional options object identifying the
transaction (e.g. the accounts it touches, or a serialized transaction) and a
target priority level. Treat the table below as preliminary — it documents
the intended shape, not a guaranteed contract.
options *(pending)*objectoptionalResponse
The result is a JSON object. The current scaffold types it as an open object
(type: object, additional properties allowed); the field names below illustrate
the intended shape and are pending finalization in api.2.2+.
resultobjectresult.priorityFeeEstimate *(pending)*numberErrors
Errors are returned in the standard JSON-RPC error envelope. See the shared
errors reference for the full envelope shape and the
error.data fields.
| Code | Meaning | When it happens |
|---|---|---|
-32003 | Rate limit exceeded | More than your tier's RPS for sol_read_rpc (free 20 / basic 60 / pro 200 / business 600); a burst up to 2× is allowed before throttling. |
-32601 | Method not recognised | The method name was misspelled or is not in the Solana catalog. |
-32602 | Invalid params | Parameters were sent that the (pending) schema does not accept. |
401 | Unauthorized | Missing or invalid Authorization: Bearer key. |
Examples
JavaScript (fetch)
const res = await fetch("https://api.triport.io", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "getPriorityFeeEstimate",
params: [],
}),
});
const { result } = await res.json();
console.log(`Suggested priority fee: ${result.priorityFeeEstimate} µ-lamports/CU`);TypeScript SDK (@triport/sdk)
import { TriportClient } from "@triport/sdk";
const client = new TriportClient({ apiKey: process.env.TRIPORT_API_KEY! });
// Result shape is pending spec api.2.2+ — typed loosely until then.
const estimate = await client.solana.getPriorityFeeEstimate();
console.log(`Suggested priority fee: ${estimate.priorityFeeEstimate} µ-lamports/CU`);Python (triport-sdk)
import os
from triport import TriportClient
client = TriportClient(api_key=os.environ["TRIPORT_API_KEY"])
# Result shape is pending spec api.2.2+.
estimate = client.solana.get_priority_fee_estimate()
print(f"Suggested priority fee: {estimate['priorityFeeEstimate']} micro-lamports/CU")Notes
- Scaffold method: the request and response details above are provisional and finalized by spec api.2.2/2.3/2.4. Re-check this page once your target spec version ships before depending on specific fields.
- Micro-lamports per compute unit: priority fees are priced per CU. Multiply
the estimate by your transaction's compute-unit limit to size the total
priority cost, then set it with
ComputeBudgetProgram.setComputeUnitPrice. - Fetch fresh, don't cache: the recommendation tracks recent demand and moves slot to slot; request a new estimate per submission.
- Related methods: apply the estimate, then submit with
sendTransaction. For the base (non-priority) fee of a specific message, seegetFeeForMessage. - Staging: the same request works against
https://staging.api.triport.iofor testing.