getRecentPerformanceSamples — Solana JSON-RPC

Status: Available

Returns a list of recent cluster performance samples, in reverse slot order.

POSThttps://triport.io/sol
Network
Solana
Scope
sol_read_rpc
Auth
x-token: $TRIPORT_API_KEY (or Authorization: Bearer)
Rate limit
free+ — 20 / 60 / 200 / 600 RPS sustained · short burst 40 / 120 / 400 / 1200 (free / basic / pro / business); Burst capacity

Endpoint and plans: Solana RPC endpoint.

getRecentPerformanceSamples returns a list of recent performance samples taken across the cluster. Each sample summarizes the number of transactions and slots that occurred over a fixed samplePeriodSecs window (typically 60 seconds), and is taken roughly once per sample period.

This is the canonical way to estimate recent throughput — transactions per second (TPS) and non-vote TPS — without polling individual slots. Divide a sample's numTransactions (or numNonVoteTransactions) by samplePeriodSecs to get the average TPS for that window.

Samples are returned newest-first, ordered by slot descending. Use the optional limit parameter to request fewer than the maximum number of samples.

Parameters

JSON-RPC params is a positional array: [limit?].

limitintegeroptional
Number of samples to return, newest first. The maximum is set by the serving node, not by Triport — we do not pin a value in this spec revision, so treat a rejected limit as the node's bound rather than a product limit. Omit it to get the node's default.

Response

Response fields

result is an array of PerformanceSample objects, ordered by slot descending. Each element has the following fields:

FieldTypeDescription
slotintegerThe slot in which the sample was taken.
numTransactionsintegerTotal number of transactions processed during the sample period.
numNonVoteTransactionsintegerNumber of non-vote transactions processed during the sample period.
numSlotsintegerNumber of slots completed during the sample period.
samplePeriodSecsintegerLength of the sample window, in seconds.

Errors

Errors are returned in the standard JSON-RPC error envelope. See the shared errors reference for the full envelope shape and shared codes.

CodeMeaningWhen it happens
-32602Invalid paramslimit is not an integer, or is outside the range the serving node accepts. The upper bound belongs to the node, so read it from the error message rather than hard-coding a number.
401UnauthorizedMissing or invalid Authorization: Bearer key.
429Rate limitedMore than your tier's RPS for sol_read_rpc (20 / 60 / 200 / 600).

Examples

JavaScript (fetch)

const res = await fetch("https://triport.io/sol", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "getRecentPerformanceSamples",
    params: [4],
  }),
});


const { result } = await res.json();
const latest = result[0];
const tps = latest.numTransactions / latest.samplePeriodSecs;
console.log(`Recent TPS at slot ${latest.slot}: ${tps.toFixed(0)}`);

Notes

  • Ordering: samples are returned newest-first (slot descending), so result[0] is always the most recent window.
  • Computing TPS: divide numTransactions by samplePeriodSecs for total TPS, or use numNonVoteTransactions to exclude consensus vote traffic — the latter is usually the more meaningful measure of user activity.
  • limit is a maximum: the cluster retains a bounded history, so fewer than the requested number of samples may be returned if not enough have accumulated.
  • Related methods: use getSlot to read the current slot and getRecentPrioritizationFees to estimate the priority fee needed to land a transaction during periods of high throughput.