# Quantlib : Do we need to deal with accruals separately to achieve the accurate NPV of interest rate swap?

# Set evaluation date
todaysDate = Date(13, 09, 2019)
Settings.instance().evaluationDate = todaysDate

spotRates = [6.34,  6.65,   6.808,  6.524375,   6.44125,    6.3575, 6.565003,   6.85,   7.5475,
7.895,  7.94625,    7.785,  7.79,   7.79]

spotPeriod = [1w ,1m,   3m  ,6m, 9m ,1y ,3y, 5y, 10y ,15y,  20y, 30y,   40y , 50y]

issue_date = 18-Apr-2018
maturity_date = 18-Apr-2028
Settlement days = 2
compounding = compounded
end of the day = False
calendar = SouthAfrica
notional = 1000000000
Fixed rate = .07569
Index = ZAR-JIBAR-3M-SAFEX
fix_payment frequency = Annual
float_payment frequency = Quarterly
day_count = ActualFixed365
currency = ZAR


Please suggest how to achieve the maximum accuracy. The actual reported value of the swap is '17784176.3' and my calculation says '24104875.57'. I dont know from where the difference is coming from. Rest of my other records swaps are having 92% accuracy compared to reported value. Above are the actual values of one of my record and not sample. Please suggest.

• does anyone have suggestions ? – Rahul Mar 16 at 12:27