Fixed Bond Pricing and Sensitivities


I’m new to Strata and found it very interesting at first sight. I was looking for pure Java financial library and this really seem to fit my needs.

My main need now is related to the pricing of a fixed vanilla bond. I explain what I need. Currently I have a portfolio of vanilla Euro fixed bond. My goal is to price those bonds, and to calculate interest rate sensitivities.

My input is a set of rate corresponding to the current Euro Swap curve used as the base to discount the bonds.

I would like to:

  1. Create a curve from those spot rate
  2. Calculate the static spread from a bond , so the spread to be put identical on each rate that discounting the flow give me the market price I need.
  3. Then I need to add/substract the shock I need from this spread in order to be able to calculate parallel interest rate sensitivites on the same bond.

Is this possibile in strata? any suggestion, code would be so appreciated.

thank you


Hi FinanceGiu,

Welcome to Strata.

What you want to do is possible in Strata. Here are a couple of pointers related to your requests.

  1. Creating curves from the sport rate is done through the “CurveCalibrator”. This is a tool that allows you to calibrate the curves in a very flexible way. The best way to start using it is probably using one of the pre-build tests that act as examples. The simplest one is probably “CalibrationDiscountingSimple1Test”:

  2. Pricing and measures related to bonds are in the pricers “DiscountingFixedCouponBondTradePricer” and “DiscountingFixedCouponBondProductPricer”. In particular the computation of the spread you want (called Z Spread in the library) can be obtained with the method “zSpreadFromCurvesAndDirtyPrice”.

  3. It is possible to compute different interest rate sensitivities for the instruments (bonds in particular). You can compute zero-coupon (curve parameters) sensitivities or market rate (market quote) sensitivities. For bonds there is also the conventional modified duration (representing the change of price for a change of yield).