# Discount Factors

Discount factors convert future cashflows to their present value. BlueGamma derives discount factors directly from our constructed curves.

***

## What Is a Discount Factor?

A discount factor represents the present value of £1 (or $1) received at a future date. It answers: "What is a future cashflow worth today?"

$$
\text{Present Value} = \text{Future Cashflow} \times \text{Discount Factor}
$$

**Example:** If the 2-year discount factor is 0.9358, then £100 received in 2 years is worth £93.58 today.

***

## The Formula

Discount factors are derived from zero-coupon rates:

$$
DF\_t = \frac{1}{(1 + r\_t)^t}
$$

Where:

* **DF** = Discount factor for time t
* **r** = Zero-coupon rate for maturity t
* **t** = Time in years to the cashflow

***

## Example Calculation

**Given:** SOFR zero-coupon rates (as of December 2024)

| Maturity | Date       | Zero Rate | Discount Factor |
| -------- | ---------- | --------- | --------------- |
| 6M       | 2025-06-15 | 3.63%     | 0.9821          |
| 2Y       | 2027-12-15 | 3.39%     | 0.9358          |

**Verify the 2-year discount factor:**

Time to maturity: 2 years

$$
DF = \frac{1}{(1 + 0.0339)^{2}} = \frac{1}{1.0689} = 0.9356
$$

***

## How BlueGamma Calculates Discount Factors

### 1. Bootstrapping

We start with market instruments (deposits, futures, swaps) and bootstrap a zero-coupon curve.

### 2. Compounding Forward Rates

The discount factor at time t is the product of all overnight discount factors:

$$
DF\_t = \prod\_{i=0}^{t-1} \frac{1}{1 + r\_{i,i+1} \times \delta\_i}
$$

Where:

* **r\_{i,i+1}** = Forward rate between day i and i+1
* **δᵢ** = Day count fraction for that period

### 3. Interpolation

For dates between curve points, we interpolate on log discount factors to ensure smooth, no-arbitrage results.

***

## Using Discount Factors in BlueGamma

### API

```bash
curl "https://api.bluegamma.io/v1/discount_factor?index=SOFR&date=2026-06-15" \
  -H "x-api-key: your_api_key"
```

**Response:**

```json
{
  "index": "SOFR",
  "date": "2026-06-15",
  "discount_factor": 0.9821,
  "timestamp": "2025-12-16T12:50:53"
}
```

### Excel Add-in

```
=BlueGamma.DISCOUNT_FACTOR("SOFR", "2026-06-15")
```

***

## Common Use Cases

| Use Case           | Description                                                |
| ------------------ | ---------------------------------------------------------- |
| **Swap valuation** | Discount fixed and floating leg cashflows to present value |
| **Bond pricing**   | Calculate the PV of coupon and principal payments          |
| **Loan valuation** | Value amortising debt schedules                            |
| **DCF models**     | Discount projected cashflows in financial models           |
| **Mark-to-market** | Calculate current value of existing positions              |

***

## Key Properties

* **Always positive** — Discount factors are always > 0
* **Decrease with time** — Longer maturities have lower discount factors (assuming positive rates)
* **DF at t=0 is 1** — Today's value of £1 today is £1
* **Related to zero rates** — DF and zero rates are mathematically equivalent representations

***

## Discount Factors vs Zero Rates

Both represent the same information in different forms:

| Representation  | Formula              | Use Case                      |
| --------------- | -------------------- | ----------------------------- |
| Discount Factor | DF = 1/(1+r)^t       | Direct PV calculations        |
| Zero Rate       | r = (1/DF)^(1/t) - 1 | Comparing rates across tenors |

BlueGamma provides both via the API and Excel Add-in.

***

## Related Documentation

* [Interest Rate Curves](/documentation/methodology/how-to-bootstrap-the-yield-curve.md) — How curves are constructed
* [Zero Rates](/documentation/methodology/zero-rates.md) — Zero rates and discount factors are equivalent representations
* [Forward Rates](/documentation/methodology/forward-rates.md) — How forward rates are calculated
* [Government Bond Curves](/documentation/methodology/government-bond-curves.md) — Treasury yield curve construction
* [How to Calculate Discount Factors Using Government Bond Yields](/documentation/integrations/excel-add-in/how-to-guides/how-to-calculate-discount-factors-in-excel.md) — Excel guide for Treasury-based discounting
* [API Reference](/documentation/integrations/api/api-reference.md) — Complete API documentation


---

# Agent Instructions: 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:

```
GET https://bluegamma.io/documentation/methodology/discount-factors.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
