# US Treasury Zero Curve, Discount Factors & Forwards (`peak-app-rd/treasury-zero-curve`) Actor

Daily US Treasury par yield curve bootstrapped to zero rates, discount factors and forward rates at any tenor to 30 years. Every published par yield is repriced exactly.

- **URL**: https://apify.com/peak-app-rd/treasury-zero-curve.md
- **Developed by:** [Peak App Research and Development](https://apify.com/peak-app-rd) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 curve dates

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## US Treasury Zero Curve, Discount Factors & Forwards

Treasury publishes daily par yields. It does not publish zero-coupon rates, discount factors or
forward rates. This Actor bootstraps them from the official Daily Treasury Par Yield Curve for any
date since 1990, at any maturity out to 30 years. The resulting curve reprices every published par
yield exactly.

### What you get

One dataset item per date, with a point for every requested maturity:

- `par_published`: Treasury's par yield (CMT), where Treasury publishes that tenor
- `par_model`: par yield implied by the curve (semiannual coupon schedule)
- `zero_bey`: zero rate with semiannual compounding (bond-equivalent, Treasury's convention)
- `zero_cc`: zero rate with continuous compounding
- `discount_factor`: present value of 1 paid at that maturity
- `forward_instant`, `forward_1y`: instantaneous and 1-year forward rates (continuous compounding)

Rates are in percent. Each date also carries the published curve as-is and
`max_reprice_error_bp`, the worst difference between the curve's par yields and Treasury's.

### Method

Every published tenor is treated as a par security on a bond-equivalent basis, which is how
Treasury defines its curve. Bills (6 months and shorter) are single cash flows, and longer tenors
are semiannual par bonds. The default `monotone_convex` method builds the curve with Hagan & West's
monotone convex interpolation on forward rates, the method Treasury describes for its own par
curve. It solves until every published tenor reprices to within 0.01 bp, and it doesn't flatten
inverted curves. `linear_par` is a simpler alternative: par yields interpolated linearly to every
half year, with flat forwards between them.

Results are regression-tested against real Treasury data from the 2008 crisis, the 2020 zero-rate
period, the 2023 inversion and the 2025 addition of the 6-week bill. They are also cross-checked
against the Federal Reserve's independent Gürkaynak–Sack–Wright zero curve.

### Input

```json
{ "startDate": "2026-08-01", "endDate": "2026-08-31", "tenors": [0.25, 2, 5, 7.5, 10, 30], "method": "monotone_convex" }
```

- `startDate` / `endDate`: a range of up to 1 year. The default is the last 30 days.
- `dates`: specific dates instead of a range. Dates without Treasury data (weekends, holidays) come
  back as uncharged error items.
- `tenors`: maturities in years. The default is every published tenor plus every half year.

### Pricing

Pay per event:

- **$0.00005 per run**: Apify's standard run-start event, which waives the first 5 seconds of compute
- **$0.01 per date returned**, with every tenor included

A year of daily curves (about 250 dates) costs about $2.50. Dates with no Treasury data, and days
that can't be fitted, are never charged.

### Limits and notes

- Tenors are measured in years (months / 12), with no day-count calendar.
- Days when Treasury left a tenor blank are fitted to the tenors that were published, with a warning.
- Treasury floors published yields at zero (2020–2021 bills). Those values are used as published.
- Maturities beyond the longest published tenor are not extrapolated. Example: no 30Y from 2002 to 2006.

# Actor input Schema

## `startDate` (type: `string`):

First date of the range. Default: 30 days before the end date. Data starts 1990-01-02; one run covers up to 1 year.

## `endDate` (type: `string`):

Last date of the range. Default: today.

## `dates` (type: `array`):

Exact dates (YYYY-MM-DD), up to 366. Dates without Treasury data (weekends, holidays) come back as uncharged error items.

## `tenors` (type: `array`):

Maturities to output, in years (e.g. 0.25, 2, 7.5, 30). Default: every published tenor plus every half year to the longest.

## `method` (type: `string`):

monotone\_convex (Hagan-West, the method Treasury describes for its own par curve) or linear\_par (linear par yields, flat forwards).

## Actor input object example

```json
{
  "startDate": "2026-09-01",
  "endDate": "2026-09-25",
  "method": "monotone_convex"
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "startDate": "2026-09-01",
    "endDate": "2026-09-25"
};

// Run the Actor and wait for it to finish
const run = await client.actor("peak-app-rd/treasury-zero-curve").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "startDate": "2026-09-01",
    "endDate": "2026-09-25",
}

# Run the Actor and wait for it to finish
run = client.actor("peak-app-rd/treasury-zero-curve").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startDate": "2026-09-01",
  "endDate": "2026-09-25"
}' |
apify call peak-app-rd/treasury-zero-curve --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,peak-app-rd/treasury-zero-curve"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/0WtLbJUeu6BNzLLKd/builds/9w32SDHbOgR2PurRY/openapi.json
