Skip to content
All library documents

Modeling Compounded FR007 Swap Coupons in QuantLib

Article Quant Q&A · Author: Eli Hu

Summary

The document explains a proposed way to represent a China seven-day repo swap whose floating leg compounds short-term rates. It treats the fixed leg like that of a standard LIBOR swap and views the floating leg as a sequence of compound-interest coupons, with weekly rate resets. The discussion focuses on how such a structure might be expressed in QuantLib.

One answer suggests using a sub-period coupon and leg builder, then passing that leg into a swap. However, the rate fixing schedule described by this construction may not match the intended sequence of accrual periods, so the implementation could need modification. Other responses mention that bootstrapping this market is not directly supported in the library and suggest changing code or adjusting discount factors. These are tentative implementation directions, not a complete pricing recipe; the document supplies no calibration details, market conventions, or numerical validation.

Key ideas

  • The fixed leg can be structured similarly to a conventional LIBOR swap fixed leg.
  • The floating leg can be represented as coupons that compound short-term repo rates.
  • QuantLib’s sub-period coupon builder may help model compounded fixings, subject to schedule compatibility.
  • The suggested approaches do not provide a validated curve bootstrapping or pricing implementation.

Tags

Full text
# Using Quantlib to pricing a FR007 swap (which is compounding interest rate in floating leg)


# Using Quantlib to pricing a FR007 swap (which is compounding interest rate in floating leg)












You can treat the FR007 swap like this: The fixed-rate leg is the same as the fixed-rate leg of the LIBOR swap. The floating rate can be treated as the combination of some 3-months maturity compound interest rate bonds. The rate will be reset weekly. I draw a picture and hope this can help me to explain the rule.

I am not sure the Quantlib has some function that can deal with a swap like this, can someone give me some ideas?

## Answer by czhang0418 (score 1)

https://quant.stackexchange.com/a/68804

There is no suitable solution to bootstrap China 7D Repo swap right now in QuantLib. You can modify the QL C++ code and rebuild to realize it.

## Answer by Luigi Ballabio (score 1)

https://quant.stackexchange.com/a/76211

You can try using the SubPeriodCoupon class and the corresponding `SubPeriodsLeg` builder, which would create a leg you can pass to the `Swap` class. I'm not sure if the compounding frequency would map correctly what you need, though; the sub-period coupon would compound rates fixed at 1W, 2W, 3W, 4W, 5W and so on, while your sketch mentions 1W, 2W, 3W, 1M etc. This might need some changes in the code.

## Answer by T123 (score 0)

https://quant.stackexchange.com/a/68816

You can by simply modifying the discount factors going back from the maturity date, not each coupon date. This should give you the desired result.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.