April 10, 2025

How to Build a CORRA Forward Curve with the BlueGamma API Using Python

Step 1: Set Up Your Environment

Before we begin, ensure that you have Python installed along with the requests and matplotlib libraries. If you don't have them yet, install them using:

pip install requests matplotlib

Step 2: Fetch CORRA Forward Rates

The /forward_rate endpoint in the BlueGamma API lets you fetch forward rates for specific start dates and tenors. Let's start with an example for a single date:

import requests

# API endpoint
url = "https://api.bluegamma.io/v1/forward_rate"

# Query parameters for a single forward rate
querystring = {
    "index": "CORRA",           # Reference rate
    "start_date": "2025-06-30", # Start date
    "end_date": "3M"            # Fixed tenor of 3M
}

# API headers (replace 'YOUR_API_KEY' with your actual API key)
headers = {"X-Api-Key": "YOUR_API_KEY"}

# Fetch the forward rate
response = requests.get(url, headers=headers, params=querystring)
if response.status_code == 200:
    data = response.json()
    print("Forward Rate:", data["forward_rate"])
else:
    print("Error:", response.status_code, response.text)

The script fetches the 3-month CORRA forward rate starting on 2025-06-30. The response includes the forward rate and other relevant details.

Step 3: Build a CORRA Forward Curve

Now, let's expand this to fetch forward rates for a set of predefined dates. By doing so, we'll plot a CORRA forward curve to visualise how the rate evolves over time.

import requests

# API endpoint
url = "https://api.bluegamma.io/v1/forward_rate"

# Query parameters for a single forward rate
querystring = {
    "index": "CORRA",           # Reference rate
    "start_date": "2025-06-30", # Start date
    "end_date": "3M"            # Fixed tenor of 3M
}

# API headers (replace 'YOUR_API_KEY' with your actual API key)
headers = {"X-Api-Key": "YOUR_API_KEY"}

# Fetch the forward rate
response = requests.get(url, headers=headers, params=querystring)
if response.status_code == 200:
    data = response.json()
    print("Forward Rate:", data["forward_rate"])
else:
    print("Error:", response.status_code, response.text)

Step 4: Understand the Output

The graph plots the 3-month CORRA forward curve with:

  • x-axis: Predefined start dates
  • y-axis: Forward rates for 3M compounded CORRA

Try it Yourself!

Whether you're forecasting interest costs or performing valuations, the BlueGamma API makes it easy to fetch real-time swap rates and build forward curves.
👉 Request access to the API here

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Latest Posts