Server-side Bond and Interest Rate Swap Calculator Case Study
About 2 min
Server-side Bond and Interest Rate Swap Calculator Case Study
Visit the Mathema Option Pricing System for foreign exchange options and structured product valuation!
Server-side bond object construction and related functions for calculating yield, clean price, dirty price, duration, convexity, spread, and other metrics; server-side interest rate swap object construction, fixed-leg analysis, floating-leg analysis, and swap result analysis.
Click the image below to download the template:
Server-Side Construction of Bond Objects and Interest Rate Swap Objects Using Bond Codes and Structure Abbreviations, Along with Application Function Descriptions
1. Server-side bond object construction and function to retrieve the latest transaction price
- McpFixedRateBonds2:Constructor function for the server-side bond object。
- McpGet1:The server retrieves the latest transaction price for the specified bond code。
2. Price Calculation Functions
- FrbCleanPriceFromYieldCHN:Calculates the clean price based on the FixedRateBond object and yield.
- FrbDirtyPriceFromYieldCHN:Calculates the dirty price based on the FixedRateBond object and yield.
- FrbPrice:Calculates the dirty price based on the FixedRateBond object and BondCurve object.
3. Duration and Convexity Calculation Functions
- FrbDurationCHN:Calculates the Macaulay duration based on the FixedRateBond object and yield.
- FrbMDurationCHN:Calculates the modified duration based on the FixedRateBond object and yield.
- FrbConvexityCHN:Calculates the convexity based on the FixedRateBond object and yield.
4. PVBP Calculation Functions
- FrbPVBPCHN:Calculates the PVBP (Price Value of a Basis Point) based on the FixedRateBond object and yield.
5. Yield Calculation Functions
- FrbYieldFromDirtyPriceCHN:Calculates the yield based on the FixedRateBond object and dirty price.
6.Server-side Interest Rate Swap Object Constructor
- McpVanillaSwaps2:The server implements a VanillaSwap object via an IRS (Interest Rate Swap) framework.
7. Fixed Leg Analysis Functions
- SwapFixedLegAnnuity:Calculates the annuity.
- SwapFixedLegDuration:Calculates the duration.
- SwapFixedLegMDuration:Calculates the modified duration.
- SwapFixedLegNPV:Calculates the net present value (NPV).
- SwapFixedLegDV01:Calculates the DV01.
- SwapFixedLegPremium:Calculates the premium.
- SwapFixedLegAccrued:Calculates the accrued interest.
- SwapFixedLegMarketValue:Calculates the market value.
8. Floating Leg Analysis Functions
- SwapFloatingLegAnnuity:Calculates the annuity.
- SwapFloatingLegDuration:Calculates the duration.
- SwapFloatingLegMDuration:Calculates the modified duration.
- SwapFloatingLegNPV:Calculates the net present value (NPV).
- SwapFloatingLegDV01:Calculates the DV01.
- SwapFloatingLegPremium:Calculates the premium.
- SwapFloatingLegAccrued:Calculates the accrued interest.
- SwapFloatingLegMarketValue:Calculates the market value.
9. Swap Result Functions
- SwapNPV: Calculates the net present value (NPV).
- SwapMarketParRate:Calculates the Par Rate/Yield.
- SwapDuration:Calculates the duration.
- SwapMDuration:Calculates the modified duration.
- SwapPV01:Calculates the PVBP.
- SwapDV01:Calculates the DV01.
- SwapMarketValue:Calculates the market value.
- SwapAccrued:Calculates the accrued interest.
10. Pricing Functions
- SwapFixedLegs:Calculates the fixed leg cash flows.
- SwapFloatingLegs:Calculates the floating leg cash flows.
11. Fixing Frequency and Fixing Price Functions
- SwapFloatingQuotes:Calculates the floating leg fixing frequency and fixing price.
- SwapFloatingQuoteLegs:Calculates the floating leg fixing frequency and fixing price.