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

Fix crypto/defi/vaults not showing for default and -k lp #1957

Merged
merged 3 commits into from
Jun 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion openbb_terminal/cryptocurrency/defi/coindix_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def get_defi_vaults(
data = response.json()["data"]
if len(data) == 0:
return pd.DataFrame()
return pd.DataFrame(data)[VAULTS_FILTERS].fillna("NA")
return pd.DataFrame(data)[VAULTS_FILTERS]
except Exception as e:
logger.exception(e)
raise ValueError(f"Invalid Response: {response.text}") from e
2 changes: 1 addition & 1 deletion openbb_terminal/cryptocurrency/defi/coindix_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def display_defi_vaults(
)
return

df = df.sort_values(by=sortby, ascending=descend)
df = df.sort_values(by=sortby, ascending=descend).fillna("NA")
df["tvl"] = df["tvl"].apply(lambda x: lambda_long_number_format(x))
df["apy"] = df["apy"].apply(
lambda x: f"{str(round(x * 100, 2))} %" if isinstance(x, (int, float)) else x
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,28 @@ interactions:
Connection:
- keep-alive
User-Agent:
- python-requests/2.27.1
- Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:82.1) Gecko/20100101 Firefox/82.1
method: GET
uri: https://apiv2.coindix.com/search?sort=-apy&tvl=1m&kind=all
response:
body:
string: '{"hasPrevPage":false,"hasNextPage":true,"total":1581,"totalPages":50,"data":[{"id":96613,"name":"ESHARE-BNB","icon":"https://api.coindix.com/icons/ESHARE-BNB.png","chain":"BNB Chain","protocol":"Beefy","base":30.42511882,"reward":0,"rewards":{},"apy":30.42511882,"tvl":1592553,"link":"https://api.coindix.com/vault/96613/redirect","is_new":false,"watched":false},{"id":77959,"name":"ust-wormholeUST-3Crv","icon":"https://api.coindix.com/icons/ust-wormholeUST+3Crv.png","chain":"Ethereum","protocol":"Convex","base":0.0898,"reward":14.8516,"rewards":{"CRV":8.125599999999999,"CVX":6.726},"apy":14.9414,"tvl":2600000,"link":"https://api.coindix.com/vault/77959/redirect","is_new":false,"watched":false},{"id":50508,"name":"GRAPE-MIM","icon":"https://api.coindix.com/icons/GRAPE-MIM.png","chain":"Avalanche","protocol":"Beefy","base":12.53196591,"reward":0,"rewards":{},"apy":12.53196591,"tvl":1109040,"link":"https://api.coindix.com/vault/50508/redirect","is_new":false,"watched":false},{"id":75836,"name":"BSHARE-FTM","icon":"https://api.coindix.com/icons/BSHARE-FTM.png","chain":"Fantom","protocol":"Beefy","base":11.58813773,"reward":0,"rewards":{},"apy":11.58813773,"tvl":1648934,"link":"https://api.coindix.com/vault/75836/redirect","is_new":false,"watched":false},{"id":75835,"name":"BASED-TOMB","icon":"https://api.coindix.com/icons/BASED-TOMB.png","chain":"Fantom","protocol":"Beefy","base":5.27602349,"reward":0,"rewards":{},"apy":5.27602349,"tvl":1135801,"link":"https://api.coindix.com/vault/75835/redirect","is_new":false,"watched":false},{"id":96612,"name":"EMP-ETH","icon":"https://api.coindix.com/icons/EMP-ETH.png","chain":"BNB Chain","protocol":"Beefy","base":3.64525182,"reward":0,"rewards":{},"apy":3.64525182,"tvl":1258560,"link":"https://api.coindix.com/vault/96612/redirect","is_new":false,"watched":false},{"id":103379,"name":"BADGER-WBTC","icon":"https://api.coindix.com/icons/BADGER-WBTC-NEW.png","chain":"Ethereum","protocol":"Balancer","base":0.023,"reward":3.3817,"rewards":{"Max BAL":2.4155,"Min BAL":0.9662000000000001},"apy":3.4047,"tvl":15240604,"link":"https://api.coindix.com/vault/103379/redirect","is_new":false,"watched":false},{"id":120475,"name":"BSW-BNB","icon":"https://api.coindix.com/icons/BSW-BNB.png","chain":"BNB Chain","protocol":"Alpaca","base":0.19856523,"reward":3.03549494,"rewards":{"ALPACA":0.010639233528841602},"apy":2.80859948,"tvl":1873050,"link":"https://api.coindix.com/vault/120475/redirect","is_new":false,"watched":false},{"id":143897,"name":"WBTC-OSMO","icon":"https://api.coindix.com/default_icon.png","chain":"Osmosis","protocol":"Osmosis","base":2.312,"reward":0,"rewards":{},"apy":2.312,"tvl":4730492,"link":"https://api.coindix.com/vault/143897/redirect","is_new":true,"watched":false},{"id":59324,"name":"ROWAN-OSMO","icon":"https://api.coindix.com/icons/ROWAN-OSMO.png","chain":"Osmosis","protocol":"Osmosis","base":2.2872,"reward":0,"rewards":{},"apy":2.2872,"tvl":1834223,"link":"https://api.coindix.com/vault/59324/redirect","is_new":false,"watched":false},{"id":35035,"name":"CAKE-BUSD","icon":"https://api.coindix.com/icons/CAKE-BUSD.png","chain":"BNB Chain","protocol":"Alpaca","base":0.78121807,"reward":1.05165023,"rewards":{"ALPACA":0.03465277361996981},"apy":2.04617026,"tvl":4480007,"link":"https://api.coindix.com/vault/35035/redirect","is_new":false,"watched":false},{"id":135902,"name":"DAI-OSMO","icon":"https://api.coindix.com/icons/DAI-OSMO.png","chain":"Osmosis","protocol":"Osmosis","base":1.6725,"reward":0,"rewards":{},"apy":1.6725,"tvl":4371544,"link":"https://api.coindix.com/vault/135902/redirect","is_new":false,"watched":false},{"id":134578,"name":"USDC-OSMO","icon":"https://api.coindix.com/icons/USDC-OSMO.png","chain":"Osmosis","protocol":"Osmosis","base":1.403,"reward":0,"rewards":{},"apy":1.403,"tvl":25314311,"link":"https://api.coindix.com/vault/134578/redirect","is_new":false,"watched":false},{"id":16709,"name":"VVS-CRO","icon":"https://api.coindix.com/icons/VVS-CRO.png","chain":"Cronos","protocol":"Beefy","base":1.3365707,"reward":0,"rewards":{},"apy":1.3365707,"tvl":1011871,"link":"https://api.coindix.com/vault/16709/redirect","is_new":false,"watched":false},{"id":29984,"name":"ZERO-WETH","icon":"https://api.coindix.com/icons/ZERO-WETH.png","chain":"Ethereum","protocol":"Uniswap","base":1.31960048,"reward":0,"rewards":{},"apy":1.31960048,"tvl":1559733,"link":"https://api.coindix.com/vault/29984/redirect","is_new":false,"watched":false},{"id":105317,"name":"PTP","icon":"https://api.coindix.com/icons/PTP.png","chain":"Avalanche","protocol":"Vector","base":0,"reward":1.28748507,"rewards":{"PTP":0.2565863183878838,"VTX":1.0308987475572733},"apy":1.28748507,"tvl":1503929,"link":"https://api.coindix.com/vault/105317/redirect","is_new":false,"watched":false},{"id":35019,"name":"CAKE-USDT","icon":"https://api.coindix.com/icons/CAKE-USDT.png","chain":"BNB Chain","protocol":"Alpaca","base":0.22087476,"reward":1.0938928,"rewards":{"ALPACA":0.005928218519989986},"apy":1.2138105,"tvl":1027282,"link":"https://api.coindix.com/vault/35019/redirect","is_new":false,"watched":false},{"id":40917,"name":"VVS-WCRO","icon":"https://api.coindix.com/icons/CRO-VVS.png","chain":"Cronos","protocol":"VVS","base":0.0079,"reward":1.19399809,"rewards":{},"apy":1.20189809,"tvl":47140000,"link":"https://api.coindix.com/vault/40917/redirect","is_new":false,"watched":false},{"id":135903,"name":"WETH-OSMO","icon":"https://api.coindix.com/icons/WETH-OSMO.png","chain":"Osmosis","protocol":"Osmosis","base":1.1909,"reward":0,"rewards":{},"apy":1.1909,"tvl":9242039,"link":"https://api.coindix.com/vault/135903/redirect","is_new":false,"watched":false},{"id":40922,"name":"VVS-USDT","icon":"https://api.coindix.com/icons/VVS-USDT.png","chain":"Cronos","protocol":"VVS","base":0.0265,"reward":1.14577941,"rewards":{},"apy":1.17227941,"tvl":3730000,"link":"https://api.coindix.com/vault/40922/redirect","is_new":false,"watched":false}]}'
string: '{"hasPrevPage":false,"hasNextPage":true,"total":1331,"totalPages":50,"data":[{"id":120568,"name":"WETH-10k","icon":"https://api.coindix.com/default_icon.png","chain":"Ethereum","protocol":"Uniswap","base":null,"reward":0,"rewards":{},"apy":null,"tvl":1698882,"link":"https://api.coindix.com/vault/120568/redirect","is_new":false,"watched":false},{"id":113873,"name":"Azuki-WETH","icon":"https://api.coindix.com/icons/Azuki-WETH.png","chain":"Ethereum","protocol":"Uniswap","base":null,"reward":0,"rewards":{},"apy":null,"tvl":1180607,"link":"https://api.coindix.com/vault/113873/redirect","is_new":false,"watched":false},{"id":111282,"name":"WETH-RYOSHI","icon":"https://api.coindix.com/icons/WETH-RYOSHI.png","chain":"Ethereum","protocol":"Uniswap","base":null,"reward":0,"rewards":{},"apy":null,"tvl":1569332,"link":"https://api.coindix.com/vault/111282/redirect","is_new":false,"watched":false},{"id":110372,"name":"Hasbro-WETH","icon":"https://api.coindix.com/default_icon.png","chain":"Ethereum","protocol":"Uniswap","base":null,"reward":0,"rewards":{},"apy":null,"tvl":1025188,"link":"https://api.coindix.com/vault/110372/redirect","is_new":false,"watched":false},{"id":118073,"name":"WETH-GENIE","icon":"https://api.coindix.com/default_icon.png","chain":"Ethereum","protocol":"Uniswap","base":null,"reward":0,"rewards":{},"apy":null,"tvl":1770296,"link":"https://api.coindix.com/vault/118073/redirect","is_new":false,"watched":false},{"id":165735,"name":"WETH-PRAG","icon":"https://api.coindix.com/default_icon.png","chain":"Ethereum","protocol":"Uniswap","base":null,"reward":0,"rewards":{},"apy":null,"tvl":1359190,"link":"https://api.coindix.com/vault/165735/redirect","is_new":false,"watched":false},{"id":113531,"name":"APELAND-WETH","icon":"https://api.coindix.com/default_icon.png","chain":"Ethereum","protocol":"Uniswap","base":null,"reward":0,"rewards":{},"apy":null,"tvl":1216107,"link":"https://api.coindix.com/vault/113531/redirect","is_new":false,"watched":false},{"id":108126,"name":"Line-WETH","icon":"https://api.coindix.com/default_icon.png","chain":"Ethereum","protocol":"Uniswap","base":null,"reward":0,"rewards":{},"apy":null,"tvl":2065257,"link":"https://api.coindix.com/vault/108126/redirect","is_new":false,"watched":false},{"id":167534,"name":"USDC-CRV","icon":"https://api.coindix.com/default_icon.png","chain":"Ethereum","protocol":"Uniswap","base":null,"reward":0,"rewards":{},"apy":null,"tvl":1721977,"link":"https://api.coindix.com/vault/167534/redirect","is_new":false,"watched":false},{"id":121969,"name":"USDD-USDT
(0.01%)","icon":"https://api.coindix.com/icons/USDD-USDT.png","chain":"Ethereum","protocol":"Uniswap","base":null,"reward":0,"rewards":{},"apy":null,"tvl":3925917,"link":"https://api.coindix.com/vault/121969/redirect","is_new":false,"watched":false},{"id":97162,"name":"WETH-DOODLE","icon":"https://api.coindix.com/icons/WETH-DOODLE.png","chain":"Ethereum","protocol":"Uniswap","base":null,"reward":0,"rewards":{},"apy":null,"tvl":2886965,"link":"https://api.coindix.com/vault/97162/redirect","is_new":false,"watched":false},{"id":112952,"name":"HOOT-WETH","icon":"https://api.coindix.com/default_icon.png","chain":"Ethereum","protocol":"Uniswap","base":null,"reward":0,"rewards":{},"apy":null,"tvl":1474099,"link":"https://api.coindix.com/vault/112952/redirect","is_new":false,"watched":false},{"id":95445,"name":"Firefox-WETH","icon":"https://api.coindix.com/icons/Firefox-WETH.png","chain":"Ethereum","protocol":"Uniswap","base":null,"reward":0,"rewards":{},"apy":null,"tvl":1963426,"link":"https://api.coindix.com/vault/95445/redirect","is_new":false,"watched":false},{"id":178382,"name":"WBTC-BBTC
(0.05%)","icon":"https://api.coindix.com/default_icon.png","chain":"Ethereum","protocol":"Uniswap","base":null,"reward":0,"rewards":{},"apy":null,"tvl":4200389,"link":"https://api.coindix.com/vault/178382/redirect","is_new":true,"watched":false},{"id":104732,"name":"WETH-Richemont","icon":"https://api.coindix.com/default_icon.png","chain":"Ethereum","protocol":"Uniswap","base":null,"reward":0,"rewards":{},"apy":null,"tvl":1630815,"link":"https://api.coindix.com/vault/104732/redirect","is_new":false,"watched":false},{"id":119426,"name":"WETH-OP","icon":"https://api.coindix.com/default_icon.png","chain":"Ethereum","protocol":"Uniswap","base":null,"reward":0,"rewards":{},"apy":null,"tvl":1664803,"link":"https://api.coindix.com/vault/119426/redirect","is_new":false,"watched":false},{"id":50508,"name":"GRAPE-MIM","icon":"https://api.coindix.com/icons/GRAPE-MIM.png","chain":"Avalanche","protocol":"Beefy","base":7.47626288,"reward":0,"rewards":{},"apy":7.47626288,"tvl":1056770,"link":"https://api.coindix.com/vault/50508/redirect","is_new":false,"watched":false},{"id":150035,"name":"WBTC-cxBTC","icon":"https://api.coindix.com/default_icon.png","chain":"Polygon","protocol":"Beefy","base":3.85182283,"reward":0,"rewards":{},"apy":3.85182283,"tvl":1542565,"link":"https://api.coindix.com/vault/150035/redirect","is_new":false,"watched":false},{"id":72936,"name":"ETH-cxETH","icon":"https://api.coindix.com/icons/ETH-cxETH.png","chain":"Polygon","protocol":"Beefy","base":3.76929371,"reward":0,"rewards":{},"apy":3.76929371,"tvl":1547500,"link":"https://api.coindix.com/vault/72936/redirect","is_new":false,"watched":false},{"id":162981,"name":"SHIT-WETH
(1%)","icon":"https://api.coindix.com/default_icon.png","chain":"Ethereum","protocol":"Uniswap","base":3.65199141,"reward":0,"rewards":{},"apy":3.65199141,"tvl":2179266,"link":"https://api.coindix.com/vault/162981/redirect","is_new":false,"watched":false}]}'
headers:
Access-Control-Allow-Origin:
- '*'
Connection:
- keep-alive
Content-Length:
- '32707'
- '5576'
Content-Type:
- application/json; charset=utf-8
Date:
- Fri, 28 Jan 2022 18:50:15 GMT
- Fri, 17 Jun 2022 11:05:53 GMT
ETag:
- W/"7fc3-6d815FTsb0fRj8JQXzD9h991Vso"
- W/"15c8-U7oBaaf65q92UwgeoTPkw3i+bn0"
Server:
- nginx/1.18.0 (Ubuntu)
X-Powered-By:
Expand Down
Loading