UNPKG

@gala-chain/launchpad-mcp-server

Version:

MCP server for Gala Launchpad - 102 tools (pool management, event watchers, GSwap DEX trading, price history, token creation, wallet management, DEX pool discovery, liquidity positions, token locks, locked token queries, composite pool data, cross-chain b

169 lines (153 loc) 5.95 kB
"use strict"; /** * Real-Time Monitoring Prompts * * Slash commands for monitoring live events via WebSocket */ Object.defineProperty(exports, "__esModule", { value: true }); exports.monitoringPrompts = exports.watchTokenLaunchesPrompt = exports.watchDexPoolCreationPrompt = void 0; const mcpToolNames_js_1 = require("../constants/mcpToolNames.js"); const validation_js_1 = require("../utils/validation.js"); const handlerHelpers_js_1 = require("./utils/handlerHelpers.js"); /** * Watch DEX Pool Creation - Monitor for new DEX pools being created * * Monitors WebSocket for new GalaSwap DEX pool creation events in real-time */ exports.watchDexPoolCreationPrompt = { name: 'galachain-launchpad:watch-dex-pools', description: 'Watch for new DEX pools being created in real-time via WebSocket connection', arguments: [ { name: 'duration', description: 'How long to watch in seconds (e.g., 60 for 1 minute, 300 for 5 minutes)', required: false, }, { name: 'minTVL', description: 'Minimum TVL threshold to filter pools (e.g., 1000)', required: false, }, { name: 'tokens', description: 'Comma-separated token symbols to filter (e.g., "GALA,GUSDC")', required: false, }, ], handler: (args) => { const duration = args.duration || '60'; const filters = []; if (args.minTVL) { (0, validation_js_1.validateNumericAmount)(args.minTVL, 'minTVL'); filters.push(`- Minimum TVL: $${args.minTVL}`); } if (args.tokens) { const tokenList = args.tokens.split(',').map((t) => t.trim()).join(', '); filters.push(`- Token filter: ${tokenList}`); } const filterText = filters.length > 0 ? `\n**Filters:**\n${filters.join('\n')}` : '\n**No filters** - watching all new DEX pools'; return (0, handlerHelpers_js_1.createPromptResponse)(`Watch for new DEX pool creation events in real-time. **Monitoring Duration:** ${duration} seconds ${filterText} **Workflow:** 1. Establish WebSocket connection to GalaSwap events 2. Subscribe to DEX pool creation events 3. Filter incoming events based on criteria 4. Display pool details as they're created (token pairs, fee tiers, initial liquidity) 5. Close connection after ${duration} seconds **Event Details to Display:** - Token0 and Token1 symbols - Fee tier (500, 3000, or 10000 basis points) - Initial liquidity amount - Pool address - Creation timestamp - Initial TVL (if available) **Use Cases:** - Monitor when GALA trading pairs launch - Track new liquidity provision opportunities - Discover trending token pairs - Set up alerts for specific tokens **Important Notes:** - WebSocket connection stays open for the specified duration - Events are pushed in real-time as pools are created - Connection automatically closes after timeout - Can be interrupted early if needed Please use the following MCP tool: - ${mcpToolNames_js_1.MCP_TOOLS.ON_DEX_POOL_CREATION}: Watch for DEX pool creation events Proceed with monitoring.`); }, }; /** * Watch Token Launches - Monitor for new tokens being launched * * Monitors WebSocket for new Launchpad token creation events */ exports.watchTokenLaunchesPrompt = { name: 'galachain-launchpad:watch-token-launches', description: 'Watch for new tokens being launched on the platform in real-time via WebSocket', arguments: [ { name: 'duration', description: 'How long to watch in seconds (default: 60)', required: false, }, { name: 'creatorAddress', description: 'Filter by token creator address (e.g., "eth|0x...")', required: false, }, ], handler: (args) => { const duration = args.duration || '60'; const hasCreatorFilter = !!args.creatorAddress; return (0, handlerHelpers_js_1.createPromptResponse)(`Watch for new token launch events in real-time. **Monitoring Duration:** ${duration} seconds ${hasCreatorFilter ? `**Creator Filter:** ${args.creatorAddress}` : '**No filter** - watching all new token launches'} **Workflow:** 1. Establish WebSocket connection to Launchpad events 2. Subscribe to token creation events ${hasCreatorFilter ? '3. Filter events by creator address\n' : '3. Monitor all token launches\n'}${hasCreatorFilter ? '4' : '3'}. Display token details as they're launched ${hasCreatorFilter ? '5' : '4'}. Close connection after ${duration} seconds **Event Details to Display:** - Token name and symbol - Creator address - Initial supply and bonding curve parameters - Launch timestamp - Token image/metadata - Initial buy amount (if any) - Bonding curve pool address **Use Cases:** - Discover newly launched tokens immediately - Monitor specific creator's token launches - Track launch frequency and patterns - Get early entry opportunities **Real-Time Benefits:** - Zero polling delay - instant notifications - Efficient WebSocket connection - No API rate limits - Event-driven architecture **Important Notes:** - WebSocket stays open for specified duration - Events pushed as tokens launch - Can filter by creator for targeted monitoring - Auto-disconnect after timeout prevents resource leaks **Best Practices:** - Use reasonable durations (60-300 seconds typical) - Filter by creator when monitoring specific users - Process events immediately for time-sensitive actions - Close connection when done to free resources Please use the following MCP tool: - ${mcpToolNames_js_1.MCP_TOOLS.ON_LAUNCHPAD_TOKEN_CREATION}: Watch for token launch events Proceed with monitoring.`); }, }; /** * Export all monitoring prompts */ exports.monitoringPrompts = [ exports.watchDexPoolCreationPrompt, exports.watchTokenLaunchesPrompt, ]; //# sourceMappingURL=monitoring.js.map