US Treasury Yields
AvailableDaily nominal and real yield curves and Treasury bill rates, in percent.
Three tables from the US Treasury, one row per business day: NOMINAL, the par yield curve from 1 month to 30 years, from 1990; REAL, the inflation-adjusted curve from 5 to 30 years, from 2004; and BILLS, bank discount and coupon equivalent rates for bills from 4 to 52 weeks, from 2002.
Use them as signals: the shape of the curve, real rates, or the short rate behind a cash return. They are yields, not prices you can trade.
How the data works
- Rates come from quotes taken at about 15:30 New York time. Treasury doesn't say when it posts them, so 18:00 is our assumption, and a daily equity strategy trades on a row the next morning.
- A rate Treasury didn't quote that day is None, so check before doing arithmetic on it. Newer maturities start later: 1 month in 2001, 2 months in 2018, 4 months in 2022 and 1.5 months in 2025. The 30-year has a gap from February 2002 to February 2006, and the 20-year starts in 1993. In REAL, the 20-year starts in July 2004 and the 30-year in February 2010. In BILLS, 8 weeks starts in 2018, 17 weeks in 2022 and 6 weeks in 2025.
- REAL starts on 2 January 2004, when Treasury began publishing it. Its files reach back further, but those rows couldn't have been seen at the time, so they are left out.
- Values are as they stand today. Any correction Treasury has made is not dated separately.
- This dataset is a snapshot to 30 October 2026, and doesn't update yet.
Fields
7 columns| Field | Description |
|---|---|
| available_time | When the row becomes visible to an algorithm: 18:00 New York time on its date |
| date | Day the rates were quoted |
| m1, m1_5, m2, m3, m4, m6 | NOMINAL: par yields for 1, 1.5, 2, 3, 4 and 6 months |
| y1, y2, y3, y5, y7, y10, y20, y30 | NOMINAL and REAL: par yields by years to maturity. REAL starts at y5 |
| long_term_average | NOMINAL: composite rate over 10 years, from 2000. REAL: long-term real average |
| w4_discount, w6_discount, w8_discount, w13_discount, w17_discount, w26_discount, w52_discount | BILLS: bank discount rate by weeks to maturity |
| w4_coupon, w6_coupon, w8_coupon, w13_coupon, w17_coupon, w26_coupon, w52_coupon | BILLS: coupon equivalent rate by weeks to maturity |
Example algorithm
# region imports
from AlgorithmImports import *
# endregion
from lean_platform_data import TreasuryYields
class YieldCurveAlgorithm(QCAlgorithm):
def initialize(self):
self.set_start_date(2005, 1, 1)
self.set_end_date(2021, 1, 1)
self.set_cash(100000)
self.spy = self.add_equity("SPY", Resolution.DAILY).symbol
# NOMINAL, REAL or BILLS. Rows arrive at 18:00 New York time on their date.
self.curve = self.add_data(TreasuryYields, "NOMINAL").symbol
def on_data(self, slice):
if self.curve not in slice:
return
y = slice[self.curve]
# Hold SPY unless the curve is inverted: 2-year yields above 10-year yields.
if y.y10 - y.y2 > 0:
self.set_holdings(self.spy, 1)
else:
self.liquidate(self.spy)
Public data from the U.S. Department of the Treasury.