Asset swaps
Primer on asset swap structured instrument
Introduction
The purpose of this primer is to show how to create and work with Matched Maturity Asset Swaps.
Environment
Setting up your environment takes three steps:
Import the relevant internal and external libraries
Configure the environment parameters
Initialise the environment
Learn more: setting up the environment.
Asset Swap Structure
The asset swap structure is formed by two instruments which are referred to as legs. One of the legs are a financial asset, in this case a government bond, whereas the other leg is an interest rate swap. Asset Swaps are used to transform cashflow characteristics from fix to floating payments with the intention of hedging credit risk.
Bond Leg
Below we are selecting an US government bond to form the first leg of the Asset Swap.
The static data and characteristics related to the bond can be viewed via the .treasury_info
as shown in below code block:
Asset Swap Building Block
The AssetSwap
class returns a Matched-Maturity Asset Swap strategy; buying a fixed-coupon bond and selling a receiver swap.
We can explore the bond and swap constituent by calling the method structure_instruments
Custom Asset Swap Structure
We can build any Asset Swap Structure by holding a bond and a swap simultaneously. In order to hold the treasury we use the building block SingleBondStrategy
Swap Leg: Constructing Matching Maturity Swap
To create a matching swap to replicate the treasury leg cashflows we need to override a number of default arguments
We can now create the swap with the overrides above
We verify the swap set up by matching the treasury information
We can compare now the swaps and treasury cashflows to ensure they match
Asset Swap Structure
Below, the two legs of the asset swap structure are combined:
The below code block will create a performance report of the asset swap strategy:
Last updated