STRASMORE/EXPLORE 2,173 QUERIES 22Y EQUITIES · 12Y OPTIONS

2,173 answered market questions

every one with its exact SQL, its result and the date it was computed · free, no signup

Risk-free rate in the Sharpe ratio
Annualized risk premium: subtract monthly, or annualize each leg firstranking · 2026-08-14 · 5×4Preview: 5 ranked values, largest first. Three-month Treasury bill yield by calendar yearranking · 2026-08-14 · 22×4Preview: 16 ranked values, largest first. Monthly return, monthly risk-free rate and the excess, 2020 to 2024series · 2026-08-14 · 60×4Preview: a 16-point series, roughly flat. Sharpe ratio on a matched rate series against one fixed rateranking · 2026-08-14 · 5×4Preview: 5 ranked values, largest first.
Annualized risk premium: subtract monthly, or annualize each leg first

Annualized risk premium: subtract monthly, or annualize each leg first

most recentas of ranking 5×4read in context →
Annualized risk premium: subtract monthly, or annualize each leg first — 5 rows by 4 columns, computed from US exchange, SIP and OPRA data.
horizonexcess_first_pctannualize_first_pctgap_pct
1-year17.3118.130.814
3-year3.013.090.088
5-year9.9410.170.233
10-year9.089.230.151
20-year6.496.590.099
the exact SQL behind every number
WITH
    monthly_px AS
    (
        SELECT
            toStartOfMonth(date)           AS m,
            argMax(toFloat64(close), date) AS month_close
        FROM global_markets.stocks_daily_aggs
        WHERE ticker = 'SPY'
          AND date >= '2004-12-01'
          AND date <  '2025-01-01'
        GROUP BY m
    ),
    prior_px AS
    (
        SELECT
            addMonths(m, 1) AS m,
            month_close     AS prev_close
        FROM monthly_px
    ),
    monthly_rf AS
    (
        SELECT
            toStartOfMonth(date)                                       AS m,
            pow(1 + avg(toFloat64(yield_3_month)) / 100, 1.0 / 12) - 1 AS rf_month
        FROM global_markets.treasury_yields
        WHERE date >= '2004-12-01'
          AND date <  '2025-01-01'
          AND yield_3_month IS NOT NULL
        GROUP BY m
    ),
    excess AS
    (
        SELECT
            cur.m                                             AS m,
            cur.month_close / prv.prev_close - 1              AS ret,
            rf.rf_month                                       AS rf_month,
            cur.month_close / prv.prev_close - 1 - rf.rf_month AS exc
        FROM monthly_px AS cur
        INNER JOIN prior_px AS prv ON prv.m = cur.m
        INNER JOIN monthly_rf AS rf ON rf.m = cur.m
    )
SELECT
    concat(toString(intDiv(count(), 12)), '-year')            AS horizon,
    round(100 * (exp(12 * avg(log(1 + exc))) - 1), 2)         AS excess_first_pct,
    round(100 * ((exp(12 * avg(log(1 + ret))) - 1)
               - (exp(12 * avg(log(1 + rf_month))) - 1)), 2)  AS annualize_first_pct,
    round(100 * ((exp(12 * avg(log(1 + ret))) - 1)
               - (exp(12 * avg(log(1 + rf_month))) - 1)
               - (exp(12 * avg(log(1 + exc))) - 1)), 3)       AS gap_pct
FROM excess
CROSS JOIN (SELECT arrayJoin([1, 3, 5, 10, 20]) AS years) AS hz
WHERE m >= subtractYears(toDate('2025-01-01'), years)
GROUP BY years
ORDER BY years
$