# GET /v1/xrpl/metrics/network

XRPL network metric: the XRP burned over a past-ledger window with the precision bound of its hourly rate, the live open ledger fee, ledger fill ratio and fee escalation signals (escalation, cost multiplier and queue fill), and the fee regime of that ratio against its 7-day stored baseline.

## Purpose

Reports the XRP destroyed by transaction fees over a past-ledger window, the live open ledger fee and how full the open ledger is, and the regime of that fill against its stored 7-day baseline. `window` is `1h`, `24h` (the default), `7d` or `30d`; any other value answers 400 naming it, with no ledger read. The window ends at the latest validated ledger (`to_ledger`, read through the same cache entry as `/v1/xrpl/ledger/latest`) and starts at `from_ledger` = `to_ledger` minus the window's seconds divided by the average ledger close time of 3.9967 seconds (measured over 650,000 mainnet ledgers), rounded down to a multiple of 100 ledgers so that requests share one cached read; one `ledger` read at `from_ledger` gives its close time, and `window_range.seconds` is the real number of seconds between `from_close_time` and `to_close_time` (ISO 8601 UTC). `burn.total_coins_start_xrp` and `burn.total_coins_end_xrp` are the inputs of the burn, the ledger's total XRP (`total_coins` / 1000000, exact) at from_ledger and at to_ledger, and `burn.burned_xrp` = (total_coins at from_ledger − total_coins at to_ledger) / 1000000 = total_coins_start_xrp − total_coins_end_xrp, in XRP: the drop of the ledger's total XRP is the fees destroyed. `burn.burned_xrp_per_hour` = burned_xrp / window_range.seconds × 3600, in XRP per hour. Ledger close times are rounded to their `close_time_resolution` (10 seconds or more), so `window_range.seconds`, and with it the hourly rate of a short window such as `1h`, carries that error: the rate can be off by up to `burn.close_time_error_ratio` = the larger `close_time_resolution` of the two `ledger` headers the window already reads (at `from_ledger` and `to_ledger`, no extra read) / window_range.seconds, a fraction. When the `close_flags` of either header carry the no-consensus close time flag (0x01), that close time is not agreed, so `burn.burned_xrp_per_hour` and `burn.close_time_error_ratio` are `null` with `close_time_no_consensus`, while `burn.burned_xrp` is still served. `fee.open_ledger_fee_drops` is the open ledger fee in drops, as returned, `fee.current_ledger_size` and `fee.expected_ledger_size` are the transactions in the open ledger and the transactions rippled expects in it (JSON integers, the names of `/v1/xrpl/fee`), and `fee.ledger_fill_ratio` = current_ledger_size / expected_ledger_size, all from one `fee` read of the open ledger of one dedicated upstream, never failed over; the ratio is `null` when the expected size is 0. The ratio samples the open ledger at the moment of the read, so consecutive reads can differ widely. `fee.queue_size` is the number of transactions waiting in the transaction queue (rippled `current_queue_size`, a JSON integer). `fee.escalated` is true when rippled's fee levels.open_ledger_level is above levels.reference_level of the same fee read, compared as numbers, never as text: it holds exactly when the open ledger fee is above the base fee, since rippled derives the open ledger fee as levels.open_ledger_level × base fee / 256, rounded up. `fee.open_ledger_fee_multiplier` = levels.open_ledger_level / levels.reference_level, the open ledger cost as a multiple of the base cost, and `fee.queue_fill_ratio` = current_queue_size / max_queue_size, the transaction queue fill, `null` when rippled reports no queue maximum or a maximum of 0. `fee_regime` does not use these escalation signals: its bands come from the z-score of `ledger_fill_ratio` alone. `fee_regime` compares the live `ledger_fill_ratio` with the stored 7-day baseline of the same figure, which the service records every 15 minutes from that upstream: z = (live − mean) / population standard deviation of the stored values, rounded half-up to 2 decimals, then `spike` at a z-score of 3 or more, `elevated` at 2 or more and `normal` below 2 (a negative z-score is `normal`). When every stored value is equal (standard deviation 0), the z-score is `null` and the band is `elevated` when the live value is above that flat value, else `normal`. `baseline` lists the two fee figures, `open_ledger_fee_drops` and `ledger_fill_ratio`, each with its stored `points` in the window of the 672 15-minute slots ending at the latest recorded slot, `gaps` (672 − points), `median`, `mean` and `stddev` (the mean and the population standard deviation of the stored values, over the stored points), `live` (the same figure in `fee`, `null` when it is `null` there), `zscore`, `robust_zscore`, the modified z-score 0.6745 × (live − median) / MAD, where MAD is the median absolute deviation of the stored values from their median (each median the mean of the two middle values for an even count), from the stored median and MAD (at most 18 decimals, half-up) and rounded half-up to 2 decimals: an absolute value above 3.5 flags an outlier (NIST/SEMATECH e-Handbook 1.3.5.17), and it is `null` when the MAD is 0 or without a live value, and `truncated_points`, `null` for both figures (it counts truncated book pages, which a fee figure does not read). A figure with fewer than 288 stored slots (3 days) is warming up: its `median`, `mean`, `stddev`, `zscore` and `robust_zscore` are `null`, its `live` is still served, and `reasons` contains `warming_up`; `baseline` is `null` while both figures warm up, and `fee_regime` is `null` while `ledger_fill_ratio` warms up or has no live value. When the ledger at the window start is not available from the pinned provider (the past read answers `lgrNotFound` or `lgrIdxsInvalid`: outside its `complete_ledgers` or in a gap inside them), `window_range` and `burn` are `null` with `beyond_history`, and the fee figures, `fee_regime` and `baseline` are still served. When the stored series cannot be read, `baseline` and `fee_regime` are `null` with `baseline_unavailable`, and the burn and the fee figures are still served. `reasons` lists `beyond_history`, `close_time_no_consensus`, `warming_up` and `baseline_unavailable` in that order and is empty when every figure is computed. The past `ledger` read and the `fee` read are pinned to that upstream and never fail over to another; another failure of either, with no last good answer left, fails the answer (503 `upstream-unavailable`). `meta` describes the current reads only, the latest ledger and the fee read; the past ledger is reported in `window_range`, and the stored series in `baseline`. A past ledger never changes, so its read is cached for 86400 seconds; the 7-day summary of the stored series is computed once per 15-minute slot, from the 672 slots ending at the latest recorded slot, and cached until that slot ends (a request made before the current slot is recorded gets the previous slot's summary). The burn, the fill ratio, the escalation signals, the z-scores and the band are defined computations over the ledger and the stored series, not advice. The burn and fee figures, medians and z-scores are decimal strings, `fee.escalated` is a boolean, and ledger indexes, the two ledger sizes, `fee.queue_size` and `window_range.seconds` are integers. An answer is fresh for 4 seconds, the policy of its fee read. The example is computed from recorded mainnet reads of that upstream: the latest validated ledger 108267510, the start 108266600 of its `1h` window and the fee read of the same moment, with the stored baseline still warming up.

## When to use

To measure how much XRP the ledger destroyed in fees over the last hour, day, week or month and how precise its hourly rate is, whether the open ledger fee has escalated above the base fee and how full the transaction queue is, and whether the open ledger is fuller than usual against its own 7-day baseline.

## When not to use

To pick the fee to put on a transaction (use `/v1/xrpl/fee`), or to read the latest validated ledger and its close age (use `/v1/xrpl/ledger/latest`).

## Parameters

| Name | In | Required | Description | Constraints | Example |
|---|---|---|---|---|---|
| `window` | query | no | Window back from the latest validated ledger: 1h, 24h, 7d or 30d (default 24h). | One of 1h, 24h, 7d or 30d; any other value is rejected with 400 | `1h` |

## Request example

```sh
curl -s "https://api.criptonlabs.com/v1/xrpl/metrics/network?window=1h"
```

## Response example (200)

```json
{
  "window_range": {
    "from_ledger": 108266600,
    "to_ledger": 108267510,
    "from_close_time": "2026-11-11T19:21:32.000Z",
    "to_close_time": "2026-11-11T20:22:51.000Z",
    "seconds": 3679
  },
  "burn": {
    "total_coins_start_xrp": "99985556288.589745",
    "total_coins_end_xrp": "99985556234.356877",
    "burned_xrp": "54.232868",
    "burned_xrp_per_hour": "53.068313346017939658",
    "close_time_error_ratio": "0.002718129926610492"
  },
  "fee": {
    "open_ledger_fee_drops": "10",
    "current_ledger_size": 137,
    "expected_ledger_size": 1000,
    "ledger_fill_ratio": "0.137",
    "queue_size": 0,
    "escalated": false,
    "open_ledger_fee_multiplier": "1",
    "queue_fill_ratio": "0"
  },
  "fee_regime": null,
  "baseline": null,
  "reasons": [
    "warming_up"
  ],
  "meta": {
    "ledger_index": 108267510,
    "ledger_state": "validated",
    "as_of": "2026-11-11T20:22:56.994Z",
    "age_seconds": 0,
    "cache": "miss",
    "stale": false
  }
}
```

## Errors

- 400 [invalid-parameters](https://api.criptonlabs.com/errors/invalid-parameters.md)
- 400 [bad-request](https://api.criptonlabs.com/errors/bad-request.md)
- 429 [rate-limited](https://api.criptonlabs.com/errors/rate-limited.md)
- 503 [upstream-unavailable](https://api.criptonlabs.com/errors/upstream-unavailable.md)

## Caching

Fresh for 4 seconds; on upstream failure the last good value is served for up to 60 seconds (`meta.stale` is `true`), then the service answers 503. See the [freshness guide](https://api.criptonlabs.com/docs/guides/freshness.md).

## Rate limit

Tier `expensive`. See the [rate-limits guide](https://api.criptonlabs.com/docs/guides/rate-limits.md).

## MCP tool

The MCP tool `xrpl_metrics_network` returns the same data. See the [MCP quickstart](https://api.criptonlabs.com/docs/guides/mcp-quickstart.md).
