Skip to main content
Glama

get_24h_volume

Retrieve the 24-hour trading volume data on SailFish DEX using the EDUCHAIN Agent Kit for precise market insights and analysis.

Instructions

Get the 24-hour trading volume on SailFish DEX

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'get_24h_volume': calls subgraph.get24HVolume() and returns JSON response with volumeUSD.
    case 'get_24h_volume': {
      const volume = await subgraph.get24HVolume();
      
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({ volumeUSD: volume }, null, 2),
          },
        ],
      };
    }
  • src/index.ts:255-262 (registration)
    Tool registration in ListTools handler, including name, description, and input schema (no parameters required).
      name: 'get_24h_volume',
      description: 'Get the 24-hour trading volume on SailFish DEX',
      inputSchema: {
        type: 'object',
        properties: {},
        required: [],
      },
    },
  • Helper function get24HVolume() that fetches factory from subgraph and returns totalVolumeUSD as proxy for 24h volume.
    export async function get24HVolume(): Promise<string> {
      try {
        const factory = await getFactory();
        if (!factory) {
          throw new Error('Factory data not available');
        }
        
        // Note: This is a simplified approach. For more accurate 24h volume,
        // you would need to compare current volume with volume from 24h ago
        return factory.totalVolumeUSD;
      } catch (error) {
        console.error('Error calculating 24h volume:', error);
        throw error;
      }
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SailFish-Finance/educhain-ai-agent-kit'

If you have feedback or need assistance with the MCP directory API, please join our Discord server