For the complete documentation index, see llms.txt. This page is also available as Markdown.

Fetching a Discount Curve

Use the /discount_curve endpoint to get a full schedule of discount factors for cash flow discounting, loan valuation, and DCF models.

The /discount_curve endpoint returns a schedule of discount factors between two dates at a specified frequency. Use this when you need to discount multiple future cash flows back to present value.


Basic Example

import requests

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

params = {
    "index": "SOFR",
    "start_date": "0D",
    "end_date": "5Y",
    "frequency": "6M"
}

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

for point in data["curve"]:
    print(f"{point['date']}: {point['discount_factor']:.6f}")

Response:

Response fields

Field
Description

start_date

Start date of the curve

end_date

End date of the curve

index

The interest rate index used

valuation_time

When the curve was calculated

is_end_of_month

Whether dates are aligned to month-ends

frequency

Spacing between curve points

curve

Array of points, each with date and discount_factor

timestamp

When the underlying market data was captured

Curve point fields

Field
Description

date

The future date (ISO 8601 format)

discount_factor

The present value of 1 unit of currency received on that date. Starts at 1.0 and decreases over time.


Parameters

Parameter
Required
Description

index

Yes

Interest rate index (e.g., SOFR, SONIA, 6M EURIBOR)

start_date

Yes

Start of the curve. Relative (0D, 1Y) or absolute (2026-04-01)

end_date

Yes

End of the curve. Relative (5Y, 10Y, 30Y) or absolute (2031-04-01)

frequency

Yes

Spacing between points: 1M, 3M, 6M, or 1Y

valuation_time

No

Historical timestamp (ISO 8601) for reproducibility

is_end_of_month

No

Align dates to month-ends. Defaults to true


Practical example: Discounting a loan schedule


/discount_curve vs /discount_factor

/discount_curve

/discount_factor

Returns

Full schedule of discount factors

A single discount factor

API calls

1 call for the entire curve

1 call per date

Best for

Loan/bond valuation, DCF models, batch discounting

Quick lookups, single cash flow discounting

Use /discount_curve when you need discount factors for multiple dates. Use /discount_factor when you only need one.


Visualising a discount curve

Discount curves for SOFR, SONIA, and 6M EURIBOR over 10 years
SOFR, SONIA, and 6M EURIBOR discount curves: 10-year, quarterly frequency

If you need...
Use

A single discount factor

/discount_factor

Zero rates

/zero_rate

Forward rates

/forward_rate

A forward curve

/forward_curve


Need an API key? Book a demo | support@bluegamma.io

Last updated

Was this helpful?