# GET /v1/xrpl/metrics/fx-basis

The EUR/USD rate the XRP Ledger DEX implies through the EUR registry stablecoin against each USD registry stablecoin, and its basis to the ECB reference rate.

## Purpose

Prices EURØP, the EUR stablecoin of the registry that `/v1/xrpl/stablecoin/{asset}` checks, in each USD stablecoin of the registry, one leg per coin in registry order (RLUSD, then USDC), through the routes of `/v1/xrpl/metrics/peg`: `clob_direct` is the mid of the direct order book (base EURØP, quote the leg's USD coin), `amm_direct` the fee-free spot of the direct AMM pool (a frozen or empty pool counts as no pool), and `via_xrp` the mid of XRP in the USD coin divided by the mid of XRP in EURØP. Each leg lists only its available `routes`, each with its `observed` USD per EUR and its `deviation_bps` = (observed / usd_per_eur − 1) × 10000, where usd_per_eur is the ECB reference rate; `implied_usd_per_eur` is the median of the unrounded observed prices (the mean of the two middle values for an even count), and `basis_bps` = (implied_usd_per_eur / usd_per_eur − 1) × 10000, computed from the unrounded implied rate. `usd_leg_spread_bps` is the RLUSD leg's basis minus the USDC leg's, from the unrounded bases, and `null` unless both legs have a basis. A leg with no route has `routes` empty and `implied_usd_per_eur` and `basis_bps` `null`, and `reasons` holds `no_route`. `reference` is the stored ECB reference rate in USD per EUR, the latest on or before the answer's UTC date (`rate_date`, `usd_per_eur`, `age_days` and `source`); without a stored rate `reference`, every `deviation_bps`, `basis_bps` and `usd_leg_spread_bps` are `null` and `reasons` holds `reference_rate_unavailable`, while `implied_usd_per_eur` is still reported. `age_days` is the number of whole days from `rate_date` to the answer's UTC date, and `warnings` holds `stale_reference` when `age_days` is above 4 days (a rate 4 days old is not stale, one 5 days old is). Source: ECB statistics. The route takes no parameters. The XRP/EURØP book both legs use is read once; the books are read at depth 100 (the same cached books as `/v1/xrpl/orderbook`) and the pools through the same cache entries as `/v1/xrpl/amm/{a}/{b}`; `meta` reports the lowest ledger, the oldest read and the worst cache state of these reads, the ECB rate not included. An AMM read that fails for another reason than a missing pool fails the answer as a failed book read does (503 `upstream-unavailable` when no node can serve it). The bases are defined computations over the ledger and the ECB rate, not advice. Bps fields are decimal strings rounded half-up to 2 decimals; prices are decimal strings. An answer is fresh for 4 seconds, the shortest policy of its reads.

## When to use

To measure, from the XRP Ledger's own order books and AMM pools, the EUR/USD rate the DEX implies through the EUR registry stablecoin against each USD registry stablecoin, and how far it sits from the ECB reference rate.

## When not to use

To measure how far one registry stablecoin trades from its peg against another registry coin (use `/v1/xrpl/metrics/peg`), or to read an order book or an AMM pool (use `/v1/xrpl/orderbook` or `/v1/xrpl/amm/{a}/{b}`).

## Parameters

This endpoint takes no parameters.

## Request example

```sh
curl -s "https://api.criptonlabs.com/v1/xrpl/metrics/fx-basis"
```

## Response example (200)

```json
{
  "legs": [
    {
      "usd_asset": "524C555344000000000000000000000000000000.rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De",
      "implied_usd_per_eur": "0.914229031925217893",
      "routes": [
        {
          "route": "via_xrp",
          "observed": "0.914229031925217893",
          "deviation_bps": "-1783.69"
        }
      ],
      "basis_bps": "-1783.69"
    },
    {
      "usd_asset": "5553444300000000000000000000000000000000.rGm7WCVp9gb4jZHWTEtGUr4dd74z2XuWhE",
      "implied_usd_per_eur": "0.911473349577587427",
      "routes": [
        {
          "route": "amm_direct",
          "observed": "0.908381895858695151",
          "deviation_bps": "-1836.24"
        },
        {
          "route": "via_xrp",
          "observed": "0.914564803296479703",
          "deviation_bps": "-1780.67"
        }
      ],
      "basis_bps": "-1808.45"
    }
  ],
  "usd_leg_spread_bps": "24.77",
  "reference": {
    "rate_date": "2026-11-11",
    "usd_per_eur": "1.1127",
    "age_days": 0,
    "source": "Source: ECB statistics"
  },
  "warnings": [],
  "reasons": [],
  "meta": {
    "ledger_index": 108267510,
    "as_of": "2026-11-11T20:23:03.000Z",
    "age_seconds": 0,
    "cache": "miss",
    "stale": false
  }
}
```

## Errors

- 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_fx_basis` returns the same data. See the [MCP quickstart](https://api.criptonlabs.com/docs/guides/mcp-quickstart.md).
