Add rounding to coupons and accrued amounts

Open
#896 23 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
fintech-quant

Research direction

Start by locating the QuantLib bond cash flow and coupon/accrued amount calculations used by qlBond. The issue gives a target coupon example: 3% on RUB 1,000 over 182 days should round to 14.96. Check how existing bond tests cover coupon and accrued amounts, then assess where per-bond rounding belongs; done means the calculations match the stated Russian local bond convention without changing other bond conventions.

Written by the indexing model from the issue text.

Description

help wanted

Hi. In Russia local bonds are traded not in notional but in quantities by RUB 1000 amount for every 1 bond.
It imlies coupon and accrued amounts are rounded per 2 digits for every RUB 1000. It differs from eurubond conventions, but that's it.
As a results, CFs are not precisely correct when constructing via qlBond object. For big amount (millions, billions) that rounding actually gives some distortions in yields, spreads. Is there a way to fix this bug? Somehow force qlXL to round coupon and accrued amount for every sigle bond?

For example, 3% coupon rate act/365 with 182D for 1000 gives correct coupon 14.96 and not 14,9589. Accrued for 1st day is 0.82 and not 0.82.

Dominant language
C++
Stars
7.7k
Forks
2.3k
Avg merge
5d 10h
Merged PRs (30d)
87

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lballabio/QuantLib

All issues in lballabio/QuantLib

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.