Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
joellewis avatar

Fixed Income Corporate

  • 395 installs
  • 161 repo stars
  • Updated July 18, 2026
  • joellewis/finance_skills

fixed-income-corporate is a finance_skills agent skill that models corporate bond credit spreads, default probabilities, callable bond yields, and covenant analysis for developers integrating fixed-income analytics into

About

fixed-income-corporate is a wealth-management skill from joellewis/finance_skills with fixed_income_corporate.py (numpy, scipy, --verify) for corporate bond credit analysis. It covers G-spread, Z-spread, and OAS spread measures, investment-grade versus high-yield rating boundaries at BBB/BB, migration matrices, expected loss EL = PD × LGD × EAD, recovery rates by seniority, callable bond yield-to-worst, maintenance versus incurrence covenants, private credit illiquidity premiums of 150-400bp, and CDS-implied default probabilities. Worked examples compare 130bp G-spread to 118bp Z-spread and compute $12,000 expected annual loss. Developers reach for fixed-income-corporate when building bond pricing engines, credit risk dashboards, or portfolio analytics with corporate debt exposure.

  • Bond identifier mapping
  • Coupon and amortization schedules
  • Callable andputable features
  • Spread and yield conventions
  • Vendor pricing fallbacks

Fixed Income Corporate by the numbers

  • 395 all-time installs (skills.sh)
  • +17 installs in the week ending Aug 2, 2026 (Skillselion tracking)
  • Ranked #265 of 1,106 Finance & Trading skills by installs in the Skillselion catalog
  • Data as of Aug 2, 2026 (Skillselion catalog sync)
npx skills add https://github.com/joellewis/finance_skills --skill fixed-income-corporate

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs395
repo stars161
Last updatedJuly 18, 2026
Repositoryjoellewis/finance_skills

How do you calculate corporate bond credit spreads?

Model, price, and integrate corporate bond positions—including coupons, call schedules, ratings, and liquidity—into portfolios, risk systems, and client analytics.

Who is it for?

Fixed-income and fintech developers building corporate bond pricing, credit spread analytics, or expected loss models in portfolio and risk management systems.

Skip if: Developers modeling sovereign Treasury curves or municipal bond tax equivalency, which have separate fixed-income-sovereign and fixed-income-municipal skills.

When should I use this skill?

User asks about corporate bonds, credit spreads OAS/Z-spread, yield-to-worst, default probability, or covenant analysis for corporate debt.

What you get

G-spread, Z-spread, OAS, yield-to-worst, expected loss estimates, and covenant analysis for corporate bond positions.

  • Credit spread calculations
  • Expected loss estimates
  • Callable bond yield analysis

By the numbers

  • Includes fixed_income_corporate.py with numpy/scipy and --verify mode
  • Documents recovery rates: senior secured 60-65%, senior unsecured 40-50%, subordinated 20-30%
  • Part of finance_skills repository with 81 skills across 7 domain plugins

Files

SKILL.mdMarkdownGitHub ↗

Fixed Income — Corporate

Core Concepts

Credit Spreads

Compensation for default risk, liquidity risk, and downgrade risk above the risk-free rate. Multiple spread measures exist with increasing precision:

G-spread (Government Spread): Bond yield minus interpolated Treasury yield of the same maturity. Simple but assumes a flat term structure between benchmark maturities.

Z-spread (Zero-Volatility Spread): The constant spread added to each point on the risk-free spot rate curve such that the sum of discounted cash flows equals the bond's market price. Superior to G-spread because it accounts for the full shape of the term structure.

OAS (Option-Adjusted Spread): For bonds with embedded options, OAS = Z-spread minus the value of the embedded option. OAS represents the "true" credit compensation after removing the option component. Requires an interest rate model to compute.

Credit Ratings

AAA/AA/A/BBB are investment grade. BB/B/CCC/CC/C/D are high yield (speculative grade). The BBB/BB boundary is the most consequential threshold — many institutional mandates prohibit sub-investment-grade holdings. A downgrade across this boundary ("fallen angel") forces selling by constrained investors.

Migration Matrix

A transition matrix shows the probability of moving from one rating to another over a 1-year horizon. A BBB-rated issuer has roughly 85-90% probability of remaining BBB, 4-5% chance of upgrade, 4-5% chance of downgrade, and a small probability (~0.2%) of default. Migration matrices are published annually by rating agencies.

Default Probability, Loss Given Default, and Recovery Rate

  • PD = Probability of Default over a given horizon
  • LGD = Loss Given Default (percentage of exposure lost)
  • Recovery Rate (RR) = 1 - LGD
  • Expected Loss: EL = PD × LGD × EAD (Exposure at Default)

Recovery rates vary by seniority: senior secured (60-65%), senior unsecured (40-50%), subordinated (20-30%).

Callable Bonds

The issuer can redeem the bond early. Call schedules specify prices and dates. Yield-to-call (YTC) is calculated using the call date and call price. Yield-to-worst (YTW) is the minimum of YTM and all possible YTCs. For callable bonds, OAS is the appropriate spread measure (not G-spread or Z-spread).

Covenants

Maintenance covenants: Tested periodically (e.g., quarterly). Issuer must maintain financial ratios at all times. Common in bank loans.

Incurrence covenants: Tested only when the issuer takes a specific action (e.g., issues new debt). Common in bond indentures. Key covenants include leverage ratio (Debt/EBITDA), interest coverage (EBITDA/Interest), and restricted payments.

Private Credit

Direct lending by non-bank lenders to middle-market companies. Offers an illiquidity premium of 150-400bp over comparable syndicated loans. Typically features stronger covenant protection than public market deals. Valuations are mark-based (quarterly), which smooths reported volatility.

CDS (Credit Default Swaps)

A derivative where the protection buyer pays a periodic spread and receives payment upon a credit event. CDS spreads can be used to derive market-implied default probabilities. CDS spreads are often more responsive to credit deterioration than bond spreads.

Key Formulas

FormulaExpressionUse Case
G-spreadBond Yield - Interpolated Treasury YieldSimple spread measure
Z-spreadConstant spread s: P = sum CF_t / (1+s_t+s)^tFull curve spread
OASZ-spread - Option CostSpread for callable bonds
Expected LossEL = PD × LGD × EADCredit loss estimation
Recovery RateRR = 1 - LGDRecovery from default
Yield-to-Worstmin(YTM, YTC_1, YTC_2, ...)Conservative yield measure

Worked Examples

Example 1: Compare Z-spread vs G-spread

Given: A 7-year corporate bond yields 5.8%. The 7-year interpolated Treasury yield is 4.5%. The Z-spread (computed using the full spot curve) is 118bp. Calculate: G-spread and compare to Z-spread Solution: G-spread = 5.8% - 4.5% = 1.30% = 130bp Z-spread = 118bp The G-spread (130bp) exceeds the Z-spread (118bp) by 12bp. This difference arises because the G-spread uses a single interpolated benchmark point while the Z-spread properly accounts for the shape of the entire yield curve. In a steep curve environment, G-spread tends to overstate the true spread.

Example 2: Expected Loss Calculation

Given: PD = 2% (annual), LGD = 60%, EAD = $1,000,000 Calculate: Expected annual loss Solution: EL = PD × LGD × EAD EL = 0.02 × 0.60 × $1,000,000 EL = $12,000

The expected annual credit loss is $12,000, or 1.2% of the exposure. This represents the actuarial cost of credit risk — the spread must at least cover this expected loss, with additional compensation for unexpected losses and risk aversion.

Common Pitfalls

  • Using G-spread for callable bonds — use OAS instead, which removes the option component
  • Ignoring liquidity premium in spread analysis — part of the spread compensates for illiquidity, not just default risk
  • Rating agency lag vs market-implied credit quality — CDS spreads often move before rating actions
  • Assuming recovery rates are constant — they vary significantly by seniority and economic cycle (lower in recessions)

Cross-References

  • fixed-income-sovereign: the Treasury curve used as the risk-free benchmark
  • fixed-income-structured: CLOs and structured credit products
  • alternatives: private credit as an alternative investment
  • asset-allocation: credit allocation in multi-asset portfolios

Running the Script

uv run scripts/fixed_income_corporate.py            # run the demo (uses PEP 723 inline deps)
uv run scripts/fixed_income_corporate.py --verify   # check demo outputs against the worked examples (exit 1 on mismatch)
python3 scripts/fixed_income_corporate.py            # alternative (requires: pip install numpy scipy)

The demo prints the calculations covered above; its values match the worked examples in this skill. Run --help for a list of the classes and functions. For programmatic use, import the module rather than running it — the demo only executes under python fixed_income_corporate.py.

Related skills

How it compares

Pick fixed-income-corporate over fixed-income-sovereign when modeling credit spreads, default risk, and covenant structures rather than Treasury benchmark curves.

FAQ

What spread measures does fixed-income-corporate cover?

fixed-income-corporate covers G-spread (yield minus Treasury), Z-spread (constant spread over spot curve), and OAS (option-adjusted spread for callable bonds). OAS is required for bonds with embedded call options.

Does fixed-income-corporate include a Python calculation script?

fixed-income-corporate bundles fixed_income_corporate.py requiring numpy and scipy, with a --verify flag checking demo outputs against worked G-spread and expected loss examples.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.