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

Invalid Defillama slugs #690

Closed
Jabolol opened this issue Mar 6, 2025 · 0 comments · Fixed by #691
Closed

Invalid Defillama slugs #690

Jabolol opened this issue Mar 6, 2025 · 0 comments · Fixed by #691
Assignees

Comments

@Jabolol
Copy link
Contributor

Jabolol commented Mar 6, 2025

Some Defillama slugs currently in this repo are invalid (that is, https://api.llama.fi/protocol/{protocol} is not a valid API route). Here's the list:

(oss_directory) FAIL >> 'aave_arc': 400 Bad Request
(oss_directory) FAIL >> 'kelp-gain': 400 Bad Request
(oss_directory) FAIL >> 'kelp-rseth': 400 Bad Request
(oss_directory) FAIL >> 'pancakeswap-amm-stableswap': 400 Bad Request
(oss_directory) FAIL >> 'pancakeswap-amm-perps': 400 Bad Request
(oss_directory) FAIL >> 'pancakeswap-amm-options': 400 Bad Request

And here's the script I used to fetch them, with oss-directory==0.2.4 (latest):

import requests
from typing import List
from ossdirectory import fetch_data


def check_slugs_for_source(urls: List[str], source: str) -> None:
    for protocol in urls:
        try:
            r = requests.head(f"https://api.llama.fi/protocol/{protocol}", timeout=10)
            if r.status_code != 200:
                print(f"({source}) FAIL >> '{protocol}': {r.status_code} {r.reason}")
        except requests.RequestException:
            # Big protocols need some time. If it doesn't instantly fail, it exists (normally)
            pass


ossd_defillama_slugs = [
    value["url"].split("/")[-1]
    for entry in fetch_data().projects
    if entry.get("defillama")
    for value in entry["defillama"]
]

check_slugs_for_source(ossd_defillama_slugs, "oss_directory")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant