Fetching Zero Rates
Fetch zero-coupon rates for discounting cash flows, building DCF models, and valuing debt portfolios.
The /zero_rate endpoint returns the zero-coupon rate (spot rate) for any date and index. Use this when you need to discount future cash flows to present value.
When to Use Zero Rates
Discount cash flows in a DCF model
Zero rates give you the pure time-value of money for each maturity
Value a loan or bond portfolio
Calculate the present value of future principal and interest payments
Build a pricing engine
Zero rates are the foundation for swap, bond, and derivative pricing
Compare rates across tenors
Unlike swap rates, zero rates can be directly compared
Basic Example
import requests
url = "https://api.bluegamma.io/v1/zero_rate"
headers = {"x-api-key": "your_api_key"}
params = {
"index": "SOFR",
"date": "2030-12-17" # 5 years from now
}
response = requests.get(url, headers=headers, params=params)
print(response.json())Response:
zero_rate
The zero-coupon rate as a percentage (3.71%)
day_count
Day count convention used (Actual/360 for SOFR)
compounding
Compounding convention (Simple for OIS indices)
timestamp
When the underlying market data was captured
Use Case: Discounting Cash Flows
A common task is discounting a series of future cash flows to present value — for example, valuing a loan with scheduled repayments.
Example: Value a 5-Year Amortising Loan
Output:
Use Case: Building a Zero Curve
Fetch zero rates across multiple tenors to build a complete curve:
Current SOFR Zero Curve (December 2025):
Dec 2026 (1Y)
3.48%
Dec 2027 (2Y)
3.39%
Dec 2028 (3Y)
3.46%
Dec 2029 (4Y)
3.57%
Dec 2030 (5Y)
3.71%
Dec 2031 (6Y)
3.87%
Dec 2032 (7Y)
4.03%
The curve is slightly inverted at the short end (1Y > 2Y), then steepens — reflecting market expectations of near-term rate cuts followed by normalisation.
Use Case: Comparing USD vs GBP Rates
Compare zero rates across currencies to understand relative funding costs:
Output:
Visualising Zero Curves
By fetching zero rates across multiple tenors, you can build and visualise complete zero curves:

The chart shows:
SOFR (USD): Slight inversion at the short end (1Y > 2Y), then steepening to ~4.6% at 10Y
SONIA (GBP): Consistently 20-30bps higher across all tenors
Both curves reflect market expectations of near-term rate cuts followed by normalisation
Converting Zero Rates to Discount Factors
The API returns zero rates with simple compounding. To convert to a discount factor:
Or use the /discount_factor endpoint directly to skip the calculation:
Parameters
index
Yes
The interest rate index (e.g., SOFR, SONIA, 6M EURIBOR)
date
Yes
The maturity date (YYYY-MM-DD format)
valuation_time
No
Historical timestamp for the curve (ISO 8601 format)
Supported Indices
SOFR
USD
Actual/360
SONIA
GBP
Actual/365
ESTR
EUR
Actual/360
6M EURIBOR
EUR
Actual/360
CORRA
CAD
Actual/365
For the full list, see Available Indices.
Related Endpoints
Discount factors directly
Forward rates between two dates
The full swap curve
Historical rates
Add valuation_time parameter
Excel Alternative
If you prefer Excel, use the BlueGamma Add-in:
Returns: 3.71
See Excel Add-in Guide for setup instructions.
Need an API key? 📩 [email protected] | 📅 Book a call
Last updated
Was this helpful?

