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

feat: crypto compare api integration skill set #172

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

0xkieranwilliams
Copy link

Description

Please include a summary of the changes and the related issue.

Type of Change

  • Bugfix
  • New Feature
  • Improvement
  • Documentation Update

Checklist

  • I have read the contributing guidelines.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Related Issue

Add CryptoCompare Skills Module

Description

This PR introduces a new CryptoCompare skills module that integrates with the CryptoCompare API. The module expands our platform’s capabilities by providing tools to fetch various cryptocurrency-related data, including:

  • News Articles: Retrieve the latest news for specific tokens, with an option to use a custom timestamp for historical queries.
  • Price Data: Fetch real-time price information for a base cryptocurrency against a list of target currencies.
  • Trading Signals: Get advanced trading signals and market indicators for a given cryptocurrency.
  • Top Market Cap: Retrieve the top cryptocurrencies ranked by market capitalization.
  • Top Exchanges: Fetch information on the top exchanges for specific trading pairs.
  • Top Volume: Identify the most actively traded cryptocurrencies by volume.

The module is structured similarly to our existing Twitter and Moralis skills modules to ensure consistency across our codebase.

Changes

  • New Directory and Files:

    • Created a new folder: skills/cryptocompare/
    • Added the following files:
      • __init__.py: Contains the factory function get_cryptocompare_skill which maps skill names to their respective tool classes.
      • api.py: Houses API configuration (base URL, API key), shared input schemas, API functions, and prompt strings.
      • base.py: Implements the CryptoCompareBaseTool with common functionalities such as rate limiting.
      • Individual tool files:
        • fetch_news.py
        • fetch_price.py
        • fetch_trading_signals.py
        • fetch_top_market_cap.py
        • fetch_top_exchanges.py
        • fetch_top_volume.py
  • API Integration:

    • All API calls use the CRYPTO_COMPARE_API_KEY environment variable for authentication.
    • The module leverages synchronous API calls wrapped in asynchronous functions with proper error handling and rate limiting.

Motivation

Integrating CryptoCompare data will allow our platform to source robust and comprehensive cryptocurrency insights, enhancing our analytical capabilities and providing richer data to our users.

Testing

  • Manual tests have confirmed that each tool successfully communicates with the CryptoCompare API.
  • Verified that the rate limiting mechanism is working as expected to prevent API abuse.
  • Tested data retrieval for news, price, trading signals, top market cap, top exchanges, and top volume.

Closes #171

@hyacinthus
Copy link
Collaborator

Thank you for contributing the code; it looks great. I’m testing your code locally and will provide you with feedback later. Thank you.

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 this pull request may close these issues.

Feat: Crypto Compare API integration Skill
2 participants