Skip to content

Value only the coupons the buyer is owed in Bond.asset_swap_spread - #492

Open
QuantIntellect wants to merge 1 commit into
FinancePy-Org:masterfrom
QuantIntellect:fix/asset-swap-owed-coupons
Open

QuantIntellect wants to merge 1 commit into
FinancePy-Org:masterfrom
QuantIntellect:fix/asset-swap-owed-coupons

Conversation

@QuantIntellect

Copy link
Copy Markdown
Contributor

asset_swap_spread values the bond on the Ibor curve with every coupon paid after settlement. The bond price it compares with uses the accrued interest, which leaves out coupons the buyer doesn't get:

  • When the bond settles ex-dividend, the accrued interest is negative because the buyer doesn't get the next coupon.
  • When it settles on or after a coupon date whose payment rolls to a later business day, that coupon belongs to the seller and accrual has restarted.

In both cases the spread still includes the coupon, so it jumps by about the coupon divided by the PV01 of the floating leg.

Example: a 4% bond like a gilt, whose coupons go ex-dividend 7 UK business days before the coupon date. The 7 Sep 2026 coupon goes ex on 26 Aug. The 7 Mar 2026 coupon date is a Saturday, so that coupon is paid on Monday 9 Mar. The clean price is 100 and the curve is flat at 4%, anchored at settlement:

settlement master this PR
26 Aug 2026 -3.836 bp -3.836 bp
27 Aug 2026, ex-dividend 22.022 bp -3.801 bp
Saturday 7 Mar 2026, coupon date 22.077 bp -4.266 bp
Monday 9 Mar 2026, payment date -4.263 bp -4.263 bp

The rolled coupon only affects settlement on the coupon date or later days before the payment date, which are not business days. A bond without ex-dividend days gives the same values on those dates.

Change

asset_swap_spread now values the bond with the flows of dirty_price_from_discount_curve: the coupons the buyer is owed (_is_owed), without the next one when the bond settles ex-dividend. The PV01 of the floating leg is unchanged.

Tests

test_asset_swap_spread_is_zero_at_the_curve_price prices the bond above off a flat curve with dirty_price_from_discount_curve and checks that the spread on that curve is zero. It runs on five dates:

  • the last day before the ex-dividend date
  • two days in the ex-dividend window
  • the 7 Sep 2026 coupon date
  • the Saturday 7 Mar 2026 coupon date

On master, the two ex-dividend dates and the Saturday give about 26 bp instead of 0.

With the change, the unit tests pass (2,085). The bond regression tests give the same warning and error counts as master. That includes the four errors in regression_test_bond_option_bk_model, which master also has.

asset_swap_spread valued the bond on the Ibor curve with every coupon
paid after settlement. The bond price it compares with uses the accrued
interest, which leaves out coupons the buyer doesn't get:
- When the bond settles ex-dividend, the accrued interest is negative
  because the buyer doesn't get the next coupon.
- When it settles on or after a coupon date whose payment rolls to a
  later business day, that coupon belongs to the seller and accrual has
  restarted.
In both cases the spread included the coupon, and it jumped by about
the coupon over the PV01 of the floating leg, for a gilt about 26 bp.

Value the bond with the flows of dirty_price_from_discount_curve: the
coupons the buyer is owed, without the next one when the bond settles
ex-dividend.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant