0
$\begingroup$

How to compute the BRL plain vanilla swap. I have followed the below methodology to calculate the valuation for other indexes but BRL-CDI is far off from actual valuation. Please suggest if anything I am missing in BRL swaps especially.

# construct discount curve and libor curve
risk_free_rate = 0.01
libor_rate = 0.02
day_count = ql.Business252()

discount_curve = ql.YieldTermStructureHandle(
     ql.FlatForward(calculation_date, risk_free_rate, day_count)
)

 libor_curve = ql.YieldTermStructureHandle(
     ql.FlatForward(calculation_date, libor_rate, day_count)
 )
# BRL index
 libor3M_index = ql.OvernightIndex('BRL', 0, ql.BRLCurrency(), ql.Brazil(), ql.Business252())

calendar = ql.Brazil()
settle_date = calendar.advance(calculation_date, 5, ql.Days)
maturity_date = calendar.advance(settle_date, 10, ql.Years)


 fixed_schedule = ql.Schedule(settle_date, maturity_date, 
                         fixed_leg_tenor, calendar,
                         ql.ModifiedFollowing, ql.ModifiedFollowing,
                         ql.DateGeneration.Forward, False)

 float_schedule = ql.Schedule (settle_date, maturity_date, 
                          float_leg_tenor, calendar,
                          ql.ModifiedFollowing, ql.ModifiedFollowing,
                          ql.DateGeneration.Forward, False)

 notional = 10000000
 fixed_rate = 0.025
fixed_leg_daycount = ql.Business252()
float_spread = 0.004
float_leg_daycount = ql.Business252()

 ir_swap = ql.VanillaSwap(ql.VanillaSwap.Payer, notional, fixed_schedule, 
           fixed_rate, fixed_leg_daycount, float_schedule,
           libor3M_index, float_spread, float_leg_daycount )

 swap_engine = ql.DiscountingSwapEngine(discount_curve)
 ir_swap.setPricingEngine(swap_engine)
$\endgroup$
2
  • $\begingroup$ Googling... opensourcerisk.org/docs/qle/… $\endgroup$ Jun 15, 2021 at 11:35
  • $\begingroup$ Thanks for reply. It means, in place of 'ql.VanillaSwap', I should use 'ql.BRLCdiSwap' for NPV computation. Correct ? $\endgroup$
    – robin
    Jun 15, 2021 at 12:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.