> For the complete documentation index, see [llms.txt](https://bluegamma.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bluegamma.io/documentation/integrations/api/how-to-guides/fetching-compounded-rfr-rates.md).

# Fetching Compounded RFR Rates

The `/compounded_rate` endpoint calculates **realised compounded rates** for overnight risk-free rate (RFR) indices over a specified period. This is the rate you'd use to settle a floating-rate payment based on actual daily fixings.

***

## Example: 90-Day Compounded SOFR

```python
import requests

url = "https://api.bluegamma.io/v1/compounded_rate"
headers = {"x-api-key": "your_api_key"}

params = {
    "index": "SOFR",
    "start_date": "2025-09-17",
    "end_date": "2025-12-16"
}

response = requests.get(url, headers=headers, params=params)
print(response.json())
```

```bash
curl -X GET "https://api.bluegamma.io/v1/compounded_rate?index=SOFR&start_date=2025-09-17&end_date=2025-12-16" \
  -H "x-api-key: your_api_key_here"
```

**Response:**

```json
{
  "start_date": "2025-09-17",
  "end_date": "2025-12-16",
  "index": "SOFR",
  "nominal": 1000000.0,
  "spread": 0.0,
  "day_counter": "Actual360",
  "calendar": "SOFR fixing calendar",
  "lookback_days": 0,
  "lockout_days": 0,
  "apply_observation_shift": false,
  "rate": 4.090541348035881,
  "amount": 10226.353370089702
}
```

| Field         | Description                           |
| ------------- | ------------------------------------- |
| `start_date`  | Start of the compounding period       |
| `end_date`    | End of the compounding period         |
| `index`       | The overnight index used              |
| `nominal`     | Notional amount (default: 1,000,000)  |
| `spread`      | Spread added to the rate (default: 0) |
| `day_counter` | Day count convention used             |
| `rate`        | The compounded rate as a percentage   |
| `amount`      | Interest amount on the notional       |

***

## Validating Against the New York Fed

The New York Fed publishes official [SOFR Averages](https://www.newyorkfed.org/markets/reference-rates/sofr-averages-and-index) for 30-, 90-, and 180-calendar day periods. You can use these to validate BlueGamma's calculations.

<figure><img src="/files/d71PdveMErm26YU9IKEH" alt="New York Fed SOFR Averages page"><figcaption><p>The New York Fed publishes daily SOFR averages for 30, 90, and 180 calendar day periods</p></figcaption></figure>

### Matching the Fed's 90-Day Average

The Fed's 90-day SOFR average for **December 16, 2025** is **4.09054%**.

To replicate this with the BlueGamma API, count back exactly 90 calendar days from December 16:

```python
params = {
    "index": "SOFR",
    "start_date": "2025-09-17",  # 90 days before 12/16
    "end_date": "2025-12-16"
}
```

**BlueGamma returns: `4.090541%`** — matching the Fed's published value.

| Source              | 90-Day Compounded SOFR |
| ------------------- | ---------------------- |
| NY Fed (12/16/2025) | 4.09054%               |
| BlueGamma API       | 4.090541%              |

{% hint style="success" %}
**Exact match.** BlueGamma uses the same compounding methodology as the Fed's SOFR Averages, so results should match when using the correct 90-calendar-day window.
{% endhint %}

***

## Supported Indices

| Index       | Currency | Description                          |
| ----------- | -------- | ------------------------------------ |
| `SOFR`      | USD      | Secured Overnight Financing Rate     |
| `SONIA`     | GBP      | Sterling Overnight Index Average     |
| `ESTR`      | EUR      | Euro Short-Term Rate                 |
| `CORRA`     | CAD      | Canadian Overnight Repo Rate Average |
| `SARON`     | CHF      | Swiss Average Rate Overnight         |
| `TONAR`     | JPY      | Tokyo Overnight Average Rate         |
| `Fed Funds` | USD      | Federal Funds Effective Rate         |

***

## Optional Parameters

### Spread

Add a fixed spread to the compounded rate:

```python
params = {
    "index": "SOFR",
    "start_date": "2025-09-17",
    "end_date": "2025-12-16",
    "spread": 0.5  # Add 50 basis points
}
```

```bash
curl -X GET "https://api.bluegamma.io/v1/compounded_rate?index=SOFR&start_date=2025-09-17&end_date=2025-12-16&spread=0.5" \
  -H "x-api-key: your_api_key_here"
```

### Nominal Amount

Calculate the actual interest amount on a specific notional:

```python
params = {
    "index": "SOFR",
    "start_date": "2025-09-17",
    "end_date": "2025-12-16",
    "nominal": 50000000  # $50 million
}
```

```bash
curl -X GET "https://api.bluegamma.io/v1/compounded_rate?index=SOFR&start_date=2025-09-17&end_date=2025-12-16&nominal=50000000" \
  -H "x-api-key: your_api_key_here"
```

**Response includes:**

```json
{
  "nominal": 50000000.0,
  "rate": 4.090541348035881,
  "amount": 511317.6685044851
}
```

### Lookback and Lockout

For ISDA-style conventions with lookback or lockout periods:

```python
params = {
    "index": "SOFR",
    "start_date": "2025-09-17",
    "end_date": "2025-12-16",
    "lookback_days": 5,    # Use rate from 5 days prior
    "lockout_days": 2      # Freeze rate 2 days before end
}
```

```bash
curl -X GET "https://api.bluegamma.io/v1/compounded_rate?index=SOFR&start_date=2025-09-17&end_date=2025-12-16&lookback_days=5&lockout_days=2" \
  -H "x-api-key: your_api_key_here"
```

***

## Use Cases

### Settling a Floating-Rate Loan Payment

Calculate the interest due on a SOFR-linked loan:

```python
# Loan details
notional = 10_000_000  # $10 million
spread_bps = 150       # SOFR + 150bps

params = {
    "index": "SOFR",
    "start_date": "2024-10-01",  # Interest period start
    "end_date": "2024-12-31",    # Interest period end
    "nominal": notional,
    "spread": spread_bps / 100   # Convert to percentage
}

response = requests.get(url, headers=headers, params=params)
data = response.json()

print(f"Compounded SOFR: {data['rate']:.4f}%")
print(f"All-in rate: {data['rate'] + spread_bps/100:.4f}%")
print(f"Interest due: ${data['amount']:,.2f}")
```

```bash
curl -X GET "https://api.bluegamma.io/v1/compounded_rate?index=SOFR&start_date=2024-10-01&end_date=2024-12-31&nominal=10000000&spread=1.5" \
  -H "x-api-key: your_api_key_here"
```

### Comparing SONIA vs SOFR

```python
# Same period for both indices
period_params = {
    "start_date": "2025-09-17",
    "end_date": "2025-12-16"
}

sofr = requests.get(url, headers=headers, params={**period_params, "index": "SOFR"}).json()
sonia = requests.get(url, headers=headers, params={**period_params, "index": "SONIA"}).json()

print(f"SOFR (90-day):  {sofr['rate']:.4f}%")
print(f"SONIA (90-day): {sonia['rate']:.4f}%")
print(f"Spread:         {(sofr['rate'] - sonia['rate']) * 100:.1f} bps")
```

```bash
# SOFR
curl -X GET "https://api.bluegamma.io/v1/compounded_rate?index=SOFR&start_date=2025-09-17&end_date=2025-12-16" \
  -H "x-api-key: your_api_key_here"

# SONIA
curl -X GET "https://api.bluegamma.io/v1/compounded_rate?index=SONIA&start_date=2025-09-17&end_date=2025-12-16" \
  -H "x-api-key: your_api_key_here"
```

***

## Related Endpoints

| If you need...            | Use                                                                                          |
| ------------------------- | -------------------------------------------------------------------------------------------- |
| Daily fixing (single day) | [`/fixing`](/documentation/integrations/api/how-to-guides/fetching-fixing-rates.md)          |
| Forward-looking rates     | [`/forward_rate`](/documentation/integrations/api/how-to-guides/getting-forward-rates.md)    |
| Full forward curve        | [`/forward_curve`](/documentation/integrations/api/how-to-guides/getting-a-forward-curve.md) |

***

**Need an API key?**\
📩 <support@bluegamma.io> | 📅 [Book a call](https://app.lemcal.com/@alivohra/website-demo?back=1)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://bluegamma.io/documentation/integrations/api/how-to-guides/fetching-compounded-rfr-rates.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
