LAST UPDATED: --

OCRR API

The OCRR API provides programmatic access to the Onchain Reference Rate, a daily benchmark for stablecoin lending yields across DeFi, and the OCRR Yield Curve, derived from Pendle fixed-rate markets. All data is updated daily at 06:00 UTC.

The API is free, open, and requires no authentication. It is designed for researchers, developers, and institutions who want to integrate onchain rate data into their own systems, dashboards, or models.

No API key required. All endpoints are free and open.

Base URL & Rate Limits

Base URL

https://onchainreferencerate.com/api/v1

Rate Limits (enforced by IP)

Endpoint typeLimit
Current data endpoints30 requests / minute
Historical data endpoints10 requests / minute
Bulk / CSV export2 requests / minute

Rate limit headers are included in all responses:

X-RateLimit-Limit: 30
X-RateLimit-Remaining: 117
X-RateLimit-Reset: 1741824060

If you exceed the rate limit, you will receive a 429 Too Many Requests response.

Data freshness: All rate data is updated once per day at 06:00 UTC. The API serves cached responses between updates. There is no benefit to polling more frequently than once per hour for current data endpoints.

GET /latest v1

Returns the most recent daily OCRR snapshot, including all three indices, rate changes across multiple timeframes, universe breadth, and full component-level data.

Parameters

None

Example Request

curl https://onchainreferencerate.com/api/v1/latest
import requests

response = requests.get("https://onchainreferencerate.com/api/v1/latest")
data = response.json()
print(f"OCRR-USD: {data['rates']['OCRR_USD']}%")
const res = await fetch("https://onchainreferencerate.com/api/v1/latest");
const data = await res.json();
console.log(`OCRR-USD: ${data.rates.OCRR_USD}%`);

Response

Response 200 OK
{
  "date": "2026-03-12",
  "rates": {
    "OCRR_USD": 3.52,
    "OCRR_USDC": 3.48,
    "OCRR_USDT": 3.61
  },
  "changes": {
    "24h": {
      "OCRR_USD": -0.04,
      "OCRR_USDC": -0.02,
      "OCRR_USDT": -0.07
    },
    "7d": {
      "OCRR_USD": -0.18,
      "OCRR_USDC": -0.15,
      "OCRR_USDT": -0.24
    },
    "30d": {
      "OCRR_USD": -0.45,
      "OCRR_USDC": -0.38,
      "OCRR_USDT": -0.52
    }
  },
  "breadth": {
    "pool_count": 47,
    "protocol_count": 8,
    "total_tvl_usd": 4820000000
  },
  "components": [
    {
      "protocol": "aave-v3",
      "chain": "ETHEREUM",
      "symbol": "USDC",
      "apy": 3.84,
      "tvl_usd": 1240000000,
      "weight": 0.184,
      "selected_in_band": true
    }
    // ... 46 more items
  ],
  "protocol_weights": [
    {
      "protocol": "AAVE",
      "weight": 0.312,
      "tvl_usd": 1840000000
    }
    // ... 7 more items
  ]
}

GET /rate v1

Returns only the current OCRR-USD rate, pool count, and total TVL. Useful for simple integrations that only need the headline number.

Parameters

None

Example Request

curl https://onchainreferencerate.com/api/v1/rate
import requests

response = requests.get("https://onchainreferencerate.com/api/v1/rate")
data = response.json()
print(f"Rate: {data['rate']}%")
const res = await fetch("https://onchainreferencerate.com/api/v1/rate");
const data = await res.json();
console.log(`Rate: ${data.rate}%`);

Response

Response 200 OK
{
  "rate": 3.52,
  "pool_count": 47,
  "total_tvl_usd": 4820000000
}

GET /historical v1

Returns a historical time series of OCRR rates for chart rendering and analysis.

Query Parameters

ParameterTypeRequiredDefaultDescription
index string No USD One of: USD, USDC, USDT, ETHEREUM, BASE, ARBITRUM, BSC, TRON, SOLANA
timeframe string No 30D One of: 7D, 30D, 90D, 180D, 1Y, MAX

Example Request

curl "https://onchainreferencerate.com/api/v1/historical?index=USD&timeframe=30D"
import requests

response = requests.get(
    "https://onchainreferencerate.com/api/v1/historical",
    params={"index": "USD", "timeframe": "90D"}
)
series = response.json()["data"]
const params = new URLSearchParams({ index: "USD", timeframe: "90D" });
const res = await fetch(`https://onchainreferencerate.com/api/v1/historical?${params}`);
const { data } = await res.json();

Response

Response 200 OK
{
  "index": "USD",
  "timeframe": "30D",
  "data": [
    { "date": "2026-02-10", "rate": 3.97 },
    { "date": "2026-02-11", "rate": 3.94 },
    { "date": "2026-02-12", "rate": 3.91 },
    // ... 27 more items
    { "date": "2026-03-12", "rate": 3.52 }
  ]
}

GET /date/{date} v1

Returns the complete OCRR snapshot for a specific historical date. Response format is identical to /latest.

Path Parameters

ParameterTypeDescription
date string Date in YYYY-MM-DD format

Example Request

curl https://onchainreferencerate.com/api/v1/date/2026-02-01
import requests

response = requests.get("https://onchainreferencerate.com/api/v1/date/2026-02-01")
data = response.json()
const res = await fetch("https://onchainreferencerate.com/api/v1/date/2026-02-01");
const data = await res.json();

Response

Same structure as /latest for the requested date. Returns 404 if no data is available for that date.

GET /yc/latest v1

Returns the most recent yield curve snapshot, including all tenor points and the underlying Pendle market data.

Parameters

None

Example Request

curl https://onchainreferencerate.com/api/v1/yc/latest
import requests

response = requests.get("https://onchainreferencerate.com/api/v1/yc/latest")
curve = response.json()["curve"]
const res = await fetch("https://onchainreferencerate.com/api/v1/yc/latest");
const { curve } = await res.json();

Response

Response 200 OK
{
  "date": "2026-03-12",
  "curve": [
    { "tenor_days": 7, "tenor_label": "7D", "rate": 4.12 },
    { "tenor_days": 14, "tenor_label": "14D", "rate": 4.08 },
    { "tenor_days": 30, "tenor_label": "1M", "rate": 3.97 },
    { "tenor_days": 60, "tenor_label": "2M", "rate": 3.84 },
    { "tenor_days": 90, "tenor_label": "3M", "rate": 3.71 },
    { "tenor_days": 180, "tenor_label": "6M", "rate": 3.58 },
    { "tenor_days": 365, "tenor_label": "1Y", "rate": 3.42 }
  ],
  "markets": [
    {
      "market_address": "0x1234...abcd",
      "chain": "ETHEREUM",
      "asset": "sUSDe",
      "maturity_days": 47,
      "fixed_apy": 3.91,
      "tvl_usd": 25300000,
      "liquidity_usd": 8400000,
      "weight": 0.142
    }
    // ... more markets
  ],
  "metadata": {
    "market_count": 24,
    "total_tvl_usd": 412000000,
    "curve_shape": "normal"
  }
}

GET /yc/historical v1

Returns historical yield curve snapshots over a given number of days.

Query Parameters

ParameterTypeRequiredDefaultDescription
days integer No 30 Number of days of history to return (max: 365)

Example Request

curl "https://onchainreferencerate.com/api/v1/yc/historical?days=30"
import requests

response = requests.get(
    "https://onchainreferencerate.com/api/v1/yc/historical",
    params={"days": 30}
)
snapshots = response.json()["snapshots"]
const res = await fetch("https://onchainreferencerate.com/api/v1/yc/historical?days=30");
const { snapshots } = await res.json();

Response

Response 200 OK
{
  "days": 30,
  "snapshots": [
    {
      "date": "2026-02-10",
      "curve": [
        { "tenor_days": 7, "rate": 4.38 },
        { "tenor_days": 30, "rate": 4.21 },
        { "tenor_days": 90, "rate": 4.03 },
        { "tenor_days": 180, "rate": 3.87 },
        { "tenor_days": 365, "rate": 3.66 }
      ]
    }
    // ... 29 more snapshots
  ]
}

GET /historical/rates v1

Returns daily OCRR-USD rates with pool counts and TVL for a given date range.

CSV format is available on all historical endpoints. Set format=csv for direct download.

Query Parameters

ParameterTypeRequiredDefaultDescription
start_date string No* Start date YYYY-MM-DD
end_date string No* End date YYYY-MM-DD
preset string No 1Y One of: 7D, 30D, 90D, 1Y, ALL (overrides start/end_date)
format string No json json or csv
limit integer No 10 Rows to return in preview mode

*Either provide start_date + end_date, or use preset.

Example Requests

# JSON: last 90 days
curl "https://onchainreferencerate.com/api/v1/historical/rates?preset=90D"

# CSV download: full history
curl "https://onchainreferencerate.com/api/v1/historical/rates?preset=ALL&format=csv" \
  -o ocrr_rates.csv

# Custom date range
curl "https://onchainreferencerate.com/api/v1/historical/rates?start_date=2026-01-01&end_date=2026-03-01"
import requests

# JSON: last 90 days
response = requests.get(
    "https://onchainreferencerate.com/api/v1/historical/rates",
    params={"preset": "90D"}
)
data = response.json()["data"]

# CSV download
csv = requests.get(
    "https://onchainreferencerate.com/api/v1/historical/rates",
    params={"preset": "ALL", "format": "csv"}
)
with open("ocrr_rates.csv", "w") as f:
    f.write(csv.text)
// JSON: last 90 days
const res = await fetch(
  "https://onchainreferencerate.com/api/v1/historical/rates?preset=90D"
);
const { data } = await res.json();

// Custom date range
const res2 = await fetch(
  "https://onchainreferencerate.com/api/v1/historical/rates?start_date=2026-01-01&end_date=2026-03-01"
);
const range = await res2.json();

Response

Response 200 OK
{
  "start_date": "2025-12-12",
  "end_date": "2026-03-12",
  "count": 90,
  "data": [
    {
      "date": "2026-03-12",
      "rate": 3.52,
      "pool_count": 47,
      "total_tvl_usd": 4820000000
    },
    {
      "date": "2026-03-11",
      "rate": 3.56,
      "pool_count": 47,
      "total_tvl_usd": 4790000000
    }
    // ... 88 more rows
  ]
}

GET /historical/components v1

Returns the full component pool breakdown for each day in the requested date range. Useful for protocol-level analysis and weight tracking over time.

Query Parameters

Same as /historical/rates.

Example Request

curl "https://onchainreferencerate.com/api/v1/historical/components?preset=30D&format=csv" \
  -o ocrr_components.csv
import requests

response = requests.get(
    "https://onchainreferencerate.com/api/v1/historical/components",
    params={"preset": "30D"}
)
data = response.json()["data"]
const res = await fetch(
  "https://onchainreferencerate.com/api/v1/historical/components?preset=30D"
);
const { data } = await res.json();

Response

Response 200 OK
{
  "start_date": "2026-02-10",
  "end_date": "2026-03-12",
  "count": 30,
  "data": [
    {
      "date": "2026-03-12",
      "components": [
        {
          "protocol": "aave-v3",
          "chain": "ETHEREUM",
          "symbol": "USDC",
          "apy": 3.84,
          "tvl_usd": 1240000000,
          "weight": 0.184
        }
        // ... more components
      ]
    }
  ]
}

GET /historical/yieldcurve v1

Returns historical yield curve tenor data. Each row contains all tenor points for a given date, making it well-suited for term structure analysis.

Query Parameters

Same as /historical/rates.

Example Request

curl "https://onchainreferencerate.com/api/v1/historical/yieldcurve?preset=1Y&format=csv" \
  -o ocrr_yieldcurve.csv
import requests

response = requests.get(
    "https://onchainreferencerate.com/api/v1/historical/yieldcurve",
    params={"preset": "1Y"}
)
data = response.json()["data"]
const res = await fetch(
  "https://onchainreferencerate.com/api/v1/historical/yieldcurve?preset=1Y"
);
const { data } = await res.json();

Response

Response 200 OK
{
  "start_date": "2025-03-12",
  "end_date": "2026-03-12",
  "count": 365,
  "data": [
    {
      "date": "2026-03-12",
      "7d": 4.12,
      "14d": 4.08,
      "30d": 3.97,
      "60d": 3.84,
      "90d": 3.71,
      "180d": 3.58,
      "365d": 3.42
    }
    // ... more rows
  ]
}

Data Formats

  • Rate values Expressed as percentages (e.g. 3.52 = 3.52% APY)
  • Rate changes Expressed in percentage points (e.g. -0.18 = -18 basis points)
  • TVL values In USD, expressed as raw numbers (e.g. 4820000000 = $4.82B)
  • Dates ISO 8601 format: YYYY-MM-DD. All timestamps are UTC.
  • Chains ETHEREUM, BASE, ARBITRUM, BSC, TRON, SOLANA
  • Indices OCRR_USD (all stablecoins), OCRR_USDC (USDC only), OCRR_USDT (USDT only)

Errors

The API uses standard HTTP status codes.

CodeMeaning
200OK. Request succeeded.
400Bad Request. Invalid parameters. Check the error field for details.
404Not Found. No data available for the requested date or resource.
429Too Many Requests. Rate limit exceeded. Back off and retry.
500Internal Server Error. Try again shortly.

Error Response Format

Error Response 400 Bad Request
{
  "error": "Invalid date format. Use YYYY-MM-DD"
}

Changelog

v1
March 2026
Initial public release. Endpoints: /latest, /rate, /historical, /date/{date}, /yc/latest, /yc/historical, /historical/rates, /historical/components, /historical/yieldcurve.