TriportRPC

Get aggregate mempool statistics

GEThttps://api.triport.io/v1/polygon/mempool/stats?window=1m

Returns rolling, pre-aggregated Polygon mempool metrics — throughput, gas-price percentiles, and the most active sending addresses — over a configurable time window.

Polygonpolygon_mempoolpro+ — specialized polygon_mempool category (2× burst); see [Rate Limits and Tiers](../../rate-limits-and-tiers.md)

GET /v1/polygon/mempool/stats gives you a compact, server-aggregated view of the current Polygon PoS mempool. Instead of pulling a full pending-transaction snapshot and computing statistics yourself, you receive ready-made aggregates: observed throughput (tx_per_sec), the p50 / p95 / p99 gas-price percentiles in gwei, and a ranked list of the addresses sending the most transactions over the window.

Use it to drive a live "network conditions" widget, to pick a competitive gas price before broadcasting, or to monitor mempool congestion without paying the bandwidth and CPU cost of parsing the raw pool. The gas percentiles are the quickest way to answer "what should I bid to land in the next few blocks?" — gas_p50_gwei is a typical inclusion price, while gas_p95_gwei / gas_p99_gwei reflect what aggressive senders are paying during contention.

If you need the individual pending and queued transactions rather than aggregates, use the companion mempool snapshot endpoint.

Parameters

Query parameters

windowstringoptional
Rolling lookback window over which the statistics are aggregated, as a duration string (e.g. 1m, 5m). Defaults to 1m.

Response

Response fields

FieldTypeDescription
windowstringThe window the statistics were computed over (echoes the request, defaulting to 1m).
tx_per_secnumber (double)Observed mempool ingress rate, in transactions per second, averaged over the window.
gas_p50_gweinumber (double)Median (50th percentile) gas price of pending transactions, in gwei.
gas_p95_gweinumber (double)95th-percentile gas price, in gwei.
gas_p99_gweinumber (double)99th-percentile gas price, in gwei.
top_sendersarrayAddresses with the most pending transactions over the window, ranked by count (descending).
top_senders[].addressstring0x-prefixed Polygon sender address.
top_senders[].countintegerNumber of transactions from that address observed in the window.

Errors

All errors use the shared Triport REST envelope (error code + message + request_id). See errors.md for the full envelope and every shared code.

CodeMeaningWhen it happens
401unauthorized / trial_expired / subscription_expiredNo or invalid credentials, or the key's trial / subscription has ended.
403tier_insufficientThe key's tier is below pro. The X-Required-Tier header and body carry the required tier and an upgrade_url.
403method_unknownThe endpoint is not part of the Polygon product for this key.
429rate_limitedSustained + burst RPS exceeded for the polygon_mempool category. Honor Retry-After (1s) and retry.

Examples

JavaScript (fetch)

const res = await fetch(
  "https://api.triport.io/v1/polygon/mempool/stats?window=1m",
  {
    headers: {
      Authorization: `Bearer ${process.env.TRIPORT_API_KEY}`,
    },
  },
);


const stats = await res.json();
console.log(`${stats.tx_per_sec.toFixed(1)} tx/s`);
console.log(`suggested gas: ~${stats.gas_p50_gwei} gwei (p99 ${stats.gas_p99_gwei})`);

TypeScript SDK (@triport/sdk)

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


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


const stats = await client.polygon.mempool.stats({ window: "1m" });


console.log(stats.txPerSec, stats.gasP50Gwei, stats.gasP99Gwei);
console.log(stats.topSenders[0]?.address, stats.topSenders[0]?.count);

Python (triport-sdk)

import os
from triport import Triport


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


stats = client.polygon.mempool.stats(window="1m")


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

Notes

  • Aggregates, not raw transactions. This endpoint returns computed statistics only. To inspect individual pending/queued transactions, use the mempool snapshot endpoint (also pro+).
  • Gas pricing. Treat gas_p50_gwei as a baseline inclusion price and the p95 / p99 values as what's required to outbid congestion. The mempool changes continuously — re-poll before broadcasting if precise pricing matters.
  • Window default. Omitting window aggregates over the last 1m. A longer window smooths out short spikes in tx_per_sec and the percentiles.
  • Tier gating. Mempool access is pro and above; a sub-pro key receives 403 tier_insufficient. See Rate Limits and Tiers for category budgets and burst behavior, and Authentication for how to pass your key.
  • No daily cap. Limiting is sustained-RPS-per-tier with a 2× burst; there is no daily quota or daily-quota header.