get_total_tvl
Retrieve the total value locked (TVL) in SailFish DEX to monitor liquidity and token activity using the EDUCHAIN Agent Kit.
Instructions
Get the total value locked (TVL) in SailFish DEX
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"required": [],
"type": "object"
}
Implementation Reference
- src/index.ts:807-818 (handler)MCP tool handler for 'get_total_tvl' that invokes subgraph.getTotalTVL() and formats the response as JSON.case 'get_total_tvl': { const tvl = await subgraph.getTotalTVL(); return { content: [ { type: 'text', text: JSON.stringify({ totalValueLockedUSD: tvl }, null, 2), }, ], }; }
- src/subgraph.ts:403-415 (helper)Core implementation that queries the subgraph factory for totalValueLockedUSD.export async function getTotalTVL(): Promise<string> { try { const factory = await getFactory(); if (!factory) { throw new Error('Factory data not available'); } return factory.totalValueLockedUSD; } catch (error) { console.error('Error fetching total TVL:', error); throw error; } }
- src/index.ts:246-252 (schema)Input schema definition (empty object, no parameters required) and tool registration in the ListTools handler.name: 'get_total_tvl', description: 'Get the total value locked (TVL) in SailFish DEX', inputSchema: { type: 'object', properties: {}, required: [], },