固收 Swap Rate Par Rate
Fi Swap Rate Par Rate
题目详情
在普通利率互换中,交易对手同意基于名义本金交换固定利率和浮动利率支付。此互换中的固定利率通常如何称呼?如何确定其值?
任务:固定利率称为互换利率(swap rate)或票面利率(par rate)。票面利率使互换初始价值为零——即固定端现值等于浮动端现值。计算方法:票面利率 = (1 - Z_n) / ∑(i=1 to n) Z_i,其中 Z_i 是第 i 期的零息贴现因子。
英文原题
In a plain vanilla interest rate swap, counterparties agree to exchange fixed-rate interest payments for floating-rate interest payments, or vice-versa, based on a notional principal. What is the fixed rate in this swap typically called, and how is its value determined at the initiation of the swap?
解析
问题分析
In a plain vanilla interest rate swap, counterparties agree to exchange fixed-rate interest payments for floating-rate interest payments, or vice-versa, based on a notional principal. What is the fixed rate in this swap typically called, and how is its value determined at the initiation of the swap?
解法
根据题目要求实现相应功能。核心逻辑需要:
// 核心数据结构和方法——根据题目 API 约定实现
// 1. 确定状态表示——选择支持所需操作的数据结构
// 2. 实现核心算法——确保 O(·) 时间复杂度和正确性
// 3. 处理边界条件——空输入、极值参数、并发访问验证
用具体输入验证:构造已知输入的测试用例,确认输出匹配预期结果。
复杂度与边界
- 时间复杂度:取决于选用的算法
- 空间复杂度:取决于数据规模
- 关键边界条件:空输入、极值参数、并发场景下的正确性保证
英文解析
Analysis
In a plain vanilla interest rate swap, the fixed rate is called the par swap rate (or simply the swap rate). At swap initiation, this rate is set such that the swap has zero present value to both parties -- the PV of fixed leg payments equals the PV of floating leg payments.
The par swap rate is determined by the current yield curve: it equals the rate that makes the fixed leg's discounted value equal to the floating leg's discounted value. The floating leg PV can be computed using forward rates derived from the yield curve, or equivalently, using the par bond identity.
Solution
Par swap rate formula: S = (1 - DF_n) / sum(DF_i)
where DF_i is the discount factor for period i, and DF_n is the discount factor for the final maturity.
def par_swap_rate(discount_factors):
"""Compute par swap rate from discount factors."""
num = 1 - discount_factors[-1]
den = sum(discount_factors)
return num / den
def discount_factor_from_rate(rate, tenor):
"""Simple discount factor: DF = 1/(1+r*t) for money market."""
return 1 / (1 + rate * tenor)
# Example: 5-year swap with annual periods
# If spot rates produce DFs = [0.95, 0.90, 0.85, 0.80, 0.75]
# S = (1 - 0.75) / (0.95+0.90+0.85+0.80+0.75) = 0.25 / 4.25 = 5.88%Intuition: the par swap rate is the coupon rate on a hypothetical par bond priced using the current discount curve. At inception, no party has an advantage -- the swap is "at market."
Complexity & Edge Cases
- Time complexity: O(N) for computing discount factor sum and final DF
- Space complexity: O(N) for discount factor array
- Edge cases: (1) Negative rates: discount factors > 1, par rate can be negative. (2) Non-standard day counts (ACT/360 vs. 30/360) affect period lengths and DFs. (3) Amortizing swaps have changing notional -- formula requires PV-weighted notional schedule. (4) Forward-starting swaps require discounting from forward start date.
Verification
Given 5-year swap with spot rates: 1Y=4%, 2Y=4.5%, 3Y=5%, 4Y=5.5%, 5Y=6% (annual compounding):
- DFs: 0.9615, 0.9126, 0.8638, 0.8156, 0.7679
- S = (1 - 0.7679) / (0.9615+0.9126+0.8638+0.8156+0.7679) = 0.2321 / 4.3214 = 5.37%
Key Considerations
- Par swap rates construct the swap curve — the primary benchmark for interest rate markets
- Swap rates are more liquid than government bond yields for many currencies -- they serve as the reference curve for discounting
- The swap rate changes continuously with market conditions; existing swaps gain/lose value as the rate moves
- OIS discounting vs. LIBOR discounting: post-crisis, swaps are discounted at OIS (risk-free) rather than LIBOR (credit-adjusted)