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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"required": [],
"type": "object"
}
Implementation Reference
- src/index.ts:820-831 (handler)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: [], }, },
- src/subgraph.ts:386-400 (helper)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; } }