# GET /v1/xrpl/metrics/pressure

Buy or sell pressure of a pair's funded order book: a score from 0 to 100 and its band, from the depth near mid.

## Purpose

Reads the funded order book of `base`/`quote` (up to 100 levels per side, both sides from one validated ledger: the same cached book as `/v1/xrpl/orderbook` at depth 100) and reports `mid` (quote per base), `spread_bps` and `bands`: for 10, 50 and 100 bps around `mid`, the funded base quantity of the bids (`bid_depth`) and of the asks (`ask_depth`) priced within the band, bounds included, and their `imbalance` = (bid_depth − ask_depth) / (bid_depth + ask_depth), from -1 (asks only) to 1 (bids only), `null` when both depths are 0. `score` = 50 × (1 + imbalance_50), rounded half-up to an integer from 0 to 100, where imbalance_50 is the unrounded imbalance of the 50 bps band. `band` is decided on that integer score: `sell_pressure` below 40, `balanced` from 40 to 60 inclusive and `buy_pressure` above 60. A one-sided book gives `mid`, `spread_bps`, `bands`, `score` and `band` `null` with the reason `one_sided_book`; a two-sided book with no funded depth within 50 bps of `mid` gives `score` and `band` `null` with `no_depth_within_band`. The AMM is not used. `baseline` compares this book with its stored 7-day series: 15-minute snapshots of the books of the registry stablecoins paired with XRP and with each other, read from one dedicated upstream, each orientation stored on its own (depth in its base), so `base`/`quote` is compared with the series of that same order. Its seven figures, in this order, are `spread_bps`, `depth_bid_10`, `depth_ask_10`, `depth_bid_50`, `depth_ask_50`, `depth_bid_100` and `depth_ask_100`, each with its stored `points` in the window of the 672 15-minute slots ending at the latest recorded slot, `gaps` (672 − points, the slots with no stored point), `median` and `zscore` = (live − mean) / population standard deviation of the stored values, rounded half-up to 2 decimals (`null` when that deviation is 0), where live is the same figure of this book: the depths as `bands` reports them (`depth_bid_50` is the `bid_depth` of the 50 bps band) and `spread_bps` before its rounding to 2 decimals. A one-sided book has no live figure: every `zscore` is `null` and the medians are kept. A figure with fewer than 288 stored slots (3 days) is warming up: its `median` and `zscore` are `null` and `reasons` contains `warming_up`; `baseline` is `null` while every figure warms up. A pair outside that list, and every pair while the book series is not tracked, has `baseline: null` with `not_tracked`; a stored series that cannot be read, or that lacks a figure, gives `baseline: null` with `baseline_unavailable`; the score, its band and every other figure are still served and never depend on the baseline. `reasons` lists the score's own reason first, then at most one of `warming_up`, `not_tracked` and `baseline_unavailable`, and is empty when none applies. `meta` describes the book read only; 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 score, its band and the z-scores are defined computations over the book and the stored series, not advice. Bps fields are decimal strings rounded half-up to 2 decimals; prices, depths, imbalances and medians are decimal strings, and z-scores decimal strings rounded half-up to 2 decimals. An answer is fresh for 4 seconds, the policy of the order book it reads.

## When to use

To measure how the funded depth near mid of a pair's order book is split between bids and asks, as one score with its band.

## When not to use

To read the order book levels (use `/v1/xrpl/orderbook`), the cost of a trade of a given size, CLOB against AMM (use `/v1/xrpl/slippage`), or an AMM pool (use `/v1/xrpl/amm/{a}/{b}`).

## Parameters

| Name | In | Required | Description | Constraints | Example |
|---|---|---|---|---|---|
| `base` | query | yes | Base currency of the pair. `XRP`, or `CODE.issuer`: `CODE` is a 3-character standard code or 40 hexadecimal digits, and `issuer` is a classic XRPL address. Standard codes are case-sensitive: `usd` and `USD` are different tokens, so send the exact code. A standard code uses letters, digits or `?!@#$%^&*<>(){}[]\|` and is never `XRP`; percent-encode the symbols in a URL (for example `%3F` for `?`). A 40-hex code is read in any case, and the 40-hex form of a standard code means that code. | `XRP`, or `CODE.issuer`: `CODE` is a 3-character standard code or 40 hexadecimal digits, and `issuer` is a classic XRPL address. Standard codes are case-sensitive: `usd` and `USD` are different tokens, so send the exact code. A standard code uses letters, digits or `?!@#$%^&*<>(){}[]\|` and is never `XRP`; percent-encode the symbols in a URL (for example `%3F` for `?`). A 40-hex code is read in any case, and the 40-hex form of a standard code means that code. | `XRP` |
| `quote` | query | yes | Quote currency of the pair, different from base. `XRP`, or `CODE.issuer`: `CODE` is a 3-character standard code or 40 hexadecimal digits, and `issuer` is a classic XRPL address. Standard codes are case-sensitive: `usd` and `USD` are different tokens, so send the exact code. A standard code uses letters, digits or `?!@#$%^&*<>(){}[]\|` and is never `XRP`; percent-encode the symbols in a URL (for example `%3F` for `?`). A 40-hex code is read in any case, and the 40-hex form of a standard code means that code. | `XRP`, or `CODE.issuer`: `CODE` is a 3-character standard code or 40 hexadecimal digits, and `issuer` is a classic XRPL address. Standard codes are case-sensitive: `usd` and `USD` are different tokens, so send the exact code. A standard code uses letters, digits or `?!@#$%^&*<>(){}[]\|` and is never `XRP`; percent-encode the symbols in a URL (for example `%3F` for `?`). A 40-hex code is read in any case, and the 40-hex form of a standard code means that code. | `5553444300000000000000000000000000000000.rGm7WCVp9gb4jZHWTEtGUr4dd74z2XuWhE` |

## Request example

```sh
curl -s "https://api.criptonlabs.com/v1/xrpl/metrics/pressure?base=XRP&quote=5553444300000000000000000000000000000000.rGm7WCVp9gb4jZHWTEtGUr4dd74z2XuWhE"
```

## Response example (200)

```json
{
  "mid": "1.060349999740382078",
  "spread_bps": "16.03",
  "bands": [
    {
      "bps": 10,
      "bid_depth": "888.2",
      "ask_depth": "621.431483",
      "imbalance": "0.176711018552598641"
    },
    {
      "bps": 50,
      "bid_depth": "40751.18477",
      "ask_depth": "49196.877373",
      "imbalance": "-0.093895214658132204"
    },
    {
      "bps": 100,
      "bid_depth": "70757.50477",
      "ask_depth": "49198.877373",
      "imbalance": "0.179720553520028312"
    }
  ],
  "score": 45,
  "band": "balanced",
  "baseline": null,
  "reasons": [
    "not_tracked"
  ],
  "meta": {
    "ledger_index": 108267510,
    "as_of": "2026-11-11T20:23:03.000Z",
    "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 30 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_pressure` returns the same data. See the [MCP quickstart](https://api.criptonlabs.com/docs/guides/mcp-quickstart.md).
