|
1 | 1 | """Fixed Income Government Router."""
|
2 | 2 |
|
3 |
| -from openbb_core.app.deprecation import OpenBBDeprecationWarning |
4 | 3 | from openbb_core.app.model.command_context import CommandContext
|
5 | 4 | from openbb_core.app.model.example import APIEx
|
6 | 5 | from openbb_core.app.model.obbject import OBBject
|
@@ -49,71 +48,6 @@ async def yield_curve(
|
49 | 48 | return await OBBject.from_query(Query(**locals()))
|
50 | 49 |
|
51 | 50 |
|
52 |
| -@router.command( |
53 |
| - model="USYieldCurve", |
54 |
| - deprecated=True, |
55 |
| - deprecation=OpenBBDeprecationWarning( |
56 |
| - message="This endpoint will be removed in a future version. Use, `/fixedincome/government/yield_curve`, instead.", |
57 |
| - since=(4, 2), |
58 |
| - expected_removal=(4, 4), |
59 |
| - ), |
60 |
| - examples=[ |
61 |
| - APIEx(parameters={"provider": "fred"}), |
62 |
| - APIEx(parameters={"inflation_adjusted": True, "provider": "fred"}), |
63 |
| - ], |
64 |
| -) |
65 |
| -async def us_yield_curve( |
66 |
| - cc: CommandContext, |
67 |
| - provider_choices: ProviderChoices, |
68 |
| - standard_params: StandardParams, |
69 |
| - extra_params: ExtraParams, |
70 |
| -) -> OBBject: # type: ignore |
71 |
| - """US Yield Curve. Get United States yield curve.""" |
72 |
| - return await OBBject.from_query(Query(**locals())) |
73 |
| - |
74 |
| - |
75 |
| -@router.command( |
76 |
| - model="EUYieldCurve", |
77 |
| - deprecated=True, |
78 |
| - deprecation=OpenBBDeprecationWarning( |
79 |
| - message="This endpoint will be removed in a future version. Use, `/fixedincome/government/yield_curve`, instead.", |
80 |
| - since=(4, 2), |
81 |
| - expected_removal=(4, 4), |
82 |
| - ), |
83 |
| - examples=[ |
84 |
| - APIEx(parameters={"provider": "ecb"}), |
85 |
| - APIEx(parameters={"yield_curve_type": "spot_rate", "provider": "ecb"}), |
86 |
| - ], |
87 |
| -) |
88 |
| -async def eu_yield_curve( |
89 |
| - cc: CommandContext, |
90 |
| - provider_choices: ProviderChoices, |
91 |
| - standard_params: StandardParams, |
92 |
| - extra_params: ExtraParams, |
93 |
| -) -> OBBject: |
94 |
| - """Euro Area Yield Curve. |
95 |
| -
|
96 |
| - Gets euro area yield curve data from ECB. |
97 |
| -
|
98 |
| - The graphic depiction of the relationship between the yield on bonds of the same credit quality but different |
99 |
| - maturities is known as the yield curve. In the past, most market participants have constructed yield curves from |
100 |
| - the observations of prices and yields in the Treasury market. Two reasons account for this tendency. First, |
101 |
| - Treasury securities are viewed as free of default risk, and differences in creditworthiness do not affect yield |
102 |
| - estimates. Second, as the most active bond market, the Treasury market offers the fewest problems of illiquidity |
103 |
| - or infrequent trading. The key function of the Treasury yield curve is to serve as a benchmark for pricing bonds |
104 |
| - and setting yields in other sectors of the debt market. |
105 |
| -
|
106 |
| - It is clear that the market’s expectations of future rate changes are one important determinant of the |
107 |
| - yield-curve shape. For example, a steeply upward-sloping curve may indicate market expectations of near-term Fed |
108 |
| - tightening or of rising inflation. However, it may be too restrictive to assume that the yield differences across |
109 |
| - bonds with different maturities only reflect the market’s rate expectations. The well-known pure expectations |
110 |
| - hypothesis has such an extreme implication. The pure expectations hypothesis asserts that all government bonds |
111 |
| - have the same near-term expected return (as the nominally riskless short-term bond) because the return-seeking |
112 |
| - activity of risk-neutral traders removes all expected return differentials across bonds. |
113 |
| - """ |
114 |
| - return await OBBject.from_query(Query(**locals())) |
115 |
| - |
116 |
| - |
117 | 51 | @router.command(
|
118 | 52 | model="TreasuryRates",
|
119 | 53 | examples=[APIEx(parameters={"provider": "fmp"})],
|
|
0 commit comments