I've recently been trying to work on and understand the concepts around CDS. By making simplifications (flat hazard rate, flat forward rate), I wanted to compare the values I could obtain by manual calculations for the NPV of the couponsLeg and the protectionLeg with the one I could obtain by using QuantLib.
I got exactly the same value for the protectionNPV but a different one for the couponLeg. Of course, the couponLeg is the sum: defaultAccrualNpv + premiumNPV
I have the right values for the premiumNPV value but not for the defaultAccrualNpv. Looking at the code, I discovered the existence of a default halfDayBias. Could someone explain to me what is the logic behind this bias? In my opinion, this bias just creates a half-day overlap between the different periods.
Thanks you in advance for your help