File size: 11,849 Bytes
36b0e9e
8d512ed
 
 
 
36b0e9e
8d512ed
 
36b0e9e
8d512ed
36b0e9e
8d512ed
 
 
 
 
 
 
 
 
 
 
 
36b0e9e
 
8d512ed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63c1bfb
 
 
 
 
 
 
 
 
 
b132a5d
63c1bfb
 
 
 
 
 
 
8d512ed
593f920
 
86f6328
593f920
 
86f6328
593f920
 
86f6328
 
 
 
 
593f920
 
 
 
 
 
3b86828
65931a1
 
 
 
 
 
 
593f920
 
 
 
fa69b13
 
 
 
 
 
593f920
 
 
 
 
 
 
a635cb5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
777f62c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
---
title: US Treasury Yield Curve Spread
emoji: πŸ“‰
colorFrom: purple
colorTo: indigo
sdk: gradio
sdk_version: 4.44.0
python_version: '3.10'
app_file: app.py
pinned: true
license: cc-by-4.0
short_description: 2Y vs 10Y Treasury β€” recession indicator.
datasets:
- iizy/calcfi-open-data
tags:
- finance
- treasury
- yield-curve
- recession
- federal-reserve
- data-viz
- open-data
- gradio
---

# US Treasury Yield Curve Spread

[![Figshare DOI](https://img.shields.io/badge/Figshare%20DOI-10.6084%2Fm9.figshare.32332290-blue)](https://doi.org/10.6084/m9.figshare.32332290)
[![Zenodo DOI](https://img.shields.io/badge/Zenodo%20DOI-10.5281%2Fzenodo.20302283-1682D4)](https://doi.org/10.5281/zenodo.20302283)
[![CC BY 4.0](https://img.shields.io/badge/License-CC%20BY%204.0-lightgrey)](https://creativecommons.org/licenses/by/4.0/)

Visualize the 2-year vs 10-year Treasury yield spread alongside the Federal Funds Rate. When the 10Y drops below the 2Y, the curve inverts β€” historically a leading indicator of US recessions with a 12-24 month lead time.

## Why these series matter

The 2s/10s yield curve has inverted before every US recession since 1955, with a single false signal in the mid-1960s. The inversion itself is not the cause; it is the bond market pricing in expected Fed rate cuts in response to slowing growth. The lead time from inversion to recession averages 14 months but has ranged from 6 to 24 months. Pair this with the Federal Funds Rate to see how Fed policy itself drives the front end of the curve.

A library of free, primary-source-cited financial calculators that use these macro indicators as inputs is available at [calcfi.app](https://calcfi.app).

## Methodology

- **Federal Funds Rate (Effective)** β€” Federal Reserve via FRED, series `DFF` β€” [https://fred.stlouisfed.org/series/DFF](https://fred.stlouisfed.org/series/DFF)
- **2-Year Treasury Constant Maturity** β€” US Treasury via FRED, series `DGS2` β€” [https://fred.stlouisfed.org/series/DGS2](https://fred.stlouisfed.org/series/DGS2)
- **10-Year Treasury Constant Maturity** β€” US Treasury via FRED, series `DGS10` β€” [https://fred.stlouisfed.org/series/DGS10](https://fred.stlouisfed.org/series/DGS10)

No smoothing, no imputation, no seasonal adjustment. Each observation passes through verbatim from the primary source. Provenance headers are preserved in the underlying [CalcFi Open Data](https://huggingface.co/datasets/iizy/calcfi-open-data) dataset.

## Data source

The Space loads data live from the CalcFi Open Data dataset on Hugging Face:
[`iizy/calcfi-open-data`](https://huggingface.co/datasets/iizy/calcfi-open-data).

The same dataset is mirrored with permanent DOIs at:

- Figshare: [10.6084/m9.figshare.32332290](https://doi.org/10.6084/m9.figshare.32332290)
- Zenodo (CERN-backed): [10.5281/zenodo.20302283](https://doi.org/10.5281/zenodo.20302283)
- OSF: [10.17605/OSF.IO/PUMKT](https://doi.org/10.17605/OSF.IO/PUMKT)
- Kaggle: [10.34740/kaggle/dsv/16356447](https://doi.org/10.34740/kaggle/dsv/16356447)
- Mendeley Data: [10.17632/jsnwhy6vjn.1](https://doi.org/10.17632/jsnwhy6vjn.1)

## Related Spaces

Part of a small collection of CalcFi Open Data interactive explorers:

- [US Mortgage Rate Explorer](https://huggingface.co/spaces/iizy/calcfi-mortgage-rate-explorer)
- [Inflation vs Wage Growth Tracker](https://huggingface.co/spaces/iizy/calcfi-inflation-wage-tracker)
- [US Treasury Yield Curve Spread](https://huggingface.co/spaces/iizy/calcfi-yield-curve-spread)
- [Fed Funds Rate Cycle Explorer](https://huggingface.co/spaces/iizy/calcfi-fed-funds-cycle)
- [Oil and Gas Price Tracker](https://huggingface.co/spaces/iizy/calcfi-oil-gas-tracker)

## Citation & DOIs

This Space visualizes data from the [CalcFi Open Data project](https://calcfi.app/). Source rate series are archived under [CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/) across multiple persistent registries.

**2026-06-06 snapshot DOIs (Zenodo community):**
- Methodology paper: [10.5281/zenodo.20567975](https://doi.org/10.5281/zenodo.20567975)
- Live rate snapshot: [10.5281/zenodo.20567971](https://doi.org/10.5281/zenodo.20567971)
- Calculator registry: [10.5281/zenodo.20567964](https://doi.org/10.5281/zenodo.20567964)
- Full 37-record Zenodo archive: https://zenodo.org/communities/calcfi

**Multi-registry mirror:**
- OSF: [10.17605/OSF.IO/2J45Q](https://doi.org/10.17605/OSF.IO/2J45Q) (methodology paper)
- Harvard Dataverse: [10.7910/DVN/2LJXZM](https://doi.org/10.7910/DVN/2LJXZM)

**Discovery surfaces:**
- Full research index: https://calcfi.app/research
- Author ORCID: [0009-0000-0916-8684](https://orcid.org/0009-0000-0916-8684)
- Methodology and provenance: https://calcfi.app/about

## Related work

**Other HF Spaces in this set (10 total):**
- [calcfi-mortgage-rate-explorer](https://huggingface.co/spaces/iizy/calcfi-mortgage-rate-explorer) β€” 30Y, 15Y mortgage + 10Y Treasury
- [calcfi-inflation-wage-tracker](https://huggingface.co/spaces/iizy/calcfi-inflation-wage-tracker) β€” CPI + PCE + hourly earnings
- [calcfi-yield-curve-spread](https://huggingface.co/spaces/iizy/calcfi-yield-curve-spread) β€” Fed Funds + 2Y + 10Y, inversion shading
- [calcfi-fed-funds-cycle](https://huggingface.co/spaces/iizy/calcfi-fed-funds-cycle) β€” Fed Funds + Prime + credit-card APR
- [calcfi-oil-gas-tracker](https://huggingface.co/spaces/iizy/calcfi-oil-gas-tracker) β€” WTI + Brent + US gasoline
- [calcfi-fx-history](https://huggingface.co/spaces/iizy/calcfi-fx-history) β€” USD/EUR + USD/GBP + USD/JPY
- [calcfi-commodity-inflation](https://huggingface.co/spaces/iizy/calcfi-commodity-inflation) β€” Copper + corn + CPI
- [calcfi-gdp-per-capita](https://huggingface.co/spaces/iizy/calcfi-gdp-per-capita) β€” US + Eurozone GDP per capita
- [calcfi-labor-market](https://huggingface.co/spaces/iizy/calcfi-labor-market) β€” Unemployment + LFP
- [calcfi-consumer-credit](https://huggingface.co/spaces/iizy/calcfi-consumer-credit) β€” Credit card APR + personal loan rate

**Long-form Observable notebooks built on the same dataset:**
- [Mortgage Spread Over Treasury (50 years)](https://observablehq.com/@iizy/mortgage-spread-over-treasury-50-years)
- [Yield Curve Recession Indicator (2s/10s)](https://observablehq.com/@iizy/yield-curve-recession-indicator-2s-10s)
- [Inflation vs Fed Target (2% History)](https://observablehq.com/@iizy/inflation-vs-fed-target-2-percent-history)

**CodePen calculator demos (vanilla JS, MIT)** β€” [view all 6 in collection](https://codepen.io/collection/BawbdB):
- [Compound Interest Calculator](https://codepen.io/Jere-S/pen/LEbyJQe)
- [Mortgage Amortization Chart](https://codepen.io/Jere-S/pen/zxowJaw)
- [Inflation-Adjusted Returns](https://codepen.io/Jere-S/pen/pvNPOZg)
- [30Y Mortgage Rate History (FRED Data)](https://codepen.io/Jere-S/pen/emBWLLg)
- [Retirement Corpus Projection](https://codepen.io/Jere-S/pen/ByQROqg)
- [CPI vs Wages Tracker](https://codepen.io/Jere-S/pen/qEqmMQo)

**Static dataset documentation:**
- [GitLab Pages site](https://calcfi-open-data-4a2bc1.gitlab.io/) β€” catalog, methodology, citation guide
- [Hugging Face dataset card](https://huggingface.co/datasets/iizy/calcfi-open-data)

**Author profiles (Person entity graph):**
- [ORCID 0009-0000-0916-8684](https://orcid.org/0009-0000-0916-8684)
- [Academia.edu β€” Jere K Salmisto](https://independent.academia.edu/JereS6)
- [GitLab β€” jere.salmisto](https://gitlab.com/jere.salmisto)
- [CodePen β€” Jere-S](https://codepen.io/Jere-S)

**Live tools at [calcfi.app](https://calcfi.app):** 300+ free personal-finance calculators built on the same primary-source data layer (FRED, BLS, Freddie Mac, US Treasury).

## Citation

> Salmisto, J. (2026). *CalcFi Open Data: 34 Free CC-BY Financial and Macro Time Series Mirrored from Primary Sources* [Dataset]. Figshare. https://doi.org/10.6084/m9.figshare.32332290

ORCID: [0009-0000-0916-8684](https://orcid.org/0009-0000-0916-8684)

<!-- calcfi-mesh-footer-v2026-05-21 -->

---

## Companion surfaces

- **Free calculators (300+):** [calcfi.app](https://calcfi.app) β€” every tool cited to a primary source
- **Underlying dataset:** [CalcFi Open Data on Hugging Face](https://huggingface.co/datasets/iizy/calcfi-open-data) β€” 34 CC-BY series
- **Live SQL endpoint (Datasette):** [calcfi-open-data.vercel.app](https://calcfi-open-data.vercel.app/)
- **Python client:** `pip install calcfidata` ([PyPI](https://pypi.org/project/calcfidata/) Β· [Anaconda](https://anaconda.org/jeresalmisto/calcfidata))
- **Documentation:** [calcfidata.readthedocs.io](https://calcfidata.readthedocs.io/)
- **Query mirrors:** [data.world](https://data.world/jerehere/calcfi-open-data) Β· [DoltHub (versioned)](https://www.dolthub.com/repositories/jerehere/calcfi-open-data) Β· [MotherDuck (cloud DuckDB)](https://app.motherduck.com/share/92e4b6ab-46e0-42f4-8ebb-9e7ab22eae00)
- **Other visualizations:** [10 HF Spaces](https://huggingface.co/iizy) Β· [3 Observable notebooks](https://observablehq.com/@iizy) Β· [6 CodePen demos](https://codepen.io/collection/BawbdB)
- **Permanent DOIs:** [Figshare](https://doi.org/10.6084/m9.figshare.32332290) Β· [Zenodo](https://doi.org/10.5281/zenodo.20302283) Β· [OSF](https://doi.org/10.17605/OSF.IO/PUMKT) Β· [Kaggle](https://doi.org/10.34740/kaggle/dsv/16356447) Β· [Mendeley](https://doi.org/10.17632/jsnwhy6vjn.1)

> Built by [Jere Salmisto](https://orcid.org/0009-0000-0916-8684) β€” founder of [calcfi.app](https://calcfi.app).

---

## Distribution mesh β€” also available on

**Static landing pages (8 mirrors):**
- [GitLab Pages (canonical)](https://calcfi-open-data-4a2bc1.gitlab.io/)
- [GitHub Pages](https://jeresalmisto.github.io/calcfi-open-data/)
- [Cloudflare Pages](https://calcfi-open-data.pages.dev/)
- [Codeberg Pages (EU)](https://jerehere.codeberg.page/calcfi-open-data/)
- [Surge.sh](https://calcfi-open-data.surge.sh/)
- [Netlify](https://calcfi-open-data.netlify.app/)
- [AWS S3](https://calcfi-open-data.s3.us-east-1.amazonaws.com/index.html)
- [Datasette (live SQL)](https://calcfi-open-data.vercel.app/)

**Permanent DOIs (5):**
- [Figshare 10.6084/m9.figshare.32332290](https://doi.org/10.6084/m9.figshare.32332290)
- [Zenodo 10.5281/zenodo.20302283](https://doi.org/10.5281/zenodo.20302283) (CERN)
- [OSF 10.17605/OSF.IO/PUMKT](https://doi.org/10.17605/OSF.IO/PUMKT)
- [Kaggle 10.34740/kaggle/dsv/16356447](https://doi.org/10.34740/kaggle/dsv/16356447)
- [Mendeley Data 10.17632/jsnwhy6vjn.1](https://doi.org/10.17632/jsnwhy6vjn.1)

**Packages:** [PyPI `calcfidata`](https://pypi.org/project/calcfidata/) Β· [npm `calcfidata`](https://www.npmjs.com/package/calcfidata) Β· [Anaconda](https://anaconda.org/jeresalmisto/calcfidata) Β· [Go pkg](https://pkg.go.dev/gitlab.com/jere.salmisto/calcfi-open-data/go) Β· [Julia](https://github.com/jeresalmisto/CalcFiData.jl) Β· [dbt](https://github.com/jeresalmisto/dbt-calcfi-open-data) Β· [Read the Docs](https://calcfidata.readthedocs.io/)

**Data catalogs / warehouses:** [BigQuery Public](https://console.cloud.google.com/bigquery/analytics-hub/discovery/projects/1099067620437/locations/us/dataExchanges/calcfi_open_data_exchange/listings/calcfi_open_data) Β· [data.world](https://data.world/jerehere/calcfi-open-data) Β· [DoltHub](https://www.dolthub.com/repositories/jerehere/calcfi-open-data) Β· [MotherDuck](https://app.motherduck.com/share/92e4b6ab-46e0-42f4-8ebb-9e7ab22eae00)

**Repos:** [GitLab](https://gitlab.com/jere.salmisto/calcfi-open-data) Β· [GitHub](https://github.com/jeresalmisto/calcfi-open-data) Β· [Codeberg](https://codeberg.org/jerehere/calcfi-open-data)

**Companion website:** [calcfi.app](https://calcfi.app) β€” free personal-finance calculators built on this dataset.

**Author:** [Jere Salmisto](https://calcfi.app/about) Β· ORCID [0009-0000-0916-8684](https://orcid.org/0009-0000-0916-8684)

License: CC BY 4.0 (data) Β· MIT (code)