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

Feature/add coinmarketcap plugin #1773

Merged
merged 13 commits into from
Jan 8, 2025

Conversation

Lukapetro
Copy link
Contributor

image

CoinMarketCap Plugin for Eliza

Risks

Low - This is an additive change that introduces a new plugin without modifying existing functionality. The main risks are:

  • Rate limiting from CoinMarketCap API (Stricter limits compared to CoinGecko)
  • Potential timeout issues when the API is slow
  • Invalid cryptocurrency symbols causing failed requests
  • Cost implications as CoinMarketCap API is a paid service

Background

What does this PR do?

  • Adds a new CoinMarketCap plugin for cryptocurrency price checking
  • Implements a GET_PRICE action that fetches current prices using the v1 API
  • Provides TypeScript types and interfaces for CoinMarketCap API responses
  • Includes environment validation for API key configuration
  • Adds proper error handling for API calls and symbol validation

What kind of change is this?

Features (non-breaking change which adds functionality):

  • New plugin implementation
  • New paid API integration
  • New TypeScript types and validation

Documentation changes needed?

My changes require a change to the project documentation:

  • Add CoinMarketCap plugin setup instructions
  • Document required API key configuration
  • Add usage examples for price checking
  • Update plugin list in main documentation
  • Add pricing/rate limit considerations

Testing

Where should a reviewer start?

  1. Review the plugin implementation in /plugin-coinmarketcap/src/
  2. Check the main action implementation in index.ts
  3. Verify API service in service.ts
  4. Review type definitions in types.ts
  5. Check template handling in template.ts

Detailed testing steps

  1. Set up environment:

    COINMARKETCAP_API_KEY=your_api_key
  2. Run agent locally and test natural language queries:

    • "What's the current price of Bitcoin?"
    • "Show me ETH price in USD"
    • "Get the price of SOL"
  3. Verify error handling:

    • Try with invalid symbols
    • Test API timeout scenarios
    • Check rate limit handling
    • Verify currency conversion handling

Future Expansion

1. Extended CoinMarketCap Integration

  • Add support for all available cryptocurrencies
  • Include market data (market cap, volume, supply)
  • Add historical price data
  • Support multiple currency conversions
  • Implement proper rate limit handling

2. Additional API Features

  • /cryptocurrency/map - Add support for symbol/id mapping
  • /cryptocurrency/info - Include detailed crypto metadata
  • /cryptocurrency/listings/latest - Add market data sorting and filtering
  • /cryptocurrency/categories - Support category-based queries
  • /global-metrics/quotes/latest - Add global market metrics

3. Enhanced Features

  • Price alerts configuration
  • Multi-currency price comparisons
  • Historical data analysis
  • Price change tracking
  • Market data aggregation
  • Advanced symbol resolution
  • Improved error messaging

Discord username

0xspit

@odilitime odilitime added the Plugin_new Mark PRs that are a new plugin label Jan 3, 2025
@Lukapetro
Copy link
Contributor Author

@odilitime @wtfsayo conflicts resolved, feel free to take a look and merge

@wtfsayo wtfsayo self-requested a review January 8, 2025 10:34
@wtfsayo wtfsayo requested a review from shakkernerd January 8, 2025 10:45
@wtfsayo
Copy link
Member

wtfsayo commented Jan 8, 2025

@shakkernerd can't merge myself; lgtm

@wtfsayo wtfsayo merged commit 0e74e13 into elizaOS:develop Jan 8, 2025
2 of 3 checks passed
@pgoos
Copy link
Contributor

pgoos commented Jan 8, 2025

Why have we merged that code with broken workflow integration-tests? The build process is broken here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Plugin_new Mark PRs that are a new plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants