TriportRPC

getRecentPerformanceSamples

POSThttps://api.triport.io/v1/sol

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

Solanasol_read_rpcfree+ — 20 / 60 / 200 / 600 RPS (free / basic / pro / business)

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. Maximum and default 720 (the most recent ~12 hours at one 60-second sample per minute).

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 out of range (must be 1720).
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://api.triport.io/v1/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)}`);

TypeScript SDK (@triport/sdk)

import { TriportClient } from "@triport/sdk";


const client = new TriportClient({ apiKey: process.env.TRIPORT_API_KEY });


const samples = await client.solana.getRecentPerformanceSamples(4);


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

Python (triport-sdk)

import os
from triport import TriportClient


client = TriportClient(api_key=os.environ["TRIPORT_API_KEY"])


samples = client.solana.get_recent_performance_samples(limit=4)


latest = samples[0]
tps = latest["numTransactions"] / latest["samplePeriodSecs"]
print(f"Recent TPS at slot {latest['slot']}: {tps:.0f}")

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.