FixedRateBond#
USD#
Government Bonds#
Uses Street convention. Similar to “uk_gb” except long stub periods have linear proportioning only in the segregated short stub part.
In [1]: defaults.spec["us_gb"]
Out[1]:
{'frequency': 's',
'stub': 'shortfront',
'eom': True,
'modifier': 'none',
'calendar': 'nyc',
'payment_lag': 0,
'currency': 'usd',
'convention': 'actacticma',
'payment_lag_exchange': 0,
'settle': 1,
'ex_div': 1,
'calc_mode': 'us_gb'}
In [2]: from rateslib.instruments.bonds.conventions import US_GB
In [3]: US_GB.kwargs
Out[3]:
{'settle_accrual': 'linear_days_long_front_split',
'ytm_accrual': 'linear_days_long_front_split',
'v1': 'compounding',
'v2': 'regular',
'v3': 'compounding',
'c1': 'cashflow',
'ci': 'cashflow',
'cn': 'cashflow'}
In [4]: FixedRateBond(dt(2000, 1, 1), "10y", spec="us_gb", fixed_rate=2.5).kwargs
Out[4]:
{'notional': <NoInput.blank: 0>,
'currency': 'usd',
'amortization': <NoInput.blank: 0>,
'convention': 'actacticma',
'fixed_rate': 2.5,
'initial_exchange': False,
'final_exchange': True,
'ex_div': 1,
'settle': 1,
'calc_mode': 'us_gb',
'metric': 'clean_price',
'payment_lag_exchange': 0,
'schedule': <rl.Schedule at 0x12197b1d0>}
US Treasury convention. Reprices examples in federal documents: Section 31-B-ii).
In [5]: defaults.spec["us_gb_tsy"]
Out[5]:
{'frequency': 's',
'stub': 'shortfront',
'eom': True,
'modifier': 'none',
'calendar': 'nyc',
'payment_lag': 0,
'currency': 'usd',
'convention': 'actacticma',
'payment_lag_exchange': 0,
'settle': 1,
'ex_div': 1,
'calc_mode': 'us_gb_tsy'}
In [6]: from rateslib.instruments.bonds.conventions import US_GB_TSY
In [7]: US_GB_TSY.kwargs
Out[7]:
{'settle_accrual': 'linear_days_long_front_split',
'ytm_accrual': 'linear_days_long_front_split',
'v1': 'simple_long_stub_compounding',
'v2': 'regular',
'v3': 'compounding',
'c1': 'cashflow',
'ci': 'cashflow',
'cn': 'cashflow'}
In [8]: FixedRateBond(dt(2000, 1, 1), "10y", spec="us_gb_tsy", fixed_rate=2.5).kwargs
Out[8]:
{'notional': <NoInput.blank: 0>,
'currency': 'usd',
'amortization': <NoInput.blank: 0>,
'convention': 'actacticma',
'fixed_rate': 2.5,
'initial_exchange': False,
'final_exchange': True,
'ex_div': 1,
'settle': 1,
'calc_mode': 'us_gb_tsy',
'metric': 'clean_price',
'payment_lag_exchange': 0,
'schedule': <rl.Schedule at 0x12197b540>}
Corporate Bonds#
In [9]: defaults.spec["us_corp"]
Out[9]:
{'frequency': 's',
'stub': 'shortfront',
'eom': True,
'modifier': 'none',
'calendar': 'nyc',
'payment_lag': 0,
'currency': 'usd',
'convention': '30u360',
'payment_lag_exchange': 0,
'settle': 1,
'ex_div': 1,
'calc_mode': 'us_corp'}
In [10]: from rateslib.instruments.bonds.conventions import US_CORP
In [11]: US_CORP.kwargs
Out[11]:
{'settle_accrual': '30u360_forward',
'ytm_accrual': '30u360_forward',
'v1': 'compounding_final_simple',
'v2': 'regular',
'v3': 'compounding',
'c1': 'cashflow',
'ci': 'cashflow',
'cn': 'cashflow'}
In [12]: FixedRateBond(dt(2000, 1, 1), "10y", spec="us_corp", fixed_rate=2.5).kwargs
Out[12]:
{'notional': <NoInput.blank: 0>,
'currency': 'usd',
'amortization': <NoInput.blank: 0>,
'convention': '30u360',
'fixed_rate': 2.5,
'initial_exchange': False,
'final_exchange': True,
'ex_div': 1,
'settle': 1,
'calc_mode': 'us_corp',
'metric': 'clean_price',
'payment_lag_exchange': 0,
'schedule': <rl.Schedule at 0x12197b8b0>}
Municipal Bonds#
In [13]: defaults.spec["us_muni"]
Out[13]:
{'frequency': 's',
'stub': 'shortfront',
'eom': True,
'modifier': 'none',
'calendar': 'nyc',
'payment_lag': 0,
'currency': 'usd',
'convention': '30u360',
'payment_lag_exchange': 0,
'settle': 1,
'ex_div': 1,
'calc_mode': 'us_muni'}
In [14]: from rateslib.instruments.bonds.conventions import US_MUNI
In [15]: US_MUNI.kwargs
Out[15]:
{'settle_accrual': '30u360_forward',
'ytm_accrual': '30u360_forward',
'v1': 'compounding_final_simple',
'v2': 'regular',
'v3': 'compounding',
'c1': 'cashflow',
'ci': 'cashflow',
'cn': 'cashflow'}
In [16]: FixedRateBond(dt(2000, 1, 1), "10y", spec="us_muni", fixed_rate=2.5).kwargs
Out[16]:
{'notional': <NoInput.blank: 0>,
'currency': 'usd',
'amortization': <NoInput.blank: 0>,
'convention': '30u360',
'fixed_rate': 2.5,
'initial_exchange': False,
'final_exchange': True,
'ex_div': 1,
'settle': 1,
'calc_mode': 'us_muni',
'metric': 'clean_price',
'payment_lag_exchange': 0,
'schedule': <rl.Schedule at 0x12197bc20>}
EUR#
Government Bonds#
Germany
Uses ICMA conventions. Similar to “uk_gb”, except in the last period simple interest rate and money-market yield is used.
In [17]: defaults.spec["de_gb"]
Out[17]:
{'frequency': 'a',
'stub': 'longfront',
'eom': False,
'modifier': 'none',
'calendar': 'tgt',
'payment_lag': 0,
'currency': 'eur',
'convention': 'actacticma',
'payment_lag_exchange': 0,
'settle': 2,
'ex_div': 1,
'calc_mode': 'de_gb'}
In [18]: from rateslib.instruments.bonds.conventions import DE_GB
In [19]: DE_GB.kwargs
Out[19]:
{'settle_accrual': 'linear_days',
'ytm_accrual': 'linear_days',
'v1': 'compounding_final_simple',
'v2': 'regular',
'v3': 'compounding',
'c1': 'cashflow',
'ci': 'cashflow',
'cn': 'cashflow'}
In [20]: FixedRateBond(dt(2000, 1, 1), "10y", spec="de_gb", fixed_rate=2.5).kwargs
Out[20]:
{'notional': <NoInput.blank: 0>,
'currency': 'eur',
'amortization': <NoInput.blank: 0>,
'convention': 'actacticma',
'fixed_rate': 2.5,
'initial_exchange': False,
'final_exchange': True,
'ex_div': 1,
'settle': 2,
'calc_mode': 'de_gb',
'metric': 'clean_price',
'payment_lag_exchange': 0,
'schedule': <rl.Schedule at 0x121c3c050>}
France
Uses ICMA conventions. Similar to “uk_gb”.
In [21]: defaults.spec["fr_gb"]
Out[21]:
{'frequency': 'a',
'stub': 'shortfront',
'eom': False,
'modifier': 'none',
'calendar': 'tgt',
'payment_lag': 0,
'currency': 'eur',
'convention': 'actacticma',
'payment_lag_exchange': 0,
'settle': 2,
'ex_div': 1,
'calc_mode': 'fr_gb'}
In [22]: from rateslib.instruments.bonds.conventions import FR_GB
In [23]: FR_GB.kwargs
Out[23]:
{'settle_accrual': 'linear_days',
'ytm_accrual': 'linear_days',
'v1': 'compounding',
'v2': 'regular',
'v3': 'compounding',
'c1': 'cashflow',
'ci': 'cashflow',
'cn': 'cashflow'}
In [24]: FixedRateBond(dt(2000, 1, 1), "10y", spec="fr_gb", fixed_rate=2.5).kwargs
Out[24]:
{'notional': <NoInput.blank: 0>,
'currency': 'eur',
'amortization': <NoInput.blank: 0>,
'convention': 'actacticma',
'fixed_rate': 2.5,
'initial_exchange': False,
'final_exchange': True,
'ex_div': 1,
'settle': 2,
'calc_mode': 'fr_gb',
'metric': 'clean_price',
'payment_lag_exchange': 0,
'schedule': <rl.Schedule at 0x121c3c260>}
Italy
Coupons are semi-annual but yield convention is annual yield. In last coupon period simple yield is applied.
In [25]: defaults.spec["it_gb"]
Out[25]:
{'frequency': 's',
'stub': 'shortfront',
'eom': False,
'modifier': 'none',
'calendar': 'tgt',
'payment_lag': 0,
'currency': 'eur',
'convention': 'actacticma',
'payment_lag_exchange': 0,
'settle': 2,
'ex_div': 1,
'calc_mode': 'it_gb'}
In [26]: from rateslib.instruments.bonds.conventions import IT_GB
In [27]: IT_GB.kwargs
Out[27]:
{'settle_accrual': 'linear_days',
'ytm_accrual': 'linear_days',
'v1': 'compounding_final_simple_pay_adjust',
'v2': 'annual_pay_adjust',
'v3': 'compounding_pay_adjust',
'c1': 'cashflow',
'ci': 'cashflow',
'cn': 'cashflow'}
In [28]: FixedRateBond(dt(2000, 1, 1), "10y", spec="it_gb", fixed_rate=2.5).kwargs
Out[28]:
{'notional': <NoInput.blank: 0>,
'currency': 'eur',
'amortization': <NoInput.blank: 0>,
'convention': 'actacticma',
'fixed_rate': 2.5,
'initial_exchange': False,
'final_exchange': True,
'ex_div': 1,
'settle': 2,
'calc_mode': 'it_gb',
'metric': 'clean_price',
'payment_lag_exchange': 0,
'schedule': <rl.Schedule at 0x121c3c3c0>}
Netherlands
Street convention is used, except when the bond is in the final coupon period simple interest yield is used.
In [29]: defaults.spec["nl_gb"]
Out[29]:
{'frequency': 'a',
'stub': 'shortfront',
'eom': False,
'modifier': 'none',
'calendar': 'tgt',
'payment_lag': 0,
'currency': 'eur',
'convention': 'actacticma',
'payment_lag_exchange': 0,
'settle': 2,
'ex_div': 1,
'calc_mode': 'nl_gb'}
In [30]: from rateslib.instruments.bonds.conventions import NL_GB
In [31]: NL_GB.kwargs
Out[31]:
{'settle_accrual': 'linear_days_long_front_split',
'ytm_accrual': 'linear_days_long_front_split',
'v1': 'compounding_final_simple',
'v2': 'regular',
'v3': 'compounding',
'c1': 'cashflow',
'ci': 'cashflow',
'cn': 'cashflow'}
In [32]: FixedRateBond(dt(2000, 1, 1), "10y", spec="nl_gb", fixed_rate=2.5).kwargs
Out[32]:
{'notional': <NoInput.blank: 0>,
'currency': 'eur',
'amortization': <NoInput.blank: 0>,
'convention': 'actacticma',
'fixed_rate': 2.5,
'initial_exchange': False,
'final_exchange': True,
'ex_div': 1,
'settle': 2,
'calc_mode': 'nl_gb',
'metric': 'clean_price',
'payment_lag_exchange': 0,
'schedule': <rl.Schedule at 0x121c3c730>}
CHF#
Government Bonds#
Calculations performed with ICMA convention.
In [33]: defaults.spec["ch_gb"]
Out[33]:
{'frequency': 'a',
'stub': 'shortfront',
'eom': False,
'modifier': 'none',
'calendar': 'zur',
'payment_lag': 0,
'currency': 'chf',
'convention': '30e360',
'payment_lag_exchange': 0,
'settle': 1,
'ex_div': 1,
'calc_mode': 'ch_gb'}
In [34]: from rateslib.instruments.bonds.conventions import CH_GB
In [35]: CH_GB.kwargs
Out[35]:
{'settle_accrual': '30e360_backward',
'ytm_accrual': '30e360_backward',
'v1': 'compounding',
'v2': 'regular',
'v3': 'compounding',
'c1': 'cashflow',
'ci': 'cashflow',
'cn': 'cashflow'}
In [36]: FixedRateBond(dt(2000, 1, 1), "10y", spec="ch_gb", fixed_rate=2.5).kwargs
Out[36]:
{'notional': <NoInput.blank: 0>,
'currency': 'chf',
'amortization': <NoInput.blank: 0>,
'convention': '30e360',
'fixed_rate': 2.5,
'initial_exchange': False,
'final_exchange': True,
'ex_div': 1,
'settle': 1,
'calc_mode': 'ch_gb',
'metric': 'clean_price',
'payment_lag_exchange': 0,
'schedule': <rl.Schedule at 0x11fc62c50>}
GBP#
Government Bonds#
Calculations performed with the DMO method. Accrued is on ActAct linearly proportioned basis. Yield is compounded in all periods including any front and back stubs.
In [37]: defaults.spec["uk_gb"]
Out[37]:
{'frequency': 's',
'stub': 'shortfront',
'eom': False,
'modifier': 'none',
'calendar': 'ldn',
'payment_lag': 0,
'currency': 'gbp',
'convention': 'actacticma',
'payment_lag_exchange': 0,
'settle': 1,
'ex_div': 7,
'calc_mode': 'uk_gb'}
In [38]: from rateslib.instruments.bonds.conventions import UK_GB
In [39]: UK_GB.kwargs
Out[39]:
{'settle_accrual': 'linear_days',
'ytm_accrual': 'linear_days',
'v1': 'compounding',
'v2': 'regular',
'v3': 'compounding',
'c1': 'cashflow',
'ci': 'cashflow',
'cn': 'cashflow'}
In [40]: FixedRateBond(dt(2000, 1, 1), "10y", spec="uk_gb", fixed_rate=2.5).kwargs
Out[40]:
{'notional': <NoInput.blank: 0>,
'currency': 'gbp',
'amortization': <NoInput.blank: 0>,
'convention': 'actacticma',
'fixed_rate': 2.5,
'initial_exchange': False,
'final_exchange': True,
'ex_div': 7,
'settle': 1,
'calc_mode': 'uk_gb',
'metric': 'clean_price',
'payment_lag_exchange': 0,
'schedule': <rl.Schedule at 0x121c3c9f0>}
SEK#
Government Bonds#
Calculation performed with Swedish DMO method, using 30e360 for accrued calculations and for back stubs.
In [41]: defaults.spec["se_gb"]
Out[41]:
{'frequency': 'a',
'stub': 'shortfront',
'eom': False,
'modifier': 'none',
'calendar': 'stk',
'payment_lag': 0,
'currency': 'sek',
'convention': 'actacticma',
'payment_lag_exchange': 0,
'settle': 2,
'ex_div': 5,
'calc_mode': 'se_gb'}
In [42]: from rateslib.instruments.bonds.conventions import SE_GB
In [43]: SE_GB.kwargs
Out[43]:
{'settle_accrual': '30e360_backward',
'ytm_accrual': '30e360_backward',
'v1': 'compounding_final_simple',
'v2': 'regular',
'v3': 'simple_30e360',
'c1': 'cashflow',
'ci': 'cashflow',
'cn': 'cashflow'}
In [44]: FixedRateBond(dt(2000, 1, 1), "10y", spec="se_gb", fixed_rate=2.5).kwargs
Out[44]:
{'notional': <NoInput.blank: 0>,
'currency': 'sek',
'amortization': <NoInput.blank: 0>,
'convention': 'actacticma',
'fixed_rate': 2.5,
'initial_exchange': False,
'final_exchange': True,
'ex_div': 5,
'settle': 2,
'calc_mode': 'se_gb',
'metric': 'clean_price',
'payment_lag_exchange': 0,
'schedule': <rl.Schedule at 0x121c3cd60>}
NOK#
Government Bonds#
Using annualised yield calculation under ICMA compounding convention. Stub periods use ACT365 day fraction. Accrual is calculated with ACT365F.
In [45]: defaults.spec["no_gb"]
Out[45]:
{'frequency': 'a',
'stub': 'shortfront',
'eom': False,
'modifier': 'none',
'calendar': 'osl',
'payment_lag': 0,
'currency': 'nok',
'convention': 'actacticma_stub365f',
'payment_lag_exchange': 0,
'settle': 1,
'ex_div': 1,
'calc_mode': 'no_gb'}
In [46]: from rateslib.instruments.bonds.conventions import NO_GB
In [47]: NO_GB.kwargs
Out[47]:
{'settle_accrual': 'act365f_1y',
'ytm_accrual': 'act365f_1y',
'v1': 'compounding_stub_act365f',
'v2': 'regular',
'v3': 'compounding',
'c1': 'cashflow',
'ci': 'cashflow',
'cn': 'cashflow'}
In [48]: FixedRateBond(dt(2000, 1, 1), "10y", spec="no_gb", fixed_rate=2.5).kwargs
Out[48]:
{'notional': <NoInput.blank: 0>,
'currency': 'nok',
'amortization': <NoInput.blank: 0>,
'convention': 'actacticma_stub365f',
'fixed_rate': 2.5,
'initial_exchange': False,
'final_exchange': True,
'ex_div': 1,
'settle': 1,
'calc_mode': 'no_gb',
'metric': 'clean_price',
'payment_lag_exchange': 0,
'schedule': <rl.Schedule at 0x11fade620>}
CAD#
Government Bonds#
Canadian government bond convention. Accrued is calculated using an ACT365F convention. Yield calculations are still derived with linearly proportioned compounded coupons. Note this is not the appropriate convention for monthly-pay securities.
In [49]: defaults.spec["ca_gb"]
Out[49]:
{'frequency': 's',
'stub': 'shortfront',
'eom': False,
'modifier': 'none',
'calendar': 'tro',
'payment_lag': 0,
'currency': 'cad',
'convention': 'actacticma_stub365f',
'payment_lag_exchange': 0,
'settle': 1,
'ex_div': 1,
'calc_mode': 'ca_gb'}
In [50]: from rateslib.instruments.bonds.conventions import CA_GB
In [51]: CA_GB.kwargs
Out[51]:
{'settle_accrual': 'act365f_1y',
'ytm_accrual': 'linear_days',
'v1': 'compounding',
'v2': 'regular',
'v3': 'simple_30e360',
'c1': 'cashflow',
'ci': 'cashflow',
'cn': 'cashflow'}
In [52]: FixedRateBond(dt(2000, 1, 1), "10y", spec="ca_gb", fixed_rate=2.5).kwargs
Out[52]:
{'notional': <NoInput.blank: 0>,
'currency': 'cad',
'amortization': <NoInput.blank: 0>,
'convention': 'actacticma_stub365f',
'fixed_rate': 2.5,
'initial_exchange': False,
'final_exchange': True,
'ex_div': 1,
'settle': 1,
'calc_mode': 'ca_gb',
'metric': 'clean_price',
'payment_lag_exchange': 0,
'schedule': <rl.Schedule at 0x11fadd4f0>}