๐Ÿš€ Token Metrics Plugin for Virtuals Game

๐ŸŽฏ Supercharge your G.A.M.E agents with AI-powered cryptocurrency analysis!

The Token Metrics plugin seamlessly empowers G.A.M.E agents with comprehensive cryptocurrency analysis capabilities using the Token Metrics API, enabling the retrieval of AI-powered market data, trading signals, and investment insights without introducing any additional complexity.


โœจ Features

  • ๐Ÿ“Š Comprehensive Token Data: Access to 21 Token Metrics API endpoints
  • ๐Ÿค– AI-Powered Analysis: Get AI reports, sentiment analysis, and market insights
  • ๐Ÿ“ˆ Trading Intelligence: Retrieve trader grades, investor grades, and trading signals
  • ๐Ÿ“‰ Market Analytics: Access quantmetrics, OHLCV data, and correlation analysis
  • ๐Ÿ“Š Crypto Indices: Track crypto indices, holdings, and performance data
  • โšก Real-time Data: Current prices, market metrics, and resistance/support levels
  • ๐Ÿ’ฌ Interactive Chat Interface: Built-in chat system for testing and exploration
  • ๐Ÿ›ก๏ธ Robust Error Handling: Built-in error handling and rate limiting

๐Ÿ”ง Available Functions

๐Ÿ“‹ Core Data Functions

Function Description ๐ŸŽฏ Purpose
getTokens Get supported cryptocurrencies and TOKEN_IDs ๐Ÿช™ Token Discovery
getTopMarketCapTokens Retrieve top cryptos by market cap ๐Ÿ‘‘ Market Leaders
getPriceData Get current market prices ๐Ÿ’ฐ Price Tracking

๐Ÿ“Š Trading & Investment Analysis

Function Description ๐ŸŽฏ Purpose
getTraderGrades AI-powered trader performance grades ๐Ÿ† Performance Analysis
getInvestorGrades Investor performance analysis ๐ŸŽฏ Investment Insights
getTradingSignals Buy/sell/hold recommendations ๐Ÿ“ก Trading Signals
getHourlyTradingSignals Hourly AI trading signals with confidence โฐ Real-time Signals
getMarketMetrics Comprehensive market analysis ๐Ÿ“Š Market Overview

๐Ÿ”ฌ Advanced Analytics

Function Description ๐ŸŽฏ Purpose
getQuantmetrics Quantitative trading metrics ๐Ÿงฎ Quant Analysis
getHourlyOhlcv Hourly OHLC data with volume โฐ Short-term Data
getDailyOhlcv Daily OHLC with technical indicators ๐Ÿ“… Long-term Data

๐Ÿค– AI & Research

Function Description ๐ŸŽฏ Purpose
getAiReports AI-generated market reports ๐Ÿ“ Research Reports
getTokenMetricsAi Custom AI analysis queries ๐Ÿง  Custom Analysis
getSentiments Market sentiment analysis ๐Ÿ˜Š Sentiment Tracking
getCryptoInvestors Crypto investor performance ๐Ÿ’ผ Investor Data

๐Ÿ“ˆ Technical Analysis

Function Description ๐ŸŽฏ Purpose
getResistanceSupport Resistance and support levels ๐ŸŽฏ Key Levels
getScenarioAnalysis Scenario-based projections ๐Ÿ”ฎ Future Scenarios
getCorrelation Crypto correlation analysis ๐Ÿ”— Relationship Analysis

๐Ÿ“Š Crypto Indices (NEW!)

Function Description ๐ŸŽฏ Purpose
getIndices Get crypto indices with performance data ๐Ÿ“Š Index Overview
getIndicesHoldings Get index portfolio composition and weights ๐Ÿฆ Portfolio Analysis
getIndicesPerformance Get historical index performance and ROI ๐Ÿ“ˆ Performance Tracking

๐Ÿš€ Quick Start

๐Ÿ“ฆ Installation

# Using npm
npm install tokenmetrics-virtuals-plugin

# Using yarn
yarn add tokenmetrics-virtuals-plugin

๐Ÿ”‘ Environment Setup

Set up your environment variables:

# Copy the example environment file
cp env.example .env

# Edit the .env file with your API keys
export TOKENMETRICS_API_KEY="your-tokenmetrics-api-key"
export GAME_API_KEY="your-game-api-key"

Required Environment Variables:

  • TOKENMETRICS_API_KEY: Your Token Metrics API key (get one from Token Metrics)
  • GAME_API_KEY: Your Virtuals Protocol GAME API key

๐Ÿ’ก How to Get API Keys:

๐Ÿ”‘ Token Metrics API Key:

  1. Visit Token Metrics.com
  2. Sign up for an account or log in
  3. Navigate to API section in your dashboard
  4. Generate your API key (starts with tm-)

๐ŸŽฎ GAME API Key:

  1. Visit Virtuals Protocol
  2. Create an account and access the developer portal
  3. Generate your GAME framework API key

๐Ÿ“ง Need Help? Contact Token Metrics support for API access assistance.

โœ… Installation Verification

Verify your installation works correctly:

# Test the plugin setup
npm run test:setup

# Run a quick example
npm run example:tokens

๐Ÿ’ป Basic Usage

import { config } from "dotenv";
config({ path: "./.env" });
import TokenMetricsPlugin from "tokenmetrics-virtuals-plugin";
import { GameAgent } from "@virtuals-protocol/game";

// ๐Ÿ”ง Initialize the plugin
const tokenMetricsPlugin = new TokenMetricsPlugin({
  apiClientConfig: {
    apiKey: process.env.TOKENMETRICS_API_KEY!,
  },
});

// ๐Ÿค– Create your crypto analysis agent
const agent = new GameAgent(process.env.GAME_API_KEY ?? "", {
  name: "๐Ÿš€ Crypto Analysis Agent",
  goal: "Provide comprehensive cryptocurrency market analysis and trading insights",
  description: "You are an AI agent specialized in cryptocurrency analysis. Use Token Metrics API to help users make informed trading decisions! ๐Ÿ“Š",
  workers: [tokenMetricsPlugin.getWorker({})], // Include ALL 21 functions
});

// ๐ŸŽฏ Run your agent
(async () => {
  // ๐Ÿ“ Optional: Set up logging
  agent.setLogger((agent, message) => {
    console.log(`๐Ÿค– [${agent.name}] ๐Ÿ“ข`);
    console.log(message);
  });

  await agent.init();

  // ๐Ÿš€ Example: Get token list
  const result = await agent.run("Show me the available tokens");
  console.log(result);
})();

โš™๏ธ Custom Configuration

// ๐ŸŽ›๏ธ Customize your worker
const customWorker = tokenMetricsPlugin.getWorker({
  functions: [
    tokenMetricsPlugin.getTokens,
    tokenMetricsPlugin.getPriceData,
    tokenMetricsPlugin.getTradingSignals,
    tokenMetricsPlugin.getIndices,
    tokenMetricsPlugin.getIndicesHoldings,
  ],
  getEnvironment: async () => ({
    customSetting: "value",
  }),
});

๐Ÿ“‹ Configuration Options

interface ITokenMetricsPluginOptions {
  id?: string;           // ๐Ÿ†” Custom worker ID
  name?: string;         // ๐Ÿ“› Custom worker name  
  description?: string;  // ๐Ÿ“ Custom worker description
  apiClientConfig: {
    apiKey: string;      // ๐Ÿ”‘ Token Metrics API key
    baseApiUrl?: string; // ๐ŸŒ Custom API endpoint (optional)
  };
}

๐Ÿ› ๏ธ Development

๐Ÿ—๏ธ Setup

# 1๏ธโƒฃ Clone the repository
git clone <repository-url>

# 2๏ธโƒฃ Install dependencies
npm install

# 3๏ธโƒฃ Set up environment variables
cp env.example .env
# Edit .env file with your API keys:
# TOKENMETRICS_API_KEY=tm-your-tokenmetrics-api-key-here
# GAME_API_KEY=your-game-api-key-here

# 4๏ธโƒฃ Build the plugin
npm run build

# 5๏ธโƒฃ Run the example
npm run example:full-agent
# or
npm run dev

๐Ÿ’ฌ Interactive Chat Interface

Launch the interactive terminal for testing:

npm run chat

๐ŸŽฎ Example Chat Commands

  • ๐Ÿ’ฐ "What's the price of Bitcoin?"
  • ๐Ÿ“Š "Show me trading signals"
  • โฐ "Show me hourly trading signals" (NEW!)
  • ๐Ÿ† "Get trader grades for top tokens"
  • ๐Ÿ˜Š "Analyze market sentiment"
  • ๐Ÿ“ "Show me AI reports"
  • ๐Ÿ”— "Get correlation analysis"
  • ๐Ÿ“Š "Show me crypto indices data" (NEW!)
  • ๐Ÿฆ "What are the holdings of crypto index 1?" (NEW!)
  • ๐Ÿ“ˆ "Show me performance data for crypto index 1" (NEW!)

๐ŸŽฏ Examples & Testing

๐Ÿ“Š Basic Token Data

npm run example:tokens          # ๐Ÿช™ Get token list
npm run example:price-data      # ๐Ÿ’ฐ Get price data
npm run example:top-market-cap  # ๐Ÿ‘‘ Get top market cap tokens

๐Ÿ“ˆ Trading Analysis

npm run example:trader-grades         # ๐Ÿ† Get trader performance grades
npm run example:investor-grades       # ๐ŸŽฏ Get investor analysis
npm run example:trading-signals       # ๐Ÿ“ก Get trading recommendations
npm run example:hourly-trading-signals # โฐ Get hourly AI trading signals (NEW!)

๐Ÿ“‰ Market Analytics

npm run example:market-metrics   # ๐Ÿ“Š Get market analysis
npm run example:quantmetrics     # ๐Ÿงฎ Get quantitative metrics
npm run example:hourly-ohlcv     # โฐ Get hourly price data
npm run example:daily-ohlcv      # ๐Ÿ“… Get daily price data

๐Ÿค– AI & Research

npm run example:ai-reports       # ๐Ÿ“ Get AI-generated reports
npm run example:tokenmetrics-ai  # ๐Ÿง  Query Token Metrics AI
npm run example:sentiments       # ๐Ÿ˜Š Get sentiment analysis
npm run example:crypto-investors # ๐Ÿ’ผ Get crypto investor data

๐Ÿ“ˆ Technical Analysis

npm run example:resistance-support  # ๐ŸŽฏ Get support/resistance levels
npm run example:scenario-analysis   # ๐Ÿ”ฎ Get scenario projections
npm run example:correlation         # ๐Ÿ”— Get correlation analysis

๐Ÿ“Š Crypto Indices (NEW!)

npm run example:indices             # ๐Ÿ“Š Get crypto indices overview
npm run example:indices-holdings    # ๐Ÿฆ Get index portfolio composition
npm run example:indices-performance # ๐Ÿ“ˆ Get historical index performance

๐Ÿงช Testing Suite

npm run test:all                 # ๐Ÿงช Run all tests
npm run test:individual          # ๐Ÿ” Test individual functions
npm run test:integration         # ๐Ÿ”„ Test integration scenarios

๐ŸŽฎ Demo Scenarios

npm run demo:trading-bot         # ๐Ÿค– Trading bot simulation
npm run demo:research-agent      # ๐Ÿ”ฌ Research agent demo
npm run demo:new-endpoints       # โœจ New endpoints demonstration
npm run demo:indices             # ๐Ÿ“Š Crypto indices demo (NEW!)

๐Ÿ“š API Reference

๐Ÿ”ง Core Functions

๐Ÿช™ getTokens(args)

Get the list of supported cryptocurrencies.

Parameters:

  • limit (number): Number of items to return (default: 50)
  • page (number): Page number for pagination (default: 1)
  • token_name (string): Comma-separated crypto asset names
  • symbol (string): Comma-separated token symbols
  • category (string): Comma-separated category names

๐Ÿ’ฐ getPriceData(args)

Get current market prices for specified tokens.

Parameters:

  • token_id (string): Comma-separated Token IDs (required)

๐Ÿ“ก getTradingSignals(args)

Get AI-powered trading recommendations.

Parameters:

  • token_id (string): Comma-separated Token IDs
  • limit (number): Number of signals to return
  • page (number): Page number for pagination

๐Ÿ”ฌ Advanced Functions

๐Ÿงฎ getQuantmetrics(args)

Get comprehensive quantitative trading metrics.

Parameters:

  • token_id (string): Comma-separated Token IDs
  • limit (number): Number of results to return
  • page (number): Page number for pagination

๐Ÿ“ getAiReports(args)

Get AI-generated comprehensive market reports.

Parameters:

  • token_id (string): Comma-separated Token IDs
  • limit (number): Number of reports to return
  • page (number): Page number for pagination

๐Ÿ“Š Crypto Indices Functions (NEW!)

๐Ÿ“Š getIndices(args)

Get crypto indices with performance data.

Parameters:

  • limit (number): Number of indices to return (default: 50)
  • page (number): Page number for pagination (default: 1)

๐Ÿฆ getIndicesHoldings(args)

Get current holdings of a given index with weights.

Parameters:

  • id (string): Index ID (required)
  • limit (number): Number of holdings to return (default: 50)
  • page (number): Page number for pagination (default: 1)

๐Ÿ“ˆ getIndicesPerformance(args)

Get historical performance data for an index with ROI over time.

Parameters:

  • id (string): Index ID (required)
  • limit (number): Number of performance records to return (default: 50)
  • page (number): Page number for pagination (default: 1)

๐Ÿ“– Complete Documentation: Token Metrics API Documentation


๐Ÿ›ก๏ธ Error Handling

The plugin includes comprehensive error handling:

  • โฑ๏ธ Rate Limiting: Automatic rate limiting with configurable delays
  • ๐Ÿ”„ Retry Logic: Exponential backoff for failed requests
  • โœ… Validation: Input validation for all parameters
  • ๐ŸŽฏ Graceful Degradation: Fallback responses for API failures

๐Ÿ”ง Troubleshooting

๐Ÿšจ Common Issues & Solutions

1. API Key Issues

# โŒ Error: "Invalid API key" or "Unauthorized"
# โœ… Solution:
# 1. Verify your Token Metrics API key is correct
# 2. Check that your API key starts with 'tm-'
# 3. Ensure no extra spaces in your .env file
export TOKENMETRICS_API_KEY="tm-your-actual-key-here"

2. Environment Variables Not Loading

# โŒ Error: "API key is undefined"
# โœ… Solution:
# 1. Ensure .env file is in the correct location
# 2. Check that dotenv is properly configured
import { config } from "dotenv";
config({ path: "./.env" }); // Must be before other imports

3. Network/Connection Issues

# โŒ Error: "Network timeout" or "Connection refused"
# โœ… Solutions:
# 1. Check your internet connection
# 2. Verify Token Metrics API is accessible
curl -H "x-api-key: your-key" https://api.tokenmetrics.com/v2/tokens

# 3. Check for firewall/proxy issues
# 4. Try with a different network

4. Rate Limiting

# โŒ Error: "Rate limit exceeded" or "Too many requests"
# โœ… Solutions:
# 1. Reduce request frequency
# 2. Implement delays between calls
# 3. Use pagination with smaller limits
# 4. Contact Token Metrics for higher rate limits

5. Invalid Token IDs

# โŒ Error: "Token not found" or "Invalid token_id"
# โœ… Solution:
# 1. First get valid token IDs:
npm run example:tokens

# 2. Use the TOKEN_ID from the response (e.g., 3375 for BTC)
# 3. Ensure comma-separated format: "3375,3306"

6. Build/TypeScript Issues

# โŒ Error: TypeScript compilation errors
# โœ… Solutions:
# 1. Ensure TypeScript is installed
npm install -g typescript

# 2. Check Node.js version (requires 16+)
node --version

# 3. Clear and rebuild
rm -rf dist/ node_modules/
npm install
npm run build

7. GAME Framework Integration Issues

# โŒ Error: "GameAgent not found" or GAME-related errors
# โœ… Solutions:
# 1. Verify GAME API key is set
export GAME_API_KEY="your-game-api-key"

# 2. Check @virtuals-protocol/game version
npm list @virtuals-protocol/game

# 3. Ensure proper initialization order
await agent.init(); // Must be called before agent.run()

๐Ÿ” Debug Mode

Enable detailed logging for troubleshooting:

// Enable debug logging
const agent = new GameAgent(process.env.GAME_API_KEY!, {
  // ... config
});

agent.setLogger((agent, message) => {
  console.log(`๐Ÿ› [DEBUG] ${agent.name}:`);
  console.log(message);
});

๐Ÿ“Š Testing Your Setup

Run these commands to verify everything works:

# 1. Test environment setup
npm run test:setup

# 2. Test individual functions
npm run test:individual

# 3. Test integration
npm run test:integration

# 4. Interactive testing
npm run chat

๐Ÿ†˜ Getting Help

If you're still having issues:

  1. ๐Ÿ“‹ Check Examples: Review our 22+ example files
  2. ๐Ÿงช Run Tests: Use our comprehensive test suite
  3. ๐Ÿ’ฌ Interactive Mode: Try npm run chat for hands-on testing
  4. ๐Ÿ“– Documentation: Check Token Metrics API Docs
  5. ๐Ÿ› Report Issues: Create a GitHub issue with:
    • Error message
    • Your environment (Node.js version, OS)
    • Steps to reproduce
    • Relevant code snippets

โšก Performance Tips

  • Batch Requests: Use comma-separated token IDs instead of multiple calls
  • Pagination: Use appropriate limit and page parameters
  • Caching: Cache responses for frequently requested data
  • Error Handling: Always wrap API calls in try-catch blocks

๐Ÿงช Dev Testing

๐Ÿ“ธ Screenshots & Visual Demonstrations

๐Ÿš€ Plugin Installation & Setup

Visual demonstration of successful plugin installation and initial setup process

Plugin Installation Setup - Step 1

Initial Setup: Shows the plugin installation process, dependency setup, and environment configuration.

Plugin Installation Setup - Step 2

Setup Verification: Complete setup verification showing successful build, test execution, and plugin readiness confirmation.

๐Ÿ’ฌ Interactive Chat Interface

Screenshots of the interactive terminal chat interface in action

Interactive Chat Interface - Main

Chat Interface: The main Token Metrics AI chat interface showing the welcome screen, available commands, and user interaction prompts.

Interactive Chat Interface - Responses

AI Responses: Example of comprehensive AI responses with color-coded output, data visualization, and detailed analysis results from Token Metrics API.

๐Ÿ“Š Crypto Market Sentiment Analysis

Visual examples of sentiment analysis output and market data visualization

Market Sentiment Analysis

Sentiment Dashboard: Real-time market sentiment analysis with color-coded indicators, sentiment scores, confidence levels, and comprehensive market mood visualization.

๐Ÿฆ Quantitative Metrics Analysis

Advanced quantitative analysis visualization and performance metrics

Quantitative Metrics Dashboard

Quant Analysis: Advanced quantitative metrics including Sharpe ratios, volatility analysis, drawdown calculations, risk-adjusted returns with visual progress bars, and color-coded performance indicators.

๐Ÿงช Testing Steps

1. Basic Setup Testing

npm install tokenmetrics-virtuals-plugin
npm run test:setup
# Expected: All checks pass โœ…

2. Function Testing

npm run test:individual
# Expected: All 21 functions execute successfully

3. Integration Testing

npm run test:integration
# Expected: GAME framework integration works

4. Interactive Testing

npm run chat
# Test various queries and verify responses

๐Ÿ“Š Performance Benchmarks

Function Performance (Average Response Time):
โ€ข getTokens(): ~245ms
โ€ข getPriceData(): ~180ms  
โ€ข getTradingSignals(): ~320ms
โ€ข getTokenMetricsAi(): ~850ms
โ€ข getIndices(): ~210ms

Memory Usage: ~45MB (typical)
Rate Limiting: 60 requests/minute (within limits)

๐Ÿ› Error Handling Examples

Invalid API Key

โŒ Invalid API key provided
๐Ÿ”ง Solution: Verify API key format and permissions

Network Issues

โŒ Network timeout
๐Ÿ”„ Automatic retry with exponential backoff
โœ… Connection restored

๐Ÿ–ฅ๏ธ Cross-Platform Testing

  • โœ… macOS (Intel & Apple Silicon)
  • โœ… Linux (Ubuntu 20.04+)
  • โœ… Windows (10/11)
  • โœ… Node.js versions: 16.x, 18.x, 20.x

๐Ÿค Contributing

We welcome contributions to the Token Metrics Virtuals Plugin! Here's how to contribute effectively:

๐Ÿš€ Quick Start for Contributors

  1. ๐Ÿด Fork & Clone

    git clone https://github.com/your-username/tokenmetrics-virtuals-plugin.git
    cd tokenmetrics-virtuals-plugin
  2. ๐Ÿ“ฆ Install Dependencies

    npm install
  3. ๐Ÿ”‘ Setup Environment

    cp env.example .env
    # Add your API keys to .env file
  4. โœ… Verify Setup

    npm run test:setup
    npm run build

๐ŸŽฏ Contribution Types

๐Ÿ”ง Bug Fixes

  • Fix API integration issues
  • Resolve TypeScript compilation errors
  • Improve error handling
  • Fix documentation inconsistencies

โœจ New Features

  • Add new Token Metrics API endpoints
  • Enhance response formatting
  • Improve chat interface functionality
  • Add new testing scenarios

๐Ÿ“š Documentation

  • Improve README sections
  • Add more usage examples
  • Enhance API documentation
  • Create tutorial content

๐Ÿงช Testing

  • Add test cases for new functions
  • Improve test coverage
  • Create integration test scenarios
  • Add performance benchmarks

๐Ÿ“‹ Development Guidelines

๐Ÿ—๏ธ Code Standards

  • TypeScript: All code must be properly typed
  • ESLint: Follow existing linting rules
  • Formatting: Use consistent code formatting
  • Comments: Document complex logic and API integrations

๐ŸŽฏ Plugin-Specific Requirements

  • GAME Integration: All new functions must use GameFunction pattern
  • Error Handling: Implement proper ExecutableGameFunctionResponse handling
  • API Consistency: Follow existing Token Metrics API patterns
  • Response Formatting: Use color-coded console output for user-friendly responses

๐Ÿงช Testing Requirements

  • Unit Tests: Test individual functions
  • Integration Tests: Test GAME framework integration
  • Example Files: Create example usage files
  • Documentation: Update README with new features

๐Ÿ“ Pull Request Process

Before Submitting:

  1. ๐Ÿ” Test Your Changes

    npm run test:all
    npm run build
    npm run example:your-new-feature
  2. ๐Ÿ“– Update Documentation

    • Update README.md if adding new features
    • Add example files for new functions
    • Update API reference section
    • Update CHANGELOG.md
  3. โœ… Code Quality Checks

    # Ensure TypeScript compiles
    npm run build
    
    # Run all tests
    npm run test:all
    
    # Test examples work
    npm run example:tokens

PR Requirements:

  • ๐Ÿ“‹ Clear Description: Explain what your PR adds/fixes
  • ๐Ÿงช Testing Evidence: Include screenshots, logs, or test results
  • ๐Ÿ“š Documentation: Update relevant documentation
  • ๐Ÿ”— Issue Reference: Link to related issues if applicable

๐ŸŽฏ Specific Areas for Contribution

๐Ÿ”ฅ High Priority

  • New API Endpoints: Add missing Token Metrics endpoints
  • Enhanced Error Handling: Improve error messages and recovery
  • Performance Optimization: Optimize API calls and response processing
  • Testing Coverage: Expand test scenarios

๐Ÿ’ก Enhancement Ideas

  • Real-time Updates: WebSocket integration for live data
  • Data Visualization: Add chart/graph generation capabilities
  • Caching Layer: Implement intelligent response caching
  • Batch Processing: Optimize multiple token requests

๐Ÿ“– Documentation Needs

  • Video Tutorials: Create setup and usage videos
  • Advanced Examples: Complex trading bot scenarios
  • API Migration Guides: Help users migrate from other APIs
  • Best Practices: Performance and usage optimization guides

๐Ÿ› ๏ธ Development Workflow

  1. ๐ŸŒŸ Create Feature Branch

    git checkout -b feature/new-endpoint-integration
  2. ๐Ÿ’ป Develop & Test

    # Make your changes
    # Test thoroughly
    npm run test:individual
    npm run example:your-feature
  3. ๐Ÿ“ Document Changes

    # Update README.md
    # Add example files
    # Update CHANGELOG.md
  4. ๐Ÿ”„ Submit PR

    git add .
    git commit -m "feat: add new Token Metrics endpoint integration"
    git push origin feature/new-endpoint-integration

๐ŸŽ–๏ธ Recognition

Contributors will be:

  • ๐Ÿ“œ Listed in CHANGELOG.md
  • ๐ŸŒŸ Credited in README.md
  • ๐Ÿ† Recognized in release notes
  • ๐Ÿ’ฌ Mentioned in community channels

๐Ÿ“ž Getting Help

Need help contributing?

  • ๐Ÿ’ฌ Discussions: Use GitHub Discussions for questions
  • ๐Ÿ› Issues: Create issues for bugs or feature requests
  • ๐Ÿ“ง Direct Contact: Reach out to maintainers
  • ๐Ÿ“– Documentation: Check our comprehensive guides

๐Ÿ”„ Review Process

  1. ๐Ÿด Fork the repository
  2. ๐ŸŒŸ Create your feature branch (git checkout -b feature/amazing-feature)
  3. ๐Ÿ’พ Commit your changes (git commit -m 'Add some amazing feature')
  4. ๐Ÿ“ค Push to the branch (git push origin feature/amazing-feature)
  5. ๐Ÿ” Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ†˜ Support

Need help? We've got you covered:

  • ๐Ÿ› Bug Reports: Create an issue on GitHub
  • ๐Ÿ”ง API Questions: Contact Token Metrics support
  • ๐Ÿ“š Documentation: Check our comprehensive examples and tests
  • ๐Ÿ’ฌ Community: Join our discussions

๐Ÿ“ˆ Changelog

๐ŸŽ‰ v1.0.0

  • โœจ Initial release with 21 Token Metrics API endpoints
  • ๐Ÿ†• NEW: Hourly Trading Signals - Real-time AI trading recommendations updated hourly
  • ๐Ÿ’ฌ Interactive chat interface
  • ๐Ÿ“š Comprehensive examples and tests
  • ๐Ÿ›ก๏ธ Built-in error handling and rate limiting
  • ๐Ÿ”ท Full TypeScript support
  • ๐Ÿ“Š Crypto indices tracking with holdings and performance data

๐Ÿ“‹ Quick Reference

๐Ÿš€ Essential Commands

# Installation
npm install tokenmetrics-virtuals-plugin

# Setup
cp env.example .env

# Test installation
npm run test:setup

# Interactive testing
npm run chat

# Build for production
npm run build

โšก Quick Integration Template

import { config } from "dotenv";
config({ path: "./.env" });
import TokenMetricsPlugin from "tokenmetrics-virtuals-plugin";
import { GameAgent } from "@virtuals-protocol/game";

const plugin = new TokenMetricsPlugin({
  apiClientConfig: { apiKey: process.env.TOKENMETRICS_API_KEY! }
});

const agent = new GameAgent(process.env.GAME_API_KEY!, {
  name: "Crypto AI Agent",
  goal: "Provide crypto analysis",
  workers: [plugin.getWorker({})]
});

await agent.init();

๐ŸŽฏ Most Used Functions

  • getTokens() - Get all supported cryptocurrencies
  • getPriceData(token_id) - Get current prices
  • getTradingSignals() - Get buy/sell recommendations
  • getTokenMetricsAi(message) - Chat with Token Metrics AI
  • getMarketMetrics() - Get market overview
  • getIndices() - Get crypto indices data (NEW!)
  • getIndicesHoldings(id) - Get index portfolio composition (NEW!)

๐Ÿš€ Ready to revolutionize your crypto analysis?

๐Ÿ“– Documentation


Made with โค๏ธ by the Token Metrics team