get_trending_pools
Retrieve trending liquidity pools from GeckoTerminal across multiple networks to identify trading opportunities in DeFi markets.
Instructions
Get trending pools across all networks on GeckoTerminal
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| include | No | Attributes to include: 'base_token', 'quote_token', 'dex', 'network' (comma-separated) | |
| page | No | Page number for pagination (optional, default: 1) | |
| duration | No | Duration for trending: '5m', '1h', '6h', '24h' (optional, default: '24h') |
Implementation Reference
- Supporting utility method in CoinGeckoApiService that performs the actual HTTP fetch to the CoinGecko API endpoint for trending pools.
async getTrendingPools(options = {}) { try { const queryParams = new URLSearchParams(); if (options.include) queryParams.append('include', options.include); if (options.page) queryParams.append('page', options.page); if (options.duration) queryParams.append('duration', options.duration); const url = `${this.baseUrl}/networks/trending_pools${queryParams.toString() ? '?' + queryParams.toString() : ''}`; const response = await fetch(url, { headers: { 'x-cg-demo-api-key': this.apiKey } }); if (!response.ok) { throw new Error(`HTTP ${response.status}: ${response.statusText}`); } return await response.json(); } catch (error) { throw new Error(`Failed to get trending pools: ${error.message}`); } }