{"slug":"gld-implied-volatility","qid":"iv_percentiles","label":"iv_percentiles","post_title":"gld-implied-volatility","post_url":"/blog/gld-implied-volatility#q-iv_percentiles","columns":["percentile","gld_iv_pct","spy_iv_pct"],"rows":[{"percentile":"5th","gld_iv_pct":11.86,"spy_iv_pct":11.96},{"percentile":"25th","gld_iv_pct":14.35,"spy_iv_pct":13.48},{"percentile":"50th","gld_iv_pct":15.83,"spy_iv_pct":15.6},{"percentile":"75th","gld_iv_pct":18.38,"spy_iv_pct":19.28},{"percentile":"95th","gld_iv_pct":26.86,"spy_iv_pct":26.43}],"shape":"ranking","sql":"WITH\n    daily AS\n    (\n        SELECT\n            underlying_symbol                        AS sym,\n            date                                     AS d,\n            avg(toFloat64(implied_volatility)) * 100 AS atm_iv\n        FROM global_markets.options_greeks\n        WHERE underlying_symbol IN ('GLD', 'SPY')\n          AND date >= '2021-09-01'\n          AND date <  '2026-09-01'\n          AND iv_converged = 1\n          AND volume > 0\n          AND days_to_expiry BETWEEN 20 AND 45\n          AND abs(toFloat64(strike_price) / toFloat64(underlying_close) - 1) < 0.05\n        GROUP BY sym, d\n    ),\n    curves AS\n    (\n        SELECT\n            sym,\n            quantilesDeterministic(0.05, 0.25, 0.5, 0.75, 0.95)(atm_iv, toUInt64(d)) AS qs\n        FROM daily\n        GROUP BY sym\n    )\nSELECT\n    ['5th', '25th', '50th', '75th', '95th'][idx] AS percentile,\n    round(anyIf(qs, sym = 'GLD')[idx], 2)        AS gld_iv_pct,\n    round(anyIf(qs, sym = 'SPY')[idx], 2)        AS spy_iv_pct\nFROM curves\nARRAY JOIN [1, 2, 3, 4, 5] AS idx\nGROUP BY idx\nORDER BY idx","computed_at":"2026-09-23T14:47:14.909242+00:00","elapsed":0.003416339}