返回题库

固收 Repo Rate Financing

Fi Repo Rate Financing

专题
Algorithmic Programming / 算法编程
难度
L2
来源
MyntBit

题目详情

某投行债券交易员持有大量 10 年期美国国债头寸。为融资此头寸,交易员进入回购协议(repo):将债券卖给对手方并承诺以更高价格回购。

任务:计算融资成本。若回购价格超出卖出价格的差额代表融资利率。例如卖出价 100,回购价 100.05 → 年化融资成本 = 0.05/100 × 365/7 ≈ 2.6%(假设 7 天 repo)。分析 repo 利率对持有策略盈亏的影响。

英文原题

A bond trader at a major investment bank holds a large position in 10-year US Treasury bonds. To finance this position, the trader enters into a repurchase agreement (repo) where they sell the bonds to another party with an agreement to buy them back at a later date at a slightly higher price.
What is the primary economic purpose of this repo transaction from the perspective of the bond trader?

解析

问题分析

A bond trader at a major investment bank holds a large position in 10-year US Treasury bonds. To finance this position, the trader enters into a repurchase agreement (repo) where they sell the bonds to another party with an agreement to buy them back at a later date at a slightly higher price.
What

解法

根据题目要求实现相应功能。核心逻辑需要:

// 核心数据结构和方法——根据题目 API 约定实现
// 1. 确定状态表示——选择支持所需操作的数据结构
// 2. 实现核心算法——确保 O(·) 时间复杂度和正确性
// 3. 处理边界条件——空输入、极值参数、并发访问

验证

用具体输入验证:构造已知输入的测试用例,确认输出匹配预期结果。

复杂度与边界

  • 时间复杂度:取决于选用的算法
  • 空间复杂度:取决于数据规模
  • 关键边界条件:空输入、极值参数、并发场景下的正确性保证

英文解析

Analysis

A repurchase agreement (repo) is a collateralized short-term financing transaction. The bond trader sells bonds to a counterparty and agrees to repurchase them at a predetermined higher price on a specified future date. The price difference represents the financing cost (repo rate).

From the trader's perspective, the repo's primary economic purpose is to obtain secured financing for the bond position. Rather than using unsecured borrowing (more expensive alternative), the trader uses the bonds themselves as collateral to borrow cash at a lower repo rate.

Solution

def repo_rate(spot_price, forward_price, days):
    """Compute implied repo rate from spot and forward prices."""
    return (forward_price / spot_price - 1) * (365 / days)

def repo_financing_cost(principal, repo_rate, days):
    """Cost of financing via repo."""
    return principal * repo_rate * (days / 365)

def carry_trade_pnl(bond_yield, repo_rate, principal, days, price_change=0):
    """PnL of holding a bond financed via repo."""
    funding_cost = repo_financing_cost(principal, repo_rate, days)
    coupon_income = principal * bond_yield * (days / 365)
    return coupon_income - funding_cost + price_change

Example: trader holds $100M of 10Y Treasuries at 4.5% yield, financed via overnight repo at 4.0%:

  • Daily carry = 100M * (4.5% - 4.0%) / 365 = $13,699/day
  • 30-day carry = 100M * 0.5% * 30/365 approx $411K

Complexity & Edge Cases

  • Time complexity: O(1) for simple repo calculations
  • Space complexity: O(1)
  • Edge cases: (1) Haircut: the lender requires collateral value > loan amount (e.g., 2% haircut means 102Mbondsfor102M bonds for100M cash). (2) Failed repo: if the borrower cannot return cash at maturity, the lender keeps the collateral. (3) Term repo vs. overnight: term repos have fixed rates but carry rollover risk; overnight repos have variable rates. (4) Special collateral: certain bonds trade at below-general repo rates ("on special") because they are in high demand.

Verification

$100M bonds, spot price = 100, forward price (30 days) = 100.33:

  • Repo rate = (100.33/100 - 1) * 365/30 = 0.33% * 12.167 approx 4.0%
  • Financing cost = 100M * 4.0% * 30/365 approx $328.8K
  • Bond coupon income (4.5%) = 100M * 4.5% * 30/365 approx $369.9K
  • Net carry = 369.9K369.9K -328.8K approx $41.1K

Key Considerations

  • Repo rates are benchmarked against OIS/SOFR -- general collateral repo approx SOFR, special collateral repo < SOFR
  • Haircut protects the lender against collateral value decline; larger haircut = safer but more expensive for borrower
  • Reverse repo (lending cash, taking collateral) is the opposite position -- used by cash-rich entities
  • Tri-party repo uses a third-party agent for collateral management, reducing operational risk