We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/zxh2010/defeatbeta-api'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
- [1. SP500 Historical Annual Returns](#1-sp500-historical-annual-returns)
- [2. SP500 CAGR Returns](#2-sp500-cagr-returns)
- [3. SP500 CAGR Returns Rolling](#3-sp500-cagr-returns-rolling)
- [4. Daily Treasure Yield](#4-daily-treasure-yield)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## 1. SP500 Historical Annual Returns
```python
from defeatbeta_api.utils.util import load_sp500_historical_annual_returns
load_sp500_historical_annual_returns()
```
```text
>>> load_sp500_historical_annual_returns()
report_date annual_returns
0 1928-12-31 0.3788
1 1929-12-31 -0.1191
2 1930-12-31 -0.2848
3 1931-12-31 -0.4707
4 1932-12-31 -0.1515
.. ... ...
92 2020-12-31 0.1626
93 2021-12-31 0.2689
94 2022-12-31 -0.1944
95 2023-12-31 0.2423
96 2024-12-31 0.2331
```
## 2. SP500 CAGR Returns
```python
from defeatbeta_api.utils.util import sp500_cagr_returns
sp500_cagr_returns(10)
```
```text
years cagr_returns
0 10 0.1107
```
## 3. SP500 CAGR Returns Rolling
```python
from defeatbeta_api.utils.util import sp500_cagr_returns_rolling
sp500_cagr_returns_rolling(10)
```
```text
start_date end_date start_year end_year cagr_returns_10_years
0 1928-12-31 1937-12-31 1928 1937 -0.0502
1 1929-12-31 1938-12-31 1929 1938 -0.0593
2 1930-12-31 1939-12-31 1930 1939 -0.0526
3 1931-12-31 1940-12-31 1931 1940 -0.0365
4 1932-12-31 1941-12-31 1932 1941 0.0068
5 1933-12-31 1942-12-31 1933 1942 0.0356
6 1934-12-31 1943-12-31 1934 1943 0.0146
7 1935-12-31 1944-12-31 1935 1944 0.0341
8 1936-12-31 1945-12-31 1936 1945 0.0260
9 1937-12-31 1946-12-31 1937 1946 -0.0115
10 1938-12-31 1947-12-31 1938 1947 0.0379
11 1939-12-31 1948-12-31 1939 1948 0.0141
12 1940-12-31 1949-12-31 1940 1949 0.0299
13 1941-12-31 1950-12-31 1941 1950 0.0679
14 1942-12-31 1951-12-31 1942 1951 0.1059
15 1943-12-31 1952-12-31 1943 1952 0.1052
16 1944-12-31 1953-12-31 1944 1953 0.0783
17 1945-12-31 1954-12-31 1945 1954 0.1048
18 1946-12-31 1955-12-31 1946 1955 0.1011
19 1947-12-31 1956-12-31 1947 1956 0.1180
20 1948-12-31 1957-12-31 1948 1957 0.1009
21 1949-12-31 1958-12-31 1949 1958 0.1377
22 1950-12-31 1959-12-31 1950 1959 0.1358
23 1951-12-31 1960-12-31 1951 1960 0.1103
24 1952-12-31 1961-12-31 1952 1961 0.1165
25 1953-12-31 1962-12-31 1953 1962 0.0904
26 1954-12-31 1963-12-31 1954 1963 0.1170
27 1955-12-31 1964-12-31 1955 1964 0.0895
28 1956-12-31 1965-12-31 1956 1965 0.0735
29 1957-12-31 1966-12-31 1957 1966 0.0558
30 1958-12-31 1967-12-31 1958 1967 0.0921
31 1959-12-31 1968-12-31 1959 1968 0.0652
32 1960-12-31 1969-12-31 1960 1969 0.0439
33 1961-12-31 1970-12-31 1961 1970 0.0472
34 1962-12-31 1971-12-31 1962 1971 0.0362
35 1963-12-31 1972-12-31 1963 1972 0.0646
36 1964-12-31 1973-12-31 1964 1973 0.0266
37 1965-12-31 1974-12-31 1965 1974 -0.0210
38 1966-12-31 1975-12-31 1966 1975 -0.0025
39 1967-12-31 1976-12-31 1967 1976 0.0295
40 1968-12-31 1977-12-31 1968 1977 -0.0014
41 1969-12-31 1978-12-31 1969 1978 -0.0077
42 1970-12-31 1979-12-31 1970 1979 0.0160
43 1971-12-31 1980-12-31 1971 1980 0.0395
44 1972-12-31 1981-12-31 1972 1981 0.0184
45 1973-12-31 1982-12-31 1973 1982 0.0177
46 1974-12-31 1983-12-31 1974 1983 0.0539
47 1975-12-31 1984-12-31 1975 1984 0.0933
48 1976-12-31 1985-12-31 1976 1985 0.0888
49 1977-12-31 1986-12-31 1977 1986 0.0846
50 1978-12-31 1987-12-31 1978 1987 0.1002
51 1979-12-31 1988-12-31 1979 1988 0.1119
52 1980-12-31 1989-12-31 1980 1989 0.1259
53 1981-12-31 1990-12-31 1981 1990 0.0930
54 1982-12-31 1991-12-31 1982 1991 0.1303
55 1983-12-31 1992-12-31 1983 1992 0.1197
56 1984-12-31 1993-12-31 1984 1993 0.1096
57 1985-12-31 1994-12-31 1985 1994 0.1063
58 1986-12-31 1995-12-31 1986 1995 0.1129
59 1987-12-31 1996-12-31 1987 1996 0.1183
60 1988-12-31 1997-12-31 1988 1997 0.1466
61 1989-12-31 1998-12-31 1989 1998 0.1604
62 1990-12-31 1999-12-31 1990 1999 0.1531
63 1991-12-31 2000-12-31 1991 2000 0.1487
64 1992-12-31 2001-12-31 1992 2001 0.1066
65 1993-12-31 2002-12-31 1993 2002 0.0728
66 1994-12-31 2003-12-31 1994 2003 0.0908
67 1995-12-31 2004-12-31 1995 2004 0.1019
68 1996-12-31 2005-12-31 1996 2005 0.0732
69 1997-12-31 2006-12-31 1997 2006 0.0671
70 1998-12-31 2007-12-31 1998 2007 0.0423
71 1999-12-31 2008-12-31 1999 2008 -0.0304
72 2000-12-31 2009-12-31 2000 2009 -0.0272
73 2001-12-31 2010-12-31 2001 2010 -0.0049
74 2002-12-31 2011-12-31 2002 2011 0.0091
75 2003-12-31 2012-12-31 2003 2012 0.0495
76 2004-12-31 2013-12-31 2004 2013 0.0521
77 2005-12-31 2014-12-31 2005 2014 0.0544
78 2006-12-31 2015-12-31 2006 2015 0.0505
79 2007-12-31 2016-12-31 2007 2016 0.0467
80 2008-12-31 2017-12-31 2008 2017 0.0618
81 2009-12-31 2018-12-31 2009 2018 0.1075
82 2010-12-31 2019-12-31 2010 2019 0.1122
83 2011-12-31 2020-12-31 2011 2020 0.1156
84 2012-12-31 2021-12-31 2012 2021 0.1425
85 2013-12-31 2022-12-31 2013 2022 0.1041
86 2014-12-31 2023-12-31 2014 2023 0.0994
87 2015-12-31 2024-12-31 2015 2024 0.1107
```
## 4. Daily Treasure Yield
```python
from defeatbeta_api.data.treasure import Treasure
treasure = Treasure()
treasure.daily_treasure_yield()
```
```text
report_date bc1_month bc2_month ... bc7_year bc10_year bc30_year
0 1990-01-02 NaN NaN ... 0.0798 0.0794 0.0800
1 1990-01-03 NaN NaN ... 0.0804 0.0799 0.0804
2 1990-01-04 NaN NaN ... 0.0802 0.0798 0.0804
3 1990-01-05 NaN NaN ... 0.0803 0.0799 0.0806
4 1990-01-08 NaN NaN ... 0.0805 0.0802 0.0809
... ... ... ... ... ... ... ...
8932 2025-09-15 0.0422 0.0417 ... 0.0379 0.0405 0.0466
8933 2025-09-16 0.0420 0.0415 ... 0.0378 0.0404 0.0465
8934 2025-09-17 0.0417 0.0411 ... 0.0381 0.0406 0.0466
8935 2025-09-18 0.0420 0.0414 ... 0.0386 0.0411 0.0472
8936 2025-09-19 0.0419 0.0414 ... 0.0388 0.0414 0.0475
```