FixedRateBond#
USD#
Government Bonds#
Aliases: “ust”
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',
'initial_exchange': False,
'final_exchange': True,
'payment_lag_exchange': 0,
'settle': 1,
'ex_div': 1,
'calc_mode': 'us_gb'}
In [2]: from rateslib.instruments.bonds 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'}
In [4]: FixedRateBond(dt(2000, 1, 1), "10y", spec="us_gb", fixed_rate=2.5).kwargs
Out[4]:
{'effective': datetime.datetime(2000, 1, 1, 0, 0),
'termination': '10y',
'frequency': 's',
'stub': 'shortfront',
'front_stub': <NoInput.blank: 0>,
'back_stub': <NoInput.blank: 0>,
'roll': <NoInput.blank: 0>,
'eom': True,
'modifier': 'none',
'calendar': 'nyc',
'payment_lag': 0,
'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',
'payment_lag_exchange': 0}
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',
'initial_exchange': False,
'final_exchange': True,
'payment_lag_exchange': 0,
'settle': 1,
'ex_div': 1,
'calc_mode': 'us_gb_tsy'}
In [6]: from rateslib.instruments.bonds 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'}
In [8]: FixedRateBond(dt(2000, 1, 1), "10y", spec="us_gb_tsy", fixed_rate=2.5).kwargs
Out[8]:
{'effective': datetime.datetime(2000, 1, 1, 0, 0),
'termination': '10y',
'frequency': 's',
'stub': 'shortfront',
'front_stub': <NoInput.blank: 0>,
'back_stub': <NoInput.blank: 0>,
'roll': <NoInput.blank: 0>,
'eom': True,
'modifier': 'none',
'calendar': 'nyc',
'payment_lag': 0,
'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',
'payment_lag_exchange': 0}
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 [9]: defaults.spec["de_gb"]
Out[9]:
{'frequency': 'a',
'stub': 'shortfront',
'eom': False,
'modifier': 'none',
'calendar': 'tgt',
'payment_lag': 0,
'currency': 'eur',
'convention': 'actacticma',
'initial_exchange': False,
'final_exchange': True,
'payment_lag_exchange': 0,
'settle': 2,
'ex_div': 1,
'calc_mode': 'de_gb'}
In [10]: from rateslib.instruments.bonds import DE_GB
In [11]: DE_GB.kwargs
Out[11]:
{'settle_accrual': 'linear_days',
'ytm_accrual': 'linear_days',
'v1': 'compounding_final_simple',
'v2': 'regular',
'v3': 'compounding'}
In [12]: FixedRateBond(dt(2000, 1, 1), "10y", spec="de_gb", fixed_rate=2.5).kwargs
Out[12]:
{'effective': datetime.datetime(2000, 1, 1, 0, 0),
'termination': '10y',
'frequency': 'a',
'stub': 'shortfront',
'front_stub': <NoInput.blank: 0>,
'back_stub': <NoInput.blank: 0>,
'roll': <NoInput.blank: 0>,
'eom': False,
'modifier': 'none',
'calendar': 'tgt',
'payment_lag': 0,
'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',
'payment_lag_exchange': 0}
France
Uses ICMA conventions. Similar to “uk_gb”.
In [13]: defaults.spec["fr_gb"]
Out[13]:
{'frequency': 'a',
'stub': 'shortfront',
'eom': False,
'modifier': 'none',
'calendar': 'tgt',
'payment_lag': 0,
'currency': 'eur',
'convention': 'actacticma',
'initial_exchange': False,
'final_exchange': True,
'payment_lag_exchange': 0,
'settle': 2,
'ex_div': 1,
'calc_mode': 'fr_gb'}
In [14]: from rateslib.instruments.bonds import FR_GB
In [15]: FR_GB.kwargs
Out[15]:
{'settle_accrual': 'linear_days',
'ytm_accrual': 'linear_days',
'v1': 'compounding',
'v2': 'regular',
'v3': 'compounding'}
In [16]: FixedRateBond(dt(2000, 1, 1), "10y", spec="fr_gb", fixed_rate=2.5).kwargs
Out[16]:
{'effective': datetime.datetime(2000, 1, 1, 0, 0),
'termination': '10y',
'frequency': 'a',
'stub': 'shortfront',
'front_stub': <NoInput.blank: 0>,
'back_stub': <NoInput.blank: 0>,
'roll': <NoInput.blank: 0>,
'eom': False,
'modifier': 'none',
'calendar': 'tgt',
'payment_lag': 0,
'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',
'payment_lag_exchange': 0}
Italy
Coupons are semi-annual but yield convention is annual yield. In last coupon period simple yield is applied.
In [17]: defaults.spec["it_gb"]
Out[17]:
{'frequency': 's',
'stub': 'shortfront',
'eom': False,
'modifier': 'none',
'calendar': 'tgt',
'payment_lag': 0,
'currency': 'eur',
'convention': 'actacticma',
'initial_exchange': False,
'final_exchange': True,
'payment_lag_exchange': 0,
'settle': 2,
'ex_div': 1,
'calc_mode': 'it_gb'}
In [18]: from rateslib.instruments.bonds import IT_GB
In [19]: IT_GB.kwargs
Out[19]:
{'settle_accrual': 'linear_days',
'ytm_accrual': 'linear_days',
'v1': 'compounding_final_simple',
'v2': 'annual',
'v3': 'compounding'}
In [20]: FixedRateBond(dt(2000, 1, 1), "10y", spec="it_gb", fixed_rate=2.5).kwargs
Out[20]:
{'effective': datetime.datetime(2000, 1, 1, 0, 0),
'termination': '10y',
'frequency': 's',
'stub': 'shortfront',
'front_stub': <NoInput.blank: 0>,
'back_stub': <NoInput.blank: 0>,
'roll': <NoInput.blank: 0>,
'eom': False,
'modifier': 'none',
'calendar': 'tgt',
'payment_lag': 0,
'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',
'payment_lag_exchange': 0}
Netherlands
Street convention is used, except when the bond is in the final coupon period simple interest yield is used.
In [21]: defaults.spec["nl_gb"]
Out[21]:
{'frequency': 'a',
'stub': 'shortfront',
'eom': False,
'modifier': 'none',
'calendar': 'tgt',
'payment_lag': 0,
'currency': 'eur',
'convention': 'actacticma',
'initial_exchange': False,
'final_exchange': True,
'payment_lag_exchange': 0,
'settle': 2,
'ex_div': 1,
'calc_mode': 'nl_gb'}
In [22]: from rateslib.instruments.bonds import NL_GB
In [23]: NL_GB.kwargs
Out[23]:
{'settle_accrual': 'linear_days_long_front_split',
'ytm_accrual': 'linear_days_long_front_split',
'v1': 'compounding_final_simple',
'v2': 'regular',
'v3': 'compounding'}
In [24]: FixedRateBond(dt(2000, 1, 1), "10y", spec="nl_gb", fixed_rate=2.5).kwargs
Out[24]:
{'effective': datetime.datetime(2000, 1, 1, 0, 0),
'termination': '10y',
'frequency': 'a',
'stub': 'shortfront',
'front_stub': <NoInput.blank: 0>,
'back_stub': <NoInput.blank: 0>,
'roll': <NoInput.blank: 0>,
'eom': False,
'modifier': 'none',
'calendar': 'tgt',
'payment_lag': 0,
'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',
'payment_lag_exchange': 0}
GBP#
Government Bonds#
Aliases: “ukt” and “gilt”
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 [25]: defaults.spec["uk_gb"]
Out[25]:
{'frequency': 's',
'stub': 'shortfront',
'eom': False,
'modifier': 'none',
'calendar': 'ldn',
'payment_lag': 0,
'currency': 'gbp',
'convention': 'actacticma',
'initial_exchange': False,
'final_exchange': True,
'payment_lag_exchange': 0,
'settle': 1,
'ex_div': 7,
'calc_mode': 'uk_gb'}
In [26]: from rateslib.instruments.bonds import UK_GB
In [27]: UK_GB.kwargs
Out[27]:
{'settle_accrual': 'linear_days',
'ytm_accrual': 'linear_days',
'v1': 'compounding',
'v2': 'regular',
'v3': 'compounding'}
In [28]: FixedRateBond(dt(2000, 1, 1), "10y", spec="uk_gb", fixed_rate=2.5).kwargs
Out[28]:
{'effective': datetime.datetime(2000, 1, 1, 0, 0),
'termination': '10y',
'frequency': 's',
'stub': 'shortfront',
'front_stub': <NoInput.blank: 0>,
'back_stub': <NoInput.blank: 0>,
'roll': <NoInput.blank: 0>,
'eom': False,
'modifier': 'none',
'calendar': 'ldn',
'payment_lag': 0,
'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',
'payment_lag_exchange': 0}
SEK#
Government Bonds#
Aliases: “sgb”
Calculation performed with Swedish DMO method, using 30e360 for accrued calculations and for back stubs.
In [29]: defaults.spec["se_gb"]
Out[29]:
{'frequency': 'a',
'stub': 'shortfront',
'eom': False,
'modifier': 'none',
'calendar': 'stk',
'payment_lag': 0,
'currency': 'sek',
'convention': 'actacticma',
'initial_exchange': False,
'final_exchange': True,
'payment_lag_exchange': 0,
'settle': 2,
'ex_div': 5,
'calc_mode': 'se_gb'}
In [30]: from rateslib.instruments.bonds import SE_GB
In [31]: SE_GB.kwargs
Out[31]:
{'settle_accrual': '30e360',
'ytm_accrual': '30e360',
'v1': 'compounding_final_simple',
'v2': 'regular',
'v3': 'simple_30e360'}
In [32]: FixedRateBond(dt(2000, 1, 1), "10y", spec="se_gb", fixed_rate=2.5).kwargs
Out[32]:
{'effective': datetime.datetime(2000, 1, 1, 0, 0),
'termination': '10y',
'frequency': 'a',
'stub': 'shortfront',
'front_stub': <NoInput.blank: 0>,
'back_stub': <NoInput.blank: 0>,
'roll': <NoInput.blank: 0>,
'eom': False,
'modifier': 'none',
'calendar': 'stk',
'payment_lag': 0,
'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',
'payment_lag_exchange': 0}
NOK#
Government Bonds#
Using annualised yield calculation under ICMA compounding convention. Stub periods use ACT365 day fraction. Accrual is calculated with ACT365F.
In [33]: defaults.spec["no_gb"]
Out[33]:
{'frequency': 'a',
'stub': 'shortfront',
'eom': False,
'modifier': 'none',
'calendar': 'osl',
'payment_lag': 0,
'currency': 'nok',
'convention': 'actacticma_stub365f',
'initial_exchange': False,
'final_exchange': True,
'payment_lag_exchange': 0,
'settle': 1,
'ex_div': 1,
'calc_mode': 'no_gb'}
In [34]: from rateslib.instruments.bonds import NO_GB
In [35]: NO_GB.kwargs
Out[35]:
{'settle_accrual': 'act365f_1y',
'ytm_accrual': 'act365f_1y',
'v1': 'compounding_stub_act365f',
'v2': 'regular',
'v3': 'compounding'}
In [36]: FixedRateBond(dt(2000, 1, 1), "10y", spec="no_gb", fixed_rate=2.5).kwargs
Out[36]:
{'effective': datetime.datetime(2000, 1, 1, 0, 0),
'termination': '10y',
'frequency': 'a',
'stub': 'shortfront',
'front_stub': <NoInput.blank: 0>,
'back_stub': <NoInput.blank: 0>,
'roll': <NoInput.blank: 0>,
'eom': False,
'modifier': 'none',
'calendar': 'osl',
'payment_lag': 0,
'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',
'payment_lag_exchange': 0}
CAD#
Government Bonds#
Aliases “cadgb”
Canadian government bond convention. Accrued is calculated using an ACT365F convention. Yield calculations are still derived with linearly proportioned compounded coupons.
In [37]: defaults.spec["ca_gb"]
Out[37]:
{'frequency': 's',
'stub': 'shortfront',
'eom': False,
'modifier': 'none',
'calendar': 'tro',
'payment_lag': 0,
'currency': 'cad',
'convention': 'actacticma_stub365f',
'initial_exchange': False,
'final_exchange': True,
'payment_lag_exchange': 0,
'settle': 1,
'ex_div': 1,
'calc_mode': 'ca_gb'}
In [38]: from rateslib.instruments.bonds import CA_GB
In [39]: CA_GB.kwargs
Out[39]:
{'settle_accrual': 'act365f_1y',
'ytm_accrual': 'linear_days',
'v1': 'compounding',
'v2': 'regular',
'v3': 'simple_30e360'}
In [40]: FixedRateBond(dt(2000, 1, 1), "10y", spec="ca_gb", fixed_rate=2.5).kwargs
Out[40]:
{'effective': datetime.datetime(2000, 1, 1, 0, 0),
'termination': '10y',
'frequency': 's',
'stub': 'shortfront',
'front_stub': <NoInput.blank: 0>,
'back_stub': <NoInput.blank: 0>,
'roll': <NoInput.blank: 0>,
'eom': False,
'modifier': 'none',
'calendar': 'tro',
'payment_lag': 0,
'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',
'payment_lag_exchange': 0}