Live network statistics and supply
Live network statistics give the Explorer home page a current view of transaction activity and SOL supply for the selected cluster. The page combines RPC performance samples with current ledger values, then presents loading, ready, and retry states when the selected endpoint cannot provide a complete view. This page is a child of Network and ledger observability and relates to Block and epoch exploration and Alpenglow status and certification.
Live dashboard
The home dashboard places transaction activity beside cluster and supply views. The dashboard uses the active cluster endpoint, so changing the network starts a new view rather than carrying values from the previous network (home/…/page.tsx• L32-54).
The main live signals have separate data lifecycles:
| Signal | Purpose | Source and refresh pattern |
|---|---|---|
| Transaction count | Shows the total transaction count reported by the selected cluster | Current RPC count, refreshed about every 5 seconds |
| Transactions per second (TPS) | Shows recent transaction rate | Recent performance samples, refreshed about every 60 seconds |
| Slot and epoch context | Shows where the cluster is in its ledger cycle | Epoch information, refreshed about every 2 seconds |
| Cluster time | Estimates the time at the current slot | Recent block time plus the current slot position |
| SOL supply | Shows circulating and total supply | Finalized supply read through the route or selected RPC endpoint |
The live statistics view is opt-in and visible only while its consumer is active. It also pauses when the browser tab is hidden. This limits background requests without changing the meaning of the values when the user returns (home/…/solanaClusterStats.tsx• L80-91, home/…/solanaClusterStats.tsx• L216-235).
The following flow shows how the selected endpoint becomes the live cards and how incomplete data becomes a fallback state.
flowchart LR
A[Selected cluster endpoint] --> B[Shared RPC client or supply route]
B --> C[Performance samples]
B --> D[Transaction count]
B --> E[Epoch and block time]
B --> F[Finalized supply]
C --> G[Transaction statistics card]
D --> G
E --> H[Cluster context card]
F --> I[Supply and staking cards]
C --> J{Ready data?}
D --> J
J -->|No| K[Loading or retry state]
References: home/…/page.tsx• L32-54 home/…/solanaClusterStats.tsx• L80-91 home/…/use-supply.ts• L23-36
Transaction statistics
The live transaction card turns recent RPC performance samples into a current TPS value and a short history. It also shows the cluster transaction count, so the card combines a cumulative ledger signal with a recent activity signal (home/…/LiveTransactionStatsCard.tsx• L38-60, home/…/LiveTransactionStatsCard.tsx• L159-195).
The card offers three history ranges. The short range keeps recent samples, while the medium and long ranges group samples to show a wider time window without making the chart too dense.
| View | Displayed range | Meaning |
|---|---|---|
| Short | 30 minutes | Recent TPS changes |
| Medium | 2 hours | Broader activity pattern |
| Long | 6 hours | Longer activity trend |
The provider calculates TPS from the number of transactions in each sample period. It removes samples with no transactions and keeps rounded, downsampled series for the three chart ranges. A missing sample history does not become a zero rate; the view stays not ready until usable data arrives (home/…/solanaPerformanceInfo.tsx• L54-93).
References: home/…/LiveTransactionStatsCard.tsx• L20-36 home/…/LiveTransactionStatsCard.tsx• L159-223 home/…/solanaPerformanceInfo.tsx• L54-93
Statistics providers
The statistics provider is the shared boundary between RPC reads and dashboard cards. It keeps performance data and dashboard data as separate views, while one provider controls their polling, reset, timeout, and retry behavior (home/…/index.tsx• L3-8, home/…/solanaClusterStats.tsx• L56-85).
The provider reports a statistic view as Loading, Ready, or Error. Performance data becomes ready after both a transaction count and usable performance samples exist. Dashboard data becomes ready after performance samples and epoch information exist. This prevents a card from presenting a partial set of values as a complete live view (home/…/solanaPerformanceInfo.tsx• L85-110, home/…/solanaDashboardInfo.tsx• L93-126).
Dashboard context combines recent slot timing with epoch data. It keeps the current dashboard state when samples cannot produce a usable hour rate. It estimates the current block time only when a known block time and a non-decreasing slot support the calculation. This gives the page a stable time estimate without treating a stalled or out-of-order sample as a new value (home/…/solanaDashboardInfo.tsx• L72-126).
The provider resets its in-memory values when the endpoint changes. The home page activates it only while the live cluster card is mounted. It also waits for a settled, connectable endpoint before polling. The supply flow remains separate, which allows supply and staking information to keep its own loading or error state (home/…/page.tsx• L66-81, home/…/solanaClusterStats.tsx• L80-91, home/…/solanaClusterStats.tsx• L237-271).
References: home/…/solanaClusterStats.tsx• L26-75 home/…/solanaClusterStats.tsx• L80-91 home/…/solanaClusterStats.tsx• L237-303 home/…/solanaPerformanceInfo.tsx• L96-115 home/…/solanaDashboardInfo.tsx• L72-143 home/…/solanaDashboardInfo.test.ts• L90-347 home/…/solanaDashboardInfo.test.ts• L391-545
Supply state
The supply flow gives the home page a validated pair of finalized SOL values: circulating supply and total supply. The browser starts the request when the supply section mounts and when a connectable endpoint is available. It chooses a server route for supported clusters or the selected RPC endpoint when the server must not reach that endpoint (home/…/use-supply.ts• L23-36, home/…/route.ts• L21-61, home/…/use-supply.spec.tsx• L68-93, home/…/use-supply.spec.tsx• L170-186). The route path does not wait for a successful cluster health check, so a connecting or failed health check does not prevent a configured route from serving cached or current supply data.
The server boundary is server-only and exposes the shared supply payload conversion to the supply route. The route accepts only known cluster names and resolves their configured endpoints. It does not accept a caller-provided custom URL. Both request paths use finalized data and omit the non-circulating account list. The response boundary checks that the values are valid integers and that circulating supply does not exceed total supply (home/…/server.ts• L1-3, home/…/route.ts• L21-61, home/…/supply.ts• L21-43).
The browser uses the direct path for custom clusters and for known clusters that point to a local validator. Other known clusters use the server route. This keeps server access limited to configured public clusters while still allowing a visitor to inspect an endpoint that only the browser can reach (home/…/should-use-direct-rpc.ts• L16-23, home/…/fetch-supply.ts• L75-82).
The home page uses total supply as the denominator for circulating supply and active stake. It hides the supply and staking cards when total supply is zero because a zero denominator does not describe a useful state (home/…/StakingSection.tsx• L13-65).
Supply states have a direct meaning:
loadingmeans the request has not produced a usable result.failedmeans another request may succeed and the page can offer a retry.unavailablemeans the route returned a non-retryable answer, so the page does not offer a retry.readycontains validated circulating and total supply.
When a refresh fails after data is already available, the hook keeps the ready value. This prevents a temporary refresh problem from replacing a value the page can still show (home/…/use-supply.ts• L64-76, home/…/use-supply.spec.tsx• L380-394). Both route and direct-RPC requests have an upstream wait limit, so an accepted connection cannot leave the supply card loading forever (home/…/use-supply.spec.tsx• L95-118).
References: home/…/server.ts• L1-3 home/…/route.ts• L21-61 home/…/use-supply.ts• L13-24 home/…/use-supply.ts• L64-76 home/…/supply.ts• L21-55 home/…/should-use-direct-rpc.ts• L16-23 home/…/fetch-supply.ts• L75-82 home/…/StakingSection.tsx• L13-65 home/…/use-supply.spec.tsx• L68-186 home/…/use-supply.spec.tsx• L380-394
Caching and endpoint scope
The supply route uses HTTP cache control to share successful known-cluster results for a short period. A browser may use a result for 60 seconds, a shared cache may use it for 10 minutes, and stale data may remain available while a background refresh runs. This reduces repeated ledger scans because supply changes slowly at the card's display precision (home/…/route.ts• L11-15).
The client includes the cluster and connectable endpoint in its data key. Supported clusters normally use the cached route and allow revalidation on staleness, focus, reconnect, and retry. Direct RPC requests use the selected endpoint once instead of repeatedly scanning that node. A revisit or a focus change can therefore refresh route-backed supply without re-scanning a visitor's own node (home/…/use-supply.ts• L27-61, home/…/use-supply.spec.tsx• L398-439).
Live statistics use provider state rather than the general resource cache. The shared RPC client is cached by endpoint, which lets the statistics provider reuse one transport object without sharing returned values across clusters. Statistics reset when the endpoint changes, and the supply key changes with the endpoint so an old response cannot become the new cluster's value (home/…/get-rpc.ts• L7-26, home/…/solanaClusterStats.tsx• L237-253, home/…/use-supply.ts• L30-35, home/…/use-supply.spec.tsx• L188-224).
Errors have shorter browser and shared-cache lifetimes than successful supply responses. The route classifies invalid input, missing configuration, timeouts, retryable RPC errors, and other failures so the client can distinguish a transient failure from one that needs configuration work (home/…/route.ts• L29-51, home/…/route.ts• L62-99, home/…/http-utils.ts• L14-19).
References: home/…/route.ts• L11-19 home/…/use-supply.ts• L27-61 home/…/use-supply.spec.tsx• L380-439 home/…/get-rpc.ts• L11-26 home/…/cache.tsx• L60-104 home/…/solanaClusterStats.tsx• L228-253
Fallback states
Fallback states keep the cards honest when an RPC endpoint is slow, empty, disconnected, or failing. Loading is shown while the provider has an active request. A retry message replaces loading after an error or when the statistics provider stops being active (home/…/StatsNotReady.tsx• L11-51).
Statistics wait for a usable data set rather than rendering initial zero values. If the first response does not arrive within the timeout window, the provider marks both dashboard and performance data as failed and exposes Try Again. A retry clears the old state and starts a new polling cycle (home/…/StatsNotReady.tsx• L15-41, home/…/solanaClusterStats.tsx• L102-158, home/…/solanaClusterStats.tsx• L255-271).
Supply uses its own fallback path. Loading shows skeleton cards. A retryable route or direct-RPC failure shows an error card with a fetch action. A non-retryable route response shows that supply is unavailable for the cluster. A supply failure therefore does not turn into a statistics failure (home/…/StakingSection.tsx• L19-35, home/…/use-supply.ts• L20-23, home/…/fetch-supply.ts• L20-23).
The supply route bounds its upstream wait and returns classified HTTP errors. The client retries transient route statuses up to a small limit, while a direct endpoint does not use automatic retries. A route response with a truncated body is retried as a connection failure. A valid response with an unreadable supply shape is treated as unavailable and reported once because another request cannot change that body (home/…/route.ts• L54-99, home/…/use-supply.ts• L37-61, home/…/fetch-supply.ts• L20-23, home/…/fetch-supply.ts• L46-71). The client also bounds direct-RPC waits and avoids retrying a visitor's own node, while a direct failure for a known cluster can be reported for investigation (home/…/use-supply.spec.tsx• L344-377).
References: home/…/StatsNotReady.tsx• L9-51 home/…/solanaClusterStats.tsx• L102-158 home/…/solanaClusterStats.tsx• L255-271 home/…/StakingSection.tsx• L19-42 home/…/use-supply.ts• L64-76 home/…/fetch-supply.ts• L20-23 home/…/fetch-supply.ts• L46-71 home/…/use-supply.spec.tsx• L228-378
Change checklist
When these files or sections are changed, remember to consider these:
- Keep transaction count and performance sample readiness aligned. A card must not show a current count with an unready TPS history.
- Keep endpoint changes aligned across the RPC client, statistics reset, supply key, route resolution, and cluster selection. Old responses must not populate the new cluster's cards.
- Preserve tab-visibility and active-view polling gates. Removing either gate can create background RPC load.
- Keep the supply commitment, response validation, and displayed supply labels aligned. A change in source freshness or value shape changes how users read the cards.
- Keep route cache lifetimes separate from direct-RPC refresh rules. A change that makes direct requests revalidate can turn each focus or reconnect into a ledger scan.
- Keep retryable HTTP statuses aligned with route error classes and the hook's
failedversusunavailablestates. - Keep statistics timeout and retry behavior connected to both dashboard and performance state. A retry that resets only one view can leave the page split between stale and new data.
- Keep the dashboard's hour rate and one-minute rate distinct when the newest sample has no slots. The hour view may remain useful while the one-minute view must be absent rather than describe an older sample.
- Keep the route path and direct-RPC path aligned on finalized commitment and on the reduced supply payload. A change to one path can make the same card compare different ledger views or expose unnecessary account data.
- Keep the supply data key tied to both cluster identity and connectable endpoint. A known cluster can still point to a local validator, and the endpoint changes which ledger is being read.
- Keep health-check state separate from route eligibility. A route-backed supply request must still run while a known cluster is connecting or has a failed health check, but no request should run before an endpoint is connectable.
- Keep route and direct-RPC timeout values ordered so the client does not abort a route request before the route's upstream wait ends, and neither path can leave the card pending forever.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| Performance samples are empty or the newest sample contains no usable slot data | The chart can show a false zero or the one-minute value can describe an older sample | Keep the view loading until an hour rate is available and leave the one-minute value absent when its newest sample has no slots |
| A slow response from a previous endpoint completes after a cluster change | The new cluster can display old transaction or supply values | Reset statistics on endpoint change and key supply data by cluster and endpoint |
| The supply request waits for a successful health check | A route-backed card stays blocked even though the cache or route can answer | Gate requests on a connectable endpoint, not on health-check success |
| A route or direct-RPC request waits on an accepted but silent connection | The supply card remains in loading with no retry path | Apply a route deadline longer than the route's upstream deadline and an upstream deadline to direct RPC |
| The browser sends route refreshes for a custom or local endpoint | Each focus or reconnect can repeat a ledger scan on the visitor's node | Use direct RPC only once for endpoints the server cannot reach and disable automatic revalidation there |
| The statistics view polls while inactive or while the tab is hidden | The browser sends live RPC requests with no visible consumer | Require both an active view and a visible tab before starting polling |
| A statistics request fails or exceeds its wait limit | The card stays in a loading state or shows incomplete values | Mark the provider as failed and expose the shared retry action |
| Supply returns zero total supply during connection or on an empty endpoint | The page shows an empty supply and staking row or divides by zero for a share | Hide the row when total supply is zero |
| A route response has malformed or impossible supply values | The page could present a number that the server cannot support | Validate the response shape and the circulating-versus-total relationship before returning ready data |
| A route or direct RPC error is classified as retryable when configuration is the real problem | The page repeats a request that cannot succeed and increases node or route load | Keep route status classification and direct-endpoint retry policy aligned |
| The route and direct-RPC paths use different commitment or payload rules | Cards can show values from different ledger states or send unnecessary account data | Keep both paths finalized and request only the supply fields used by the page |
Key files
| File | Why to read it |
|---|---|
| home/…/page.tsx | Shows how the home page composes live statistics, supply, and staking cards. |
| home/…/LiveTransactionStatsCard.tsx | Shows the user-facing transaction count, TPS value, and selectable history ranges. |
| home/…/StatsNotReady.tsx | Shows the loading, timeout, error, and retry presentation for live statistics. |
| home/…/solanaClusterStats.tsx | Shows endpoint-scoped polling, visibility gating, reset behavior, and retry control. |
| home/…/solanaPerformanceInfo.tsx | Shows how performance samples become TPS and chart history. |
| home/…/solanaDashboardInfo.tsx | Shows how slot timing and epoch data become dashboard context and an estimated block time. |
| home/…/solanaDashboardInfo.test.ts | Defines the reducer guarantees for slot timing, block-time estimates, readiness, errors, and reset behavior. |
| home/…/use-supply.ts | Shows how the supply request chooses its source and exposes loading, retry, unavailable, and ready states. |
| home/…/use-supply.spec.tsx | Defines the supply contract for route eligibility, endpoint changes, deadlines, cache refresh, retry limits, and error reporting. |
| home/…/server.ts | Shows the server-only boundary for the shared supply payload used by the route. |
| home/…/route.ts | Shows server-side cluster resolution, finalized supply reads, cache policy, and error classes. |
| home/…/fetch-supply.ts | Shows the boundary between route errors, direct RPC errors, and client retry behavior. |
| home/…/supply.ts | Shows the shared supply shape and validation rules for route and direct responses. |
| home/…/should-use-direct-rpc.ts | Shows when the browser must use the selected endpoint instead of the server route. |
| home/…/StakingSection.tsx | Shows how supply becomes circulating-supply and active-stake cards. |
| home/…/get-rpc.ts | Shows the shared RPC client cache that scopes transport reuse by endpoint. |
| home/…/cache.tsx | Shows the general endpoint-scoped cache model used by other chain data providers. |