Skip to content

Conversation

@apeoverflow
Copy link
Contributor

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.

@crestalnetwork crestalnetwork deleted a comment from Cngok88 Feb 7, 2025
@kikysykes
Copy link

I just started hahahaha

@kikysykes
Copy link

Someone help me for my life.. I need some money

Copy link
Collaborator

@hyacinthus hyacinthus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should pass the key in get_cryptocompare_skill instead of using an environment variable to get it.

Our generic skill loading mode is not fully finalized yet. After addressing the above issues, this PR should be fine as skills. We will make a few change later to allow it to be configurable and loaded by agent.

@apeoverflow
Copy link
Contributor Author

Hey @hyacinthus ,

Made the changes you advised.

FYI: doing this PR for the EthGlobal Hackathon

@hyacinthus
Copy link
Collaborator

Hey @hyacinthus ,

Made the changes you advised.

FYI: doing this PR for the EthGlobal Hackathon

Thanks, I'll test them tomorrow.

Copy link
Collaborator

@hyacinthus hyacinthus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test still cannot pass; please address the outstanding issues. Thank you.

@apeoverflow
Copy link
Contributor Author

Hi, The above issues have been resolved. Can you check the skill again. Thank you.

@hyacinthus hyacinthus merged commit c63af41 into crestalnetwork:main Feb 13, 2025
1 check failed
hyacinthus added a commit that referenced this pull request Jul 10, 2025
feat: crypto compare api integration skill set
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

4 participants