> ## Documentation Index
> Fetch the complete documentation index at: https://fruitstand.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Get the US Treasury Yield Curve in Snowflake

> Get the US Treasury yield curve in Snowflake from FRED's DGS series, 1-month to 30-year, daily back to 1962, with SQL to pivot it and check for inversion.

*By [Fruit Stand Team](https://fruitstand.dev/about.md) · November 3, 2026 · Guides*

The US Treasury yield curve is in FRED as one series per maturity, from
`DGS1MO` (1 month) to `DGS30` (30 years), with daily history back to 1962. In Snowflake, with Fruit Stand's FRED Series
listing, one query pivots them into a curve. On October 29, 2026, it ran
from 4.06% at 1 month to 5.32% at 30 years.

Below are the series, the query, the curve then and now, and how to check
for inversion with the spread series FRED already publishes.

## The series

| Maturity | FRED series | Daily history from |
| - | - | - |
| 1 month | `DGS1MO` | July 2001 |
| 3 months | `DGS3MO` | September 1981 |
| 6 months | `DGS6MO` | September 1981 |
| 1 year | `DGS1` | January 1962 |
| 2 years | `DGS2` | June 1976 |
| 3 years | `DGS3` | January 1962 |
| 5 years | `DGS5` | January 1962 |
| 7 years | `DGS7` | July 1969 |
| 10 years | `DGS10` | January 1962 |
| 20 years | `DGS20` | January 1962, with no data from 1987 to late 1993 |
| 30 years | `DGS30` | February 1977 |

These are the Treasury's constant-maturity yields, in percent, published
for each business day. FRED also publishes spreads ready-made:
`T10Y2Y` (10-year minus 2-year) and `T10Y3M` (10-year minus 3-month).

## Pivot it into a curve

Don't have FRED data in Snowflake yet? [How to Get FRED Data into Snowflake
(3 Ways)](https://fruitstand.dev/blog/fred-data-into-snowflake.md) compares the options, from a
Marketplace listing to your own FRED API pipeline.

Each observation is a row, so pivot the maturities into columns for one row
per day:

```sql theme={null}
select *
from (
    select date, series_id, value
    from fred.fred_series_observations_vw
    where series_id in ('DGS1MO', 'DGS3MO', 'DGS6MO', 'DGS1', 'DGS2',
                        'DGS5', 'DGS10', 'DGS30')
      and date >= '2020-01-01'
)
pivot (max(value) for series_id in (
    'DGS1MO', 'DGS3MO', 'DGS6MO', 'DGS1', 'DGS2', 'DGS5', 'DGS10', 'DGS30'
)) as p (date, m1, m3, m6, y1, y2, y5, y10, y30)
order by date desc;
```

For a chart of a single day's curve, keep the long format instead, filter to
one date and sort by maturity.

## The curve then and now

| Maturity | Jul 3, 2023 | Oct 29, 2026 |
| - | -: | -: |
| 1 month | 5.27% | 4.06% |
| 3 months | 5.44% | 4.18% |
| 6 months | 5.53% | 4.28% |
| 1 year | 5.43% | 4.42% |
| 2 years | 4.94% | 4.61% |
| 5 years | 4.19% | 4.78% |
| 10 years | 3.86% | 4.98% |
| 30 years | 3.87% | 5.32% |

July 3, 2023 was the most inverted day of the recent cycle: the 10-year
yield was 1.08 points below the 2-year. By October 2026 the curve sloped
upward again, with every longer maturity yielding more than the shorter one.

## Check for inversion

The 10-year minus 2-year spread is the most watched inversion signal. FRED's
`T10Y2Y` series has it ready, so finding every inverted stretch is a filter:

```sql theme={null}
select
    min(date) as first_inverted,
    max(date) as last_inverted,
    count(*) as inverted_days,
    min(value) as deepest_spread
from fred.fred_series_observations_vw
where series_id = 'T10Y2Y'
  and value < 0
  and date >= '2022-01-01';
```

Run on November 2, 2026, it returned the 2022–2024 inversion: first inverted
on April 1, 2022, last on September 5, 2024, 541 trading days in all, at
its deepest −1.08 points.

To use the 3-month instead, as some recession studies do, swap in
`T10Y3M`. To compute a spread FRED doesn't publish, such as 30-year minus
5-year, subtract the two series on matching dates.

## The free option in Snowflake

Snowflake's free public data share (Snowflake Public Data, Free) also has
daily Treasury yields. They're the Federal Reserve's H.15 constant-maturity
series, the same data FRED's `DGS` series come from, with the same history.
Each maturity is a `variable` in `financial_economic_indicators_timeseries`,
such as `H15_RIFLGFCY10_N.B` for the 10-year:

```sql theme={null}
select date, variable, value * 100 as yield_pct
from snowflake_public_data_free.public_data_free.financial_economic_indicators_timeseries
where variable in ('H15_RIFLGFCY02_N.B', 'H15_RIFLGFCY10_N.B')
  and date >= '2026-08-01'
order by date desc, variable;
```

Three things differ from the FRED series, checked on November 3, 2026:

* **It lags.** The latest daily value was August 4, 2026, about three months
  behind FRED, which had October 29.
* **Decimals, not percent.** The 10-year on August 4 is `0.0463`, where
  FRED's `DGS10` is `4.63`. Multiply by 100 before mixing the two.
* **No ready-made spreads.** There's no `T10Y2Y` or `T10Y3M` equivalent, so
  you subtract the maturities yourself.

For history and research, the free share is enough. For a current curve or
a daily inversion check, use a source that updates daily, such as Fruit
Stand's [FRED Series listing](https://app.snowflake.com/marketplace/listing/GZTYZ40XYNE),
which refreshes every series daily and includes `T10Y2Y` and `T10Y3M`.

## Things to know

* **Missing days.** Bond markets close on some days stocks trade, such as
  Columbus Day and Veterans Day, so yields have gaps. Join on date with an
  outer join, or carry the last value forward, when combining with stock
  prices.
* **Daily vs. monthly.** The `DGS` series are daily. FRED also publishes
  monthly averages (for example `GS10`) if that's the frequency you need.
* **Real yields.** Inflation-protected yields are separate series, such as
  `DFII10` for the 10-year TIPS yield.

## F.A.Q.

> [accordion] What is the FRED series for the 10-year Treasury yield?
>
> `DGS10`, the 10-year Treasury constant-maturity yield, in percent, daily since January 1962. `GS10` is the monthly average.

> [accordion] Is the yield curve inverted now?
>
> Not as of October 29, 2026: the 10-year yield (4.98%) was above the 2-year (4.61%). The last inversion ended in September 2024. Check `T10Y2Y` for the latest value.

> [accordion] How far back does Treasury yield data go?
>
> The 1-, 3-, 5- and 10-year yields go back to January 1962. Shorter maturities start later: 3- and 6-month in 1981, 1-month in 2001.

> [accordion] Can I join yields with stock prices?
>
> Yes. Both are daily and keyed by date, so a join on date puts yields next to prices from the Historical Stock Prices listing. Use an outer join, since bond and stock market holidays differ.

To get the yield curve and 250,000+ other FRED series in Snowflake, start a
free 30-day trial of the [FRED Series listing on the Snowflake Marketplace](https://app.snowflake.com/marketplace/listing/GZTYZ40XYNE).
Every series is refreshed daily with full history. The schema is in the
[dataset docs](https://fruitstand.dev/datasets/fred-series.md). Questions? Reach out at
[contact@fruitstand.dev](mailto:contact@fruitstand.dev).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.