固收 Cds Basics
Fi Cds Basics
题目详情
信用交易员评估某公司债券的信用违约互换(CDS)。保护买方支付定期保费给保护卖方。保护卖方在何种情况下向保护买方赔付?
任务:CDS 赔付触发条件:信用事件发生——包括破产、债务重组、债务违约或支付失败。当参考实体发生信用事件时,保护卖方按面值赔付(实物交割)或按面值减回收值赔付(现金交割)。CDS 类似保险但不需要持有底层债券。
英文原题
You are a credit trader evaluating a Credit Default Swap (CDS) on a corporate bond. The protection buyer pays a periodic premium to the protection seller. Under what circumstances does the protection seller make a payout to the protection buyer?
解析
问题分析
You are a credit trader evaluating a Credit Default Swap (CDS) on a corporate bond. The protection buyer pays a periodic premium to the protection seller. Under what circumstances does the protection seller make a payout to the protection buyer?
解法
根据题目要求实现相应功能。核心逻辑需要:
// 核心数据结构和方法——根据题目 API 约定实现
// 1. 确定状态表示——选择支持所需操作的数据结构
// 2. 实现核心算法——确保 O(·) 时间复杂度和正确性
// 3. 处理边界条件——空输入、极值参数、并发访问验证
用具体输入验证:构造已知输入的测试用例,确认输出匹配预期结果。
复杂度与边界
- 时间复杂度:取决于选用的算法
- 空间复杂度:取决于数据规模
- 关键边界条件:空输入、极值参数、并发场景下的正确性保证
英文解析
Analysis
A Credit Default Swap (CDS) is a derivative contract where the protection buyer pays a periodic premium (spread) to the protection seller. The protection seller makes a payout to the buyer only when a defined credit event occurs on the reference entity (the corporate bond issuer).
Credit events typically include: bankruptcy, failure to pay, restructuring, repudiation/moratorium, and obligation acceleration. When a credit event triggers the CDS, the protection seller compensates the buyer either through physical settlement (buyer delivers the bond, receives par) or cash settlement (seller pays par minus recovery value).
Solution
def cds_premium_pv(spread, notional, maturity, discount_rates, times, survival_probs):
"""PV of premium leg: sum of spread * notional * survival * discount."""
pv = 0
for i, t in enumerate(times):
pv += spread * notional * survival_probs[i] / (1 + discount_rates[i])**t
return pv
def cds_protection_pv(notional, maturity, discount_rates, times, survival_probs, recovery_rate):
"""PV of protection leg: expected payout upon default."""
pv = 0
for i, t in enumerate(times):
default_prob = survival_probs[i-1] - survival_probs[i] if i > 0 else 1 - survival_probs[0]
payout = notional * (1 - recovery_rate)
pv += payout * default_prob / (1 + discount_rates[i])**t
return pv
def cds_par_spread(notional, maturity, discount_rates, times, survival_probs, recovery_rate):
"""Par CDS spread where premium PV = protection PV."""
prot_pv = cds_protection_pv(notional, maturity, discount_rates, times, survival_probs, recovery_rate)
risky_annuity = sum(survival_probs[i] / (1 + discount_rates[i])**t
for i, t in enumerate(times))
return prot_pv / (risky_annuity * notional)Complexity & Edge Cases
- Time complexity: O(N) per leg, N = number of premium payment periods
- Space complexity: O(N) for arrays
- Edge cases: (1) No credit event -- protection seller earns all premiums with zero payout. (2) Immediate default -- maximum payout = notional * (1 - recovery rate). (3) Restructuring vs. hard default: different CDS protocols (ISDA 2003 vs. 2014) specify credit events differently. (4) Basis risk: CDS on one bond may not perfectly hedge a different bond of same issuer.
Verification
5-year CDS, notional = $10M, recovery rate = 40%, survival curve derived from hazard rate h = 2%/year:
- Year 1 survival: exp(-0.02) = 0.9802, default prob = 0.0198
- Year 2: survival = 0.9608, default prob = 0.0194
- Protection leg PV approx 10M * 0.6 * sum of default probs discounted
- Premium leg PV approx spread * 10M * sum of survival probs * discount
- Par spread: where premium PV = protection PV
Key Considerations
- CDS spread reflects the market-implied hazard rate -- wider spread = higher default probability
- Recovery rate assumption (typically 40% for senior unsecured) significantly affects CDS pricing
- CDS-bond basis: CDS spread vs. bond Z-spread can diverge due to liquidity, counterparty risk, and structural factors
- Counterparty risk: if the protection seller defaults, the buyer loses protection -- collateral reduces this risk