eliza icon indicating copy to clipboard operation
eliza copied to clipboard

Feature/add coinmarketcap plugin

Open Lukapetro opened this issue 11 months ago • 2 comments

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

Lukapetro avatar Jan 03 '25 20:01 Lukapetro

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

Lukapetro avatar Jan 07 '25 10:01 Lukapetro

@shakkernerd can't merge myself; lgtm

wtfsayo avatar Jan 08 '25 10:01 wtfsayo

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

pgoos avatar Jan 08 '25 16:01 pgoos