OPEN-SOURCE SCRIPT
Обновлено SOFR Spread (proxy: FEDFUNDS - US03MY)

📊 SOFR Spread (Proxy: FEDFUNDS - US03MY) – Monitoring USD Money Market Liquidity

In 2008, the spread exhibits a sharp vertical spike, signaling a severe liquidity dislocation: investors rushed into short-term U.S. Treasuries, pushing their yields down dramatically, while the FEDFUNDS rate remained relatively high.
This behavior indicates extreme systemic stress in the interbank lending market, preceding massive Federal Reserve interventions such as rate cuts, emergency liquidity operations, and the launch of quantitative easing (QE).
Description:
This indicator plots the spread between the Effective Federal Funds Rate (FEDFUNDS) and the 3-Month US Treasury Bill yield (US03MY), used here as a proxy for the SOFR spread.
It serves as a simple yet powerful tool to detect liquidity dislocations and stress signals in the US short-term funding markets.
Interpretation:
🔴 Spread > 0.20% → Possible liquidity stress: elevated repo rates, cash shortage, interbank distrust.
🟡 Spread ≈ 0% → Normal market conditions, balanced liquidity.
🟢 Spread < 0% → Excess liquidity: strong demand for T-Bills, “flight to safety”, or distortion due to expansionary monetary policy.
Ideal for:
Monitoring Fed policy impact
Anticipating market-wide liquidity squeezes
Correlation with DXY, SPX, VIX, MOVE Index, and risk sentiment
🧠 Note: As SOFR is not directly available on TradingView, FEDFUNDS is used as a reliable proxy, closely tracking the same trends in most macro conditions.
In 2008, the spread exhibits a sharp vertical spike, signaling a severe liquidity dislocation: investors rushed into short-term U.S. Treasuries, pushing their yields down dramatically, while the FEDFUNDS rate remained relatively high.
This behavior indicates extreme systemic stress in the interbank lending market, preceding massive Federal Reserve interventions such as rate cuts, emergency liquidity operations, and the launch of quantitative easing (QE).
Description:
This indicator plots the spread between the Effective Federal Funds Rate (FEDFUNDS) and the 3-Month US Treasury Bill yield (US03MY), used here as a proxy for the SOFR spread.
It serves as a simple yet powerful tool to detect liquidity dislocations and stress signals in the US short-term funding markets.
Interpretation:
🔴 Spread > 0.20% → Possible liquidity stress: elevated repo rates, cash shortage, interbank distrust.
🟡 Spread ≈ 0% → Normal market conditions, balanced liquidity.
🟢 Spread < 0% → Excess liquidity: strong demand for T-Bills, “flight to safety”, or distortion due to expansionary monetary policy.
Ideal for:
Monitoring Fed policy impact
Anticipating market-wide liquidity squeezes
Correlation with DXY, SPX, VIX, MOVE Index, and risk sentiment
🧠 Note: As SOFR is not directly available on TradingView, FEDFUNDS is used as a reliable proxy, closely tracking the same trends in most macro conditions.
Информация о релизе
📊 SOFR Spread (Proxy: FEDFUNDS - US03MY) – Monitoring USD Money Market LiquidityIn 2008, the spread exhibits a sharp vertical spike, signaling a severe liquidity dislocation: investors rushed into short-term U.S. Treasuries, pushing their yields down dramatically, while the FEDFUNDS rate remained relatively high.
This behavior indicates extreme systemic stress in the interbank lending market, preceding massive Federal Reserve interventions such as rate cuts, emergency liquidity operations, and the launch of quantitative easing (QE).
Description:
This indicator plots the spread between the Effective Federal Funds Rate (FEDFUNDS) and the 3-Month US Treasury Bill yield (US03MY), used here as a proxy for the SOFR spread.
It serves as a simple yet powerful tool to detect liquidity dislocations and stress signals in the US short-term funding markets.
Interpretation:
🔴 Spread > 0.20% → Possible liquidity stress: elevated repo rates, cash shortage, interbank distrust.
🟡 Spread ≈ 0% → Normal market conditions, balanced liquidity.
🟢 Spread < 0% → Excess liquidity: strong demand for T-Bills, “flight to safety”, or distortion due to expansionary monetary policy.
Ideal for:
Monitoring Fed policy impact
Anticipating market-wide liquidity squeezes
Correlation with DXY, SPX, VIX, MOVE Index, and risk sentiment
🧠 Note: As SOFR is not directly available on TradingView, FEDFUNDS is used as a reliable proxy, closely tracking the same trends in most macro conditions.
Информация о релизе
📊 SOFR Spread (Proxy: FEDFUNDS - US03MY) – Monitoring USD Money Market LiquidityIn 2008, the spread exhibits a sharp vertical spike, signaling a severe liquidity dislocation: investors rushed into short-term U.S. Treasuries, pushing their yields down dramatically, while the FEDFUNDS rate remained relatively high.
This behavior indicates extreme systemic stress in the interbank lending market, preceding massive Federal Reserve interventions such as rate cuts, emergency liquidity operations, and the launch of quantitative easing (QE).
Description:
This indicator plots the spread between the Effective Federal Funds Rate (FEDFUNDS) and the 3-Month US Treasury Bill yield (US03MY), used here as a proxy for the SOFR spread.
It serves as a simple yet powerful tool to detect liquidity dislocations and stress signals in the US short-term funding markets.
Interpretation:
🔴 Spread > 0.20% → Possible liquidity stress: elevated repo rates, cash shortage, interbank distrust.
🟡 Spread ≈ 0% → Normal market conditions, balanced liquidity.
🟢 Spread < 0% → Excess liquidity: strong demand for T-Bills, “flight to safety”, or distortion due to expansionary monetary policy.
Ideal for:
Monitoring Fed policy impact
Anticipating market-wide liquidity squeezes
Correlation with DXY, SPX, VIX, MOVE Index, and risk sentiment
🧠 Note: As SOFR is not directly available on TradingView, FEDFUNDS is used as a reliable proxy, closely tracking the same trends in most macro conditions.
Информация о релизе
✅ What’s new & improvementsCorrect tickers + flexible inputs
Uses TV-ready tickers with prefixes (FRED:FEDFUNDS, FRED:DGS3MO) and exposes them via input.symbol() so users can swap sources (e.g., TVC:US03MY) from the settings panel.
Selectable request timeframe
Added input.timeframe("D") and feed it to request.security() so data can be requested at the preferred TF while viewing on any chart TF.
Syntax-error fix (“new line”)
Removed raw, non-Pine text from the source and moved explanations into comments. Pine accepts only code or comments—this eliminates the newline parsing error.
hline() usage aligned with the function signature
hline(0.0, "Zero", color=color.gray, linestyle=hline.style_dotted) with constant parameters (not series) and a dotted style for clarity.
Visual threshold + ready-made alerts
Added a stress threshold input (default 0.20 pp), conditional background coloring (red above threshold, green below zero), and two alertcondition() rules (“Liquidity stress”, “Excess liquidity”).
Housekeeping
Consistent naming (shorttitle, precision=2), minimal structure, and tidy plotting for a cleaner, more robust script.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.