Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openbb-defillama extension to add DeFillama provider into the OpenBB Platform #6731

Open
wants to merge 87 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
1936c44
add tvl chains from defillama using defillama-curl
the-praxs Oct 3, 2024
ceb9b05
add `/crypto/tvl/chains` command to `openbb-crypto` extension
the-praxs Oct 3, 2024
e84efaf
minor change in class description
the-praxs Oct 3, 2024
7e42df3
black
the-praxs Oct 3, 2024
def04ac
Merge branch 'develop' into develop
the-praxs Oct 3, 2024
4c0b06c
add `/crypto/tvl/current` to fetch current tvl of a protocol
the-praxs Oct 3, 2024
21b9abd
black
the-praxs Oct 3, 2024
2a4e814
add `/crypto/tvl/historical` to fetch protocols/chains TVL data
the-praxs Oct 3, 2024
8bc28ce
Merge branch 'develop' into develop
the-praxs Oct 3, 2024
bace3e4
add `/crypto/yields/pools` commands to fetch latest data for all pools
the-praxs Oct 4, 2024
dfa9a43
add `/crypto/yields/historical` command to fetch historical tvl and a…
the-praxs Oct 4, 2024
91d6e2d
Merge branch 'develop' into develop
deeleeramone Oct 4, 2024
0ba568c
fix description
the-praxs Oct 5, 2024
6ce4f1b
add `/crypto/fees` router to fetch fees data from fees & revenue dasb…
the-praxs Oct 7, 2024
7ada297
add `/crypto/revenue` to fetch revenue data from the fees & revenue d…
the-praxs Oct 7, 2024
d451080
black
the-praxs Oct 7, 2024
2ed79e4
Merge branch 'OpenBB-finance:develop' into develop
the-praxs Oct 11, 2024
8a21452
add `/crypto/volumes/` to retrieve volumes data from defillama
the-praxs Oct 11, 2024
36db83a
add `/crypto/coins/block` command for `/block/{chain}/{timestamp}` de…
the-praxs Oct 11, 2024
3ec518c
linting
the-praxs Oct 11, 2024
5f2d760
add `/crypto/coins/current` to fetch data from `/prices/current/{coin…
the-praxs Oct 12, 2024
ae01189
reworded descriptions for commands
the-praxs Oct 12, 2024
80ed28e
modifed `/crypto/coins/block` model to `CoinsBlockTimestamp`
the-praxs Oct 12, 2024
c9a6408
linting
the-praxs Oct 12, 2024
4320b02
add validation for symbol in data
the-praxs Oct 12, 2024
4593ac2
refactoring
the-praxs Oct 12, 2024
96b298a
correct model name in defillama init
the-praxs Oct 12, 2024
231b4c5
add `/crypto/coins/first` to fetch data for `/prices/first/{coins}` d…
the-praxs Oct 12, 2024
b4a7deb
Merge branch 'OpenBB-finance:develop' into develop
the-praxs Oct 12, 2024
f8e2c67
add `/crypto/coins/change` to fetch data from `/percentage/{coins}` d…
the-praxs Oct 12, 2024
6a575dc
add `/crypto/coins/chart` to fetch data from `/chart/{coins}` defilla…
the-praxs Oct 12, 2024
67cebba
add `/crypto/coins/historical` for coins historical price data from d…
the-praxs Oct 12, 2024
7d937b5
linting
the-praxs Oct 12, 2024
a96925c
fix `transform_query` function signature by making `params` correct type
the-praxs Oct 12, 2024
3cdd2bf
Merge branch 'OpenBB-finance:develop' into develop
the-praxs Oct 19, 2024
95c4c83
rename `CoinsBlockTimestamp` to `BlockTimestamp`
the-praxs Oct 19, 2024
5d88886
add `/crypto/stablecoins/list` for `GET /stablecoinchains` defillama API
the-praxs Oct 19, 2024
cd98608
modify model code to reflect correct endpoint and data
the-praxs Oct 19, 2024
2149681
add `/crypto/stablecoins/current` to fetch data from `GET /stablecoin…
the-praxs Oct 19, 2024
fc7015a
add `/crypto/stablecoins/historical` to fetch data from `GET /stablec…
the-praxs Oct 19, 2024
6676846
add `/crypto/stablecoins/distribution` to fetch data from `GET /stabl…
the-praxs Oct 20, 2024
3edb86b
linting
the-praxs Oct 20, 2024
2eefa51
add `/crypto/stablecoins/charts` to fetch data from `GET /stablecoinc…
the-praxs Oct 20, 2024
9aefe67
add `openbb-defillama` to `dev_install.py` and openbb `pyproject.toml`
the-praxs Oct 20, 2024
5d64c2c
check for `poetry` installation
the-praxs Oct 20, 2024
a649528
linting
the-praxs Oct 20, 2024
cfe79f6
removed deprecated block for `python<3.9` typing import
the-praxs Oct 20, 2024
cc2de57
linting
the-praxs Oct 20, 2024
b5711fe
fix line too long
the-praxs Oct 20, 2024
5c62f86
reorder alphabetically
the-praxs Oct 20, 2024
1361f98
Merge branch 'OpenBB-finance:develop' into develop
the-praxs Oct 23, 2024
f898b4a
clean docstrings of defillama-modules
the-praxs Oct 24, 2024
bdbcf5b
Merge branch 'develop' into develop
the-praxs Oct 26, 2024
4563822
black
the-praxs Oct 26, 2024
cea733e
add examples in crypto `coins_router.py`
the-praxs Oct 27, 2024
0c22bba
add examples in crypto `fees_router.py`
the-praxs Oct 27, 2024
e8c645f
add examples in crypto `revenue_router.py`
the-praxs Oct 27, 2024
4e15f9e
add examples in crypto `volumes_router.py`
the-praxs Oct 27, 2024
fb4e803
add examples in crypto `yields_router.py`
the-praxs Oct 27, 2024
49da9b9
typo in `symbol` variable description
the-praxs Oct 27, 2024
8606532
add examples in crypto `tvl_router.py`
the-praxs Oct 27, 2024
1a8fb1a
setting `default` value first in `include_prices` query params
the-praxs Oct 27, 2024
5da3ce0
fix typo in `stablecoin` query params description
the-praxs Oct 27, 2024
66c023d
add examples in crypto `stablecoins_router.py`
the-praxs Oct 27, 2024
a5f82df
removed local import for `DeFiLlamaCoinsBlockTimestampFetcher`
the-praxs Oct 27, 2024
258b874
remove all `PythonEx` examples from routers in `crypto` extension
the-praxs Oct 27, 2024
6946eb7
remove `List` type from Data class in Fetcher
the-praxs Oct 27, 2024
15ca5e5
fix `DeFiLlamaRevenueSummaryData` model class to make data optional a…
the-praxs Oct 27, 2024
627f66a
use exception handling to raise error on empty data
the-praxs Oct 27, 2024
2c48e08
modified `litecoin` to `uniswap` to fetch correct data in examples
the-praxs Oct 27, 2024
d63e24d
fix error with query by removing `start_date` or `end_date`
the-praxs Oct 27, 2024
d78ef12
remove `List` from `DeFiLlamaCoinsBlockTimestampData`class in Fetcher…
the-praxs Oct 27, 2024
19e836c
remove query params check for `start_date` or `end_date`
the-praxs Oct 27, 2024
25c404a
make `source` as `Optional` in `DeFiLlamaProtocolRaisesData` class
the-praxs Oct 27, 2024
92cc140
linting defillama models
the-praxs Oct 27, 2024
849a6ea
reduce `span` to `10` in `chart` example
the-praxs Oct 27, 2024
4aac505
fix incorrect query params in `/crypto/volumes` command
the-praxs Oct 27, 2024
4f96f4d
add tests for defillama endpoints added to `/crypto` command
the-praxs Oct 27, 2024
f2aa38c
add fetcher test for `openbb-defillama`
the-praxs Oct 27, 2024
452e93a
fix missing params in crypto api tests
the-praxs Oct 27, 2024
b0c6713
linting
the-praxs Oct 27, 2024
4c7b646
add docstring
the-praxs Oct 27, 2024
8c9fe2e
add lock file for `openbb-defillama`
the-praxs Oct 27, 2024
42c0c9a
Merge branch 'develop' into develop
the-praxs Oct 29, 2024
fc29c0a
Merge branch 'develop' into develop
the-praxs Oct 31, 2024
f5cb7e5
Merge branch 'develop' into develop
the-praxs Nov 4, 2024
6a0be87
Merge branch 'develop' into develop
the-praxs Nov 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import inspect
import re
import shutil
import sys
from dataclasses import Field as DCField
from functools import partial
from inspect import Parameter, _empty, isclass, signature
Expand Down Expand Up @@ -377,10 +376,7 @@ def build(cls, path: str) -> str:
code += "\nfrom typing import TYPE_CHECKING, ForwardRef, List, Dict, Union, Optional, Literal, Any"
code += "\nfrom annotated_types import Ge, Le, Gt, Lt"
code += "\nfrom warnings import warn, simplefilter"
if sys.version_info < (3, 9):
code += "\nimport typing_extensions"
else:
code += "\nfrom typing_extensions import Annotated, deprecated"
code += "\nfrom typing_extensions import Annotated, deprecated"
# code += "\nfrom openbb_core.app.utils import df_to_basemodel"
code += "\nfrom openbb_core.app.static.utils.decorators import exception_handler, validate\n"
code += "\nfrom openbb_core.app.static.utils.filters import filter_inputs\n"
Expand Down
2 changes: 1 addition & 1 deletion openbb_platform/core/tests/app/static/test_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def test_container__check_credentials(container):
OpenBBError,
escape(
"Provider fallback failed."
"\n[Providers]\n * 'x' -> not installed, please install openbb-x\n * 'y' -> not installed, please install openbb-y\n * 'z' -> not installed, please install openbb-z"
"\n[Providers]\n * 'x' -> not installed, please install openbb-x\n * 'y' -> not installed, please install openbb-y\n * 'z' -> not installed, please install openbb-z" # noqa: E501
),
),
],
Expand Down
5 changes: 5 additions & 0 deletions openbb_platform/dev_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# flake8: noqa: S603

import shutil
import subprocess
import sys
from pathlib import Path
Expand Down Expand Up @@ -55,6 +56,7 @@
openbb-alpha-vantage = { path = "./providers/alpha_vantage", optional = true, develop = true }
openbb-biztoc = { path = "./providers/biztoc", optional = true, develop = true }
openbb-cboe = { path = "./providers/cboe", optional = true, develop = true }
openbb-defillama = { path = "./providers/defillama", optional = true, develop = true }
openbb-ecb = { path = "./providers/ecb", optional = true, develop = true }
openbb-finra = { path = "./providers/finra", optional = true, develop = true }
openbb-finviz = { path = "./providers/finviz", optional = true, develop = true }
Expand Down Expand Up @@ -139,6 +141,9 @@ def install_platform_local(_extras: bool = False):
TEMP_PYPROJECT = dumps(pyproject_toml)

try:
if shutil.which("poetry") is None:
raise Exception("poetry not found. Please install poetry first.")

with open(PYPROJECT, "w", encoding="utf-8", newline="\n") as f:
f.write(TEMP_PYPROJECT)

Expand Down
Loading
Loading