AT1 vs Credits Historical OAS per Rating¶
Ā© 2025 Marek Ozana
This notebook shows how to use polars-bloomberg to pull BQL history and compare option-adjusted spreads (OAS) between AT1 (CoCo) bonds and other (non-subordinated) credit, bucketed by rating. The BQL query is constructed to pull historical OAS by date, rating, and credit type (CoCo vs Credit). By controlling for credit risk via rating, we can isolate the āAT1 premiumā and show that CoCo investors have historically earned additional spread even after adjusting for credit quality.
We:
Pull historical OAS for AT1 (CoCo) and senior credit across rating buckets
Chart the spread gap through time to highlight the persistent CoCo premium after rating adjustment
Out[1]:
InĀ [2]:
Copied!
# Get historical median OAS spreads for IG, HY and AT1 bonds
from polars_bloomberg import BQuery
query = """
let(
#rng = range(2014-12-31, today(), frq='CM');
#sprd = spread(dates=#rng, fill=PREV, spread_type='OAS');
#is_coco = capital_contingent_security();
#month = MONTH(#sprd().DATE);
#year = YEAR(#sprd().DATE);
#oas = median(group(#sprd(), by=[bb_composite, #is_coco, #month, #year]));
)
get(#oas)
for(
filter(
members(['I31095 Index', 'LP01STAT Index', 'LP05STAT Index']),
bb_composite() in ['BBB', 'BBB-', 'BB+', 'BB']
)
)
preferences(dropCols=['ORIG_IDS'])
"""
with BQuery() as bq:
df = bq.bql(query).combine()
df.tail(3)
# Get historical median OAS spreads for IG, HY and AT1 bonds
from polars_bloomberg import BQuery
query = """
let(
#rng = range(2014-12-31, today(), frq='CM');
#sprd = spread(dates=#rng, fill=PREV, spread_type='OAS');
#is_coco = capital_contingent_security();
#month = MONTH(#sprd().DATE);
#year = YEAR(#sprd().DATE);
#oas = median(group(#sprd(), by=[bb_composite, #is_coco, #month, #year]));
)
get(#oas)
for(
filter(
members(['I31095 Index', 'LP01STAT Index', 'LP05STAT Index']),
bb_composite() in ['BBB', 'BBB-', 'BB+', 'BB']
)
)
preferences(dropCols=['ORIG_IDS'])
"""
with BQuery() as bq:
df = bq.bql(query).combine()
df.tail(3)
Out[2]:
shape: (3, 7)
| ID | #oas | DATE | BB_COMPOSITE | #IS_COCO | #MONTH | #YEAR |
|---|---|---|---|---|---|---|
| str | f64 | date | str | bool | i64 | i64 |
| "BBB:true:9.0:2023.0" | 437.833167 | 2023-09-30 | "BBB" | true | 9 | 2023 |
| "BBB:true:9.0:2024.0" | 303.500856 | 2024-09-30 | "BBB" | true | 9 | 2024 |
| "BBB:true:9.0:2025.0" | 246.992669 | 2025-09-30 | "BBB" | true | 9 | 2025 |