TriportRPC

Get aggregate mempool statistics

GEThttps://api.triport.io/v1/eth/mempool/stats?window=5m

Returns rolling, aggregate statistics over pending Ethereum transactions observed across the execution-layer mesh — throughput, gas-price percentiles, and the busiest senders.

Ethereum— (tier-gated)pro — RPS-per-tier (burst ×2)

This endpoint summarizes the pending-transaction stream that Triport observes across its Ethereum execution-layer mesh and returns a compact set of aggregate metrics for a chosen time window. Unlike /v1/eth/mempool/snapshot, which returns the individual pending transactions at one instant, this endpoint returns derived statistics only — making it cheap to poll for dashboards and alerting.

The figures cover three things: throughput (tx_per_sec, the mean rate of newly observed pending transactions over the window), the gas-price distribution (the 50th, 95th, and 99th percentiles of effective gas price, in gwei), and the top senders (the addresses that broadcast the most pending transactions during the window, with their counts).

Use the gas-price percentiles to set a competitive maxFeePerGas / maxPriorityFeePerGas (the gas_p95_gwei / gas_p99_gwei values are useful ceilings for time-sensitive transactions), tx_per_sec to gauge network congestion, and top_senders to spot high-frequency bots or active contracts. Percentiles are expressed in gwei as floating-point numbers, in contrast to the snapshot endpoint, which reports raw wei as decimal strings.

This is a pro-tier endpoint. Rate limiting is RPS-per-tier with a burst multiplier of 2; there is no daily quota.

Parameters

The only parameter is a query parameter; it is optional.

windowstringoptional
Aggregation window. One of 1m, 5m, 1h. Defaults to 1m.

Response

Response fields

FieldTypeDescription
windowstringThe aggregation window the statistics cover. Echoes the requested window (e.g. 5m).
tx_per_secnumberMean rate of newly observed pending transactions across the window.
gas_p50_gweinumberMedian (50th-percentile) effective gas price of observed pending transactions, in gwei.
gas_p95_gweinumber95th-percentile effective gas price, in gwei.
gas_p99_gweinumber99th-percentile effective gas price, in gwei.
top_sendersarrayThe most active sending addresses during the window, ordered by count (descending).
top_senders[].addressstringSender address (0x-prefixed, 20 bytes).
top_senders[].countintegerNumber of pending transactions observed from this sender during the window.

Errors

CodeMeaningWhen it happens
401Missing or invalid API keyNo Authorization header, or the bearer token is not a valid Triport API key (unauthorized), or the trial/subscription has lapsed (trial_expired / subscription_expired).
403ForbiddenThe key's plan is below the pro tier required for mempool endpoints (tier_insufficient).
429Rate limit exceededThe per-tier RPS limit was exceeded (rate_limited). Honor the Retry-After header before retrying.

See errors for the full error envelope and retry guidance.

Examples

JavaScript (fetch)

const res = await fetch(
  "https://api.triport.io/v1/eth/mempool/stats?window=5m",
  { headers: { Authorization: `Bearer ${process.env.TRIPORT_API_KEY}` } }
);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const stats = await res.json();
console.log(`${stats.tx_per_sec.toFixed(1)} tx/s · p95 ${stats.gas_p95_gwei} gwei`);

TypeScript SDK (@triport/sdk)

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


const triport = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });


const stats = await triport.eth.mempool.stats({ window: "5m" });


console.log(`throughput: ${stats.txPerSec} tx/s`);
console.log(`gas p50/p95/p99 (gwei):`, stats.gasP50Gwei, stats.gasP95Gwei, stats.gasP99Gwei);
for (const sender of stats.topSenders) {
  console.log(sender.address, sender.count);
}

Python (triport-sdk)

import os
from triport import Triport


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


stats = client.eth.mempool.stats(window="5m")


print(f"throughput: {stats.tx_per_sec} tx/s")
print(f"gas p50/p95/p99 (gwei):", stats.gas_p50_gwei, stats.gas_p95_gwei, stats.gas_p99_gwei)
for sender in stats.top_senders:
    print(sender.address, sender.count)

Notes

  • Gas percentiles are in gwei, as numbers — ready to display or compare directly. This differs from /v1/eth/mempool/snapshot, where per-transaction fees are reported as raw wei decimal strings.
  • Choose window to match your cadence. 1m (the default) reacts quickly to congestion spikes; 1h smooths out short-lived noise. Valid values are 1m, 5m, and 1h.
  • top_senders is bounded. It lists the busiest addresses for the window, not every sender; use it to identify dominant traffic, not for exhaustive accounting.
  • No daily quota. Rate limiting is RPS-per-tier with a burst multiplier of 2; a 429 rate_limited response means you should back off and retry after the Retry-After interval.
  • For the individual pending transactions behind these statistics, use /v1/eth/mempool/snapshot.